Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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.
 
fml::AutoResetWaitableEvent term
 The waiter for thread finished.
 
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()
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
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
virtual TaskQueueId GetTaskQueueId()

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: