Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
fml::testing::TaskQueueWrapper Struct Reference

A mock task queue NOT calling MessageLoop->Run() in thread. More...

Public Member Functions

 TaskQueueWrapper ()
 
 ~TaskQueueWrapper ()
 
fml::TaskQueueId GetTaskQueueId () const
 

Public Attributes

fml::MessageLooploop = nullptr
 
fml::AutoResetWaitableEvent latch
 The waiter for message loop initialized ok. More...
 
fml::AutoResetWaitableEvent term
 The waiter for thread finished. More...
 
std::thread thread
 

Detailed Description

A mock task queue NOT calling MessageLoop->Run() in thread.

Definition at line 23 of file raster_thread_merger_unittests.cc.

Constructor & Destructor Documentation

◆ TaskQueueWrapper()

fml::testing::TaskQueueWrapper::TaskQueueWrapper ( )
inline

Definition at line 38 of file raster_thread_merger_unittests.cc.

39 : thread([this]() {
42 latch.Signal();
43 term.Wait();
44 }) {
45 latch.Wait();
46 }
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
Definition: message_loop.cc:19
fml::AutoResetWaitableEvent term
The waiter for thread finished.
fml::AutoResetWaitableEvent latch
The waiter for message loop initialized ok.

◆ ~TaskQueueWrapper()

fml::testing::TaskQueueWrapper::~TaskQueueWrapper ( )
inline

Definition at line 48 of file raster_thread_merger_unittests.cc.

48 {
49 term.Signal();
50 thread.join();
51 }

Member Function Documentation

◆ GetTaskQueueId()

fml::TaskQueueId fml::testing::TaskQueueWrapper::GetTaskQueueId ( ) const
inline

Definition at line 53 of file raster_thread_merger_unittests.cc.

53 {
55 }
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: message_loop.cc:56
virtual TaskQueueId GetTaskQueueId()
Definition: task_runner.cc:38

Member Data Documentation

◆ latch

fml::AutoResetWaitableEvent fml::testing::TaskQueueWrapper::latch

The waiter for message loop initialized ok.

Definition at line 27 of file raster_thread_merger_unittests.cc.

◆ loop

fml::MessageLoop* fml::testing::TaskQueueWrapper::loop = nullptr

Definition at line 24 of file raster_thread_merger_unittests.cc.

◆ term

fml::AutoResetWaitableEvent fml::testing::TaskQueueWrapper::term

The waiter for thread finished.

Definition at line 30 of file raster_thread_merger_unittests.cc.

◆ thread

std::thread fml::testing::TaskQueueWrapper::thread

This field must below latch and term member, because cpp standard reference: non-static data members are initialized in the order they were declared in the class definition

Definition at line 36 of file raster_thread_merger_unittests.cc.


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