| 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 46 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 52 of file accessibility_plugin_unittests.cc.

52 { return engine_.get(); }

## ◆ messenger()

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

Definition at line 53 of file accessibility_plugin_unittests.cc.

53 { return &messenger_; }

## ◆ SendAnnounceMessage()

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

Definition at line 73 of file accessibility_plugin_unittests.cc.

73 {
74 EncodableMap data;
75 data[EncodableValue{"message"}] = EncodableValue{message};
76 data[EncodableValue{"viewId"}] = view_id;
77
78 EncodableMap msg;
79 msg[EncodableValue{"type"}] = EncodableValue{"announce"};
80 msg[EncodableValue{"data"}] = EncodableValue{data};
81
82 auto encoded =
83 StandardMessageCodec::GetInstance().EncodeMessage(EncodableValue{msg});
84
85 bool handled = messenger_.SimulateEngineMessage(
86 kAccessibilityChannelName, encoded->data(), encoded->size(),
87 [](const uint8_t* reply, size_t reply_size) {});
88
89 EXPECT_TRUE(handled)
90 << "Message was not handled by the accessibility channel";
91 }
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 55 of file accessibility_plugin_unittests.cc.

55 {
56 WindowsTest::SetUp();
57
58 FlutterWindowsEngineBuilder builder{GetContext()};
59 engine_ = builder.Build();
60
61 auto window = std::make_unique<NiceMock<MockWindowBindingHandler>>();
62 view_ = std::make_unique<NiceMock<MockFlutterWindowsView>>(
63 engine_.get(), std::move(window));
64
65 EngineModifier modifier{engine_.get()};
66 modifier.SetSemanticsEnabled(true);
67 modifier.SetImplicitView(view_.get());
68
69 plugin_ = std::make_unique<AccessibilityPlugin>(engine_.get());
70 AccessibilityPlugin::SetUp(&messenger_, plugin_.get());
71 }
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 93 of file accessibility_plugin_unittests.cc.

93 { return view_.get(); }

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

- shell/platform/windows/accessibility_plugin_unittests.cc