Flutter Engine
flutter_runner_test::SessionConnectionTest Class Reference
Inheritance diagram for flutter_runner_test::SessionConnectionTest:

Public Member Functions

void SetUp () override
 

Public Attributes

async::Loop loop_ = async::Loop(&kAsyncLoopConfigAttachToCurrentThread)
 
std::unique_ptr< sys::ComponentContext > context_
 
fuchsia::ui::scenic::ScenicPtr scenic_
 
fuchsia::ui::policy::PresenterPtr presenter_
 
fidl::InterfaceHandle< fuchsia::ui::scenic::Session > session_
 
fidl::InterfaceHandle< fuchsia::ui::scenic::SessionListener > session_listener_
 
zx::event vsync_event_
 
thrd_t fidl_thread_
 

Detailed Description

Definition at line 20 of file session_connection_unittests.cc.

Member Function Documentation

◆ SetUp()

void flutter_runner_test::SessionConnectionTest::SetUp ( )
inlineoverride

Definition at line 22 of file session_connection_unittests.cc.

References FML_CHECK.

22  {
23  context_ = sys::ComponentContext::CreateAndServeOutgoingDirectory();
24  scenic_ = context_->svc()->Connect<fuchsia::ui::scenic::Scenic>();
25  presenter_ = context_->svc()->Connect<fuchsia::ui::policy::Presenter>();
26 
27  FML_CHECK(ZX_OK ==
28  loop_.StartThread("SessionConnectionTestThread", &fidl_thread_));
29 
30  auto session_listener_request = session_listener_.NewRequest();
31 
32  scenic_->CreateSession(session_.NewRequest(), session_listener_.Bind());
33  FML_CHECK(zx::event::create(0, &vsync_event_) == ZX_OK);
34 
35  // Ensure Scenic has had time to wake up before the test logic begins.
36  // TODO(61768) Find a better solution than sleeping periodically checking a
37  // condition.
38  int scenic_initialized = false;
39  scenic_->GetDisplayInfo(
40  [&scenic_initialized](fuchsia::ui::gfx::DisplayInfo display_info) {
41  scenic_initialized = true;
42  });
43  while (!scenic_initialized) {
44  std::this_thread::sleep_for(std::chrono::milliseconds(100));
45  }
46  }
std::unique_ptr< sys::ComponentContext > context_
fidl::InterfaceHandle< fuchsia::ui::scenic::SessionListener > session_listener_
fidl::InterfaceHandle< fuchsia::ui::scenic::Session > session_
#define FML_CHECK(condition)
Definition: logging.h:68

Member Data Documentation

◆ context_

std::unique_ptr<sys::ComponentContext> flutter_runner_test::SessionConnectionTest::context_

Definition at line 51 of file session_connection_unittests.cc.

◆ fidl_thread_

thrd_t flutter_runner_test::SessionConnectionTest::fidl_thread_

Definition at line 58 of file session_connection_unittests.cc.

◆ loop_

async::Loop flutter_runner_test::SessionConnectionTest::loop_ = async::Loop(&kAsyncLoopConfigAttachToCurrentThread)

Definition at line 49 of file session_connection_unittests.cc.

◆ presenter_

fuchsia::ui::policy::PresenterPtr flutter_runner_test::SessionConnectionTest::presenter_

Definition at line 53 of file session_connection_unittests.cc.

◆ scenic_

fuchsia::ui::scenic::ScenicPtr flutter_runner_test::SessionConnectionTest::scenic_

Definition at line 52 of file session_connection_unittests.cc.

◆ session_

fidl::InterfaceHandle<fuchsia::ui::scenic::Session> flutter_runner_test::SessionConnectionTest::session_

Definition at line 55 of file session_connection_unittests.cc.

◆ session_listener_

fidl::InterfaceHandle<fuchsia::ui::scenic::SessionListener> flutter_runner_test::SessionConnectionTest::session_listener_

Definition at line 56 of file session_connection_unittests.cc.

◆ vsync_event_

zx::event flutter_runner_test::SessionConnectionTest::vsync_event_

Definition at line 57 of file session_connection_unittests.cc.


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