| Flutter Windows Embedder |

Public Member Functions | Protected Member Functions | List of all members
flutter::testing::AccessibilityPluginTest Class Reference
Inheritance diagram for flutter::testing::AccessibilityPluginTest:

## Public Member Functions
| AccessibilityPluginTest ()=default
virtual | ~AccessibilityPluginTest ()=default

## Protected Member Functions
FlutterWindowsEngine * | engine ()
TestBinaryMessenger * | messenger ()
void | SetUp () override
void | SendAnnounceMessage (const std::string &message, EncodableValue view_id)
MockFlutterWindowsView * | view ()

## Detailed Description

Definition at line 42 of file accessibility_plugin_unittests.cc.

## Constructor & Destructor Documentation

## ◆ AccessibilityPluginTest()

flutter::testing::AccessibilityPluginTest::AccessibilityPluginTest | ( |  | ) |
| default

## ◆ ~AccessibilityPluginTest()

virtual flutter::testing::AccessibilityPluginTest::~AccessibilityPluginTest | ( |  | ) |
| virtual default

## Member Function Documentation

## ◆ engine()

FlutterWindowsEngine* flutter::testing::AccessibilityPluginTest::engine | ( |  | ) |
| inline protected

Definition at line 48 of file accessibility_plugin_unittests.cc.

48 { return engine_.get(); }

## ◆ messenger()

TestBinaryMessenger* flutter::testing::AccessibilityPluginTest::messenger | ( |  | ) |
| inline protected

Definition at line 49 of file accessibility_plugin_unittests.cc.

49 { return &messenger_; }

## ◆ SendAnnounceMessage()

void flutter::testing::AccessibilityPluginTest::SendAnnounceMessage | ( | const std::string & | message,
|  | EncodableValue | view_id
| ) |  |
| inline protected

Definition at line 69 of file accessibility_plugin_unittests.cc.

69 {
70 EncodableMap data;
71 data[EncodableValue{"message"}] = EncodableValue{message};
72 data[EncodableValue{"viewId"}] = view_id;
73
74 EncodableMap msg;
75 msg[EncodableValue{"type"}] = EncodableValue{"announce"};
76 msg[EncodableValue{"data"}] = EncodableValue{data};
77
78 auto encoded =
79 StandardMessageCodec::GetInstance().EncodeMessage(EncodableValue{msg});
80
81 bool handled = messenger_.SimulateEngineMessage(
82 kAccessibilityChannelName, encoded->data(), encoded->size(),
83 [](const uint8_t* reply, size_t reply_size) {});
84
85 EXPECT_TRUE(handled)
86 << "Message was not handled by the accessibility channel";
87 }
flutter::MessageCodec::EncodeMessage
std::unique_ptr< std::vector< uint8_t > > EncodeMessage(const T &message) const
Definition: message_codec.h:45
flutter::StandardMessageCodec::GetInstance
static const StandardMessageCodec & GetInstance(const StandardCodecSerializer *serializer=nullptr)
Definition: standard_codec.cc:293
kAccessibilityChannelName
static constexpr char kAccessibilityChannelName[]
Definition: flutter_windows_engine.cc:36
message
Win32Message message
Definition: keyboard_unittests.cc:137
flutter::EncodableMap
std::map< EncodableValue, EncodableValue > EncodableMap
Definition: encodable_value.h:96

References flutter::MessageCodec< T >::EncodeMessage(), flutter::StandardMessageCodec::GetInstance(), kAccessibilityChannelName, and message.

## ◆ SetUp()

void flutter::testing::AccessibilityPluginTest::SetUp | ( |  | ) |
| inline override protected

Definition at line 51 of file accessibility_plugin_unittests.cc.

51 {
52 WindowsTest::SetUp();
53
54 FlutterWindowsEngineBuilder builder{GetContext()};
55 engine_ = builder.Build();
56
57 auto window = std::make_unique<NiceMock<MockWindowBindingHandler>>();
58 view_ = std::make_unique<NiceMock<MockFlutterWindowsView>>(
59 engine_.get(), std::move(window));
60
61 EngineModifier modifier{engine_.get()};
62 modifier.SetSemanticsEnabled(true);
63 modifier.SetImplicitView(view_.get());
64
65 plugin_ = std::make_unique<AccessibilityPlugin>(engine_.get());
66 AccessibilityPlugin::SetUp(&messenger_, plugin_.get());
67 }
flutter::AccessibilityPlugin::SetUp
static void SetUp(BinaryMessenger *binary_messenger, AccessibilityPlugin *plugin)
Definition: accessibility_plugin.cc:91

References flutter::AccessibilityPlugin::SetUp().

## ◆ view()

MockFlutterWindowsView* flutter::testing::AccessibilityPluginTest::view | ( |  | ) |
| inline protected

Definition at line 89 of file accessibility_plugin_unittests.cc.

89 { return view_.get(); }

The documentation for this class was generated from the following file:

- shell/platform/windows/accessibility_plugin_unittests.cc