Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter_runner::testing::TextDelegateTest Class Reference
Inheritance diagram for flutter_runner::testing::TextDelegateTest:

Protected Member Functions

 TextDelegateTest ()
 
void RunLoopUntilIdle ()
 
void TearDown () override
 

Protected Attributes

async::Loop loop_
 
FakeKeyboardService keyboard_service_
 
fidl::Binding< fuchsia::ui::input3::Keyboard > keyboard_service_binding_
 
FakeImeService ime_service_
 
fidl::Binding< fuchsia::ui::input::ImeService > ime_service_binding_
 
std::unique_ptr< TextDelegatetext_delegate_
 
std::unique_ptr< flutter::PlatformMessagelast_message_
 

Detailed Description

Definition at line 78 of file text_delegate_unittests.cc.

Constructor & Destructor Documentation

◆ TextDelegateTest()

flutter_runner::testing::TextDelegateTest::TextDelegateTest ( )
inlineprotected

Definition at line 80 of file text_delegate_unittests.cc.

81 : loop_(&kAsyncLoopConfigAttachToCurrentThread),
84 fidl::InterfaceHandle<fuchsia::ui::input3::Keyboard> keyboard_handle;
85 auto keyboard_request = keyboard_handle.NewRequest();
86 keyboard_service_binding_.Bind(keyboard_request.TakeChannel());
87
88 fidl::InterfaceHandle<fuchsia::ui::input::ImeService> ime_service_handle;
89 ime_service_binding_.Bind(ime_service_handle.NewRequest().TakeChannel());
90
91 fuchsia::ui::views::ViewRefControl view_ref_control;
92 fuchsia::ui::views::ViewRef view_ref;
93 auto status = zx::eventpair::create(
94 /*options*/ 0u, &view_ref_control.reference, &view_ref.reference);
95 ZX_ASSERT(status == ZX_OK);
96 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
97
98 text_delegate_ = std::make_unique<TextDelegate>(
99 std::move(view_ref), std::move(ime_service_handle),
100 std::move(keyboard_handle),
101 // Should this be accessed through a weak pointer?
102 [this](std::unique_ptr<flutter::PlatformMessage> message) {
103 last_message_ = std::move(message);
104 });
105
106 // TextDelegate has some async initialization that needs to happen.
108 }
fidl::Binding< fuchsia::ui::input3::Keyboard > keyboard_service_binding_
fidl::Binding< fuchsia::ui::input::ImeService > ime_service_binding_
std::unique_ptr< flutter::PlatformMessage > last_message_
const char * message

References ime_service_binding_, keyboard_service_binding_, last_message_, message, RunLoopUntilIdle(), and text_delegate_.

Member Function Documentation

◆ RunLoopUntilIdle()

void flutter_runner::testing::TextDelegateTest::RunLoopUntilIdle ( )
inlineprotected

Definition at line 111 of file text_delegate_unittests.cc.

111{ loop_.RunUntilIdle(); }

References loop_.

Referenced by TextDelegateTest().

◆ TearDown()

void flutter_runner::testing::TextDelegateTest::TearDown ( )
inlineoverrideprotected

Definition at line 113 of file text_delegate_unittests.cc.

113 {
114 loop_.Quit();
115 ASSERT_EQ(loop_.ResetQuit(), 0);
116 }

References loop_.

Member Data Documentation

◆ ime_service_

FakeImeService flutter_runner::testing::TextDelegateTest::ime_service_
protected

Definition at line 123 of file text_delegate_unittests.cc.

◆ ime_service_binding_

fidl::Binding<fuchsia::ui::input::ImeService> flutter_runner::testing::TextDelegateTest::ime_service_binding_
protected

Definition at line 124 of file text_delegate_unittests.cc.

Referenced by TextDelegateTest().

◆ keyboard_service_

FakeKeyboardService flutter_runner::testing::TextDelegateTest::keyboard_service_
protected

Definition at line 120 of file text_delegate_unittests.cc.

◆ keyboard_service_binding_

fidl::Binding<fuchsia::ui::input3::Keyboard> flutter_runner::testing::TextDelegateTest::keyboard_service_binding_
protected

Definition at line 121 of file text_delegate_unittests.cc.

Referenced by TextDelegateTest().

◆ last_message_

std::unique_ptr<flutter::PlatformMessage> flutter_runner::testing::TextDelegateTest::last_message_
protected

Definition at line 129 of file text_delegate_unittests.cc.

Referenced by TextDelegateTest().

◆ loop_

async::Loop flutter_runner::testing::TextDelegateTest::loop_
protected

Definition at line 118 of file text_delegate_unittests.cc.

Referenced by RunLoopUntilIdle(), and TearDown().

◆ text_delegate_

std::unique_ptr<TextDelegate> flutter_runner::testing::TextDelegateTest::text_delegate_
protected

Definition at line 127 of file text_delegate_unittests.cc.

Referenced by TextDelegateTest().


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