Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SemanticsObjectTestMocks.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_SEMANTICSOBJECTTESTMOCKS_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_SEMANTICSOBJECTTESTMOCKS_H_
7
8#import "flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h"
9
10const CGRect kScreenSize = CGRectMake(0, 0, 600, 800);
11
12namespace flutter {
13namespace testing {
14
16 public:
17 SemanticsActionObservation(int32_t observed_id, SemanticsAction observed_action)
18 : id(observed_id), action(observed_action) {}
19
20 int32_t id;
22};
23
25 public:
27 view_ = [[UIView alloc] initWithFrame:kScreenSize];
28 window_ = [[UIWindow alloc] initWithFrame:kScreenSize];
29 [window_ addSubview:view_];
30 }
31 bool isVoiceOverRunning() const override { return isVoiceOverRunningValue; }
32 UIView* view() const override { return view_; }
33 UIView<UITextInput>* textInputView() override { return nil; }
34 void DispatchSemanticsAction(int32_t id, SemanticsAction action) override {
35 SemanticsActionObservation observation(id, action);
36 observations.push_back(observation);
37 }
38 void DispatchSemanticsAction(int32_t id,
40 fml::MallocMapping args) override {
41 SemanticsActionObservation observation(id, action);
42 observations.push_back(observation);
43 }
44 void AccessibilityObjectDidBecomeFocused(int32_t id) override {}
45 void AccessibilityObjectDidLoseFocus(int32_t id) override {}
46 std::shared_ptr<FlutterPlatformViewsController> GetPlatformViewsController() const override {
47 return nil;
48 }
49 std::vector<SemanticsActionObservation> observations;
51
52 private:
53 UIView* view_;
54 UIWindow* window_;
55};
56
58 public:
60 view_ = [[UIView alloc] initWithFrame:kScreenSize];
61 }
62 bool isVoiceOverRunning() const override { return isVoiceOverRunningValue; }
63 UIView* view() const override { return view_; }
64 UIView<UITextInput>* textInputView() override { return nil; }
65 void DispatchSemanticsAction(int32_t id, SemanticsAction action) override {
66 SemanticsActionObservation observation(id, action);
67 observations.push_back(observation);
68 }
69 void DispatchSemanticsAction(int32_t id,
71 fml::MallocMapping args) override {
72 SemanticsActionObservation observation(id, action);
73 observations.push_back(observation);
74 }
75 void AccessibilityObjectDidBecomeFocused(int32_t id) override {}
76 void AccessibilityObjectDidLoseFocus(int32_t id) override {}
77 std::shared_ptr<FlutterPlatformViewsController> GetPlatformViewsController() const override {
78 return nil;
79 }
80 std::vector<SemanticsActionObservation> observations;
82
83 private:
84 UIView* view_;
85};
86} // namespace testing
87} // namespace flutter
88
89@interface SemanticsObject (Tests)
91- (BOOL)accessibilityScrollToVisibleWithChild:(id)child;
92- (id)_accessibilityHitTest:(CGPoint)point withEvent:(UIEvent*)event;
93@end
94
95#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_SEMANTICSOBJECTTESTMOCKS_H_
const CGRect kScreenSize
Interface that represents an accessibility bridge for iOS.
std::vector< SemanticsActionObservation > observations
void DispatchSemanticsAction(int32_t id, SemanticsAction action, fml::MallocMapping args) override
std::shared_ptr< FlutterPlatformViewsController > GetPlatformViewsController() const override
void DispatchSemanticsAction(int32_t id, SemanticsAction action) override
void DispatchSemanticsAction(int32_t id, SemanticsAction action, fml::MallocMapping args) override
std::shared_ptr< FlutterPlatformViewsController > GetPlatformViewsController() const override
UIView< UITextInput > * textInputView() override
void DispatchSemanticsAction(int32_t id, SemanticsAction action) override
std::vector< SemanticsActionObservation > observations
void AccessibilityObjectDidBecomeFocused(int32_t id) override
SemanticsActionObservation(int32_t observed_id, SemanticsAction observed_action)
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition mapping.h:144
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
instancetype initWithFrame
const uintptr_t id
int BOOL