Flutter Engine
The Flutter Engine
|
A fixture that creates threads with running message loops that are terminated when the test is done (the threads are joined then as well). While this fixture may be used on it's own, it is often sub-classed by other fixtures whose functioning requires threads to be created as necessary. More...
#include <thread_test.h>
Public Member Functions | |
ThreadTest () | |
fml::RefPtr< fml::TaskRunner > | GetCurrentTaskRunner () |
Get the task runner for the thread that the current unit-test is running on. This creates a message loop as necessary. More... | |
fml::RefPtr< fml::TaskRunner > | CreateNewThread (const std::string &name="") |
Creates a new thread, initializes a message loop on it, and, returns its task runner to the unit-test. The message loop is terminated (and its thread joined) when the test ends. This allows tests to create multiple named threads as necessary. More... | |
A fixture that creates threads with running message loops that are terminated when the test is done (the threads are joined then as well). While this fixture may be used on it's own, it is often sub-classed by other fixtures whose functioning requires threads to be created as necessary.
Definition at line 27 of file thread_test.h.
flutter::testing::ThreadTest::ThreadTest | ( | ) |
Definition at line 20 of file thread_test.cc.
fml::RefPtr< fml::TaskRunner > flutter::testing::ThreadTest::CreateNewThread | ( | const std::string & | name = "" | ) |
Creates a new thread, initializes a message loop on it, and, returns its task runner to the unit-test. The message loop is terminated (and its thread joined) when the test ends. This allows tests to create multiple named threads as necessary.
[in] | name | The name of the OS thread created. |
Definition at line 26 of file thread_test.cc.
fml::RefPtr< fml::TaskRunner > flutter::testing::ThreadTest::GetCurrentTaskRunner | ( | ) |
Get the task runner for the thread that the current unit-test is running on. This creates a message loop as necessary.
GetThreadTaskRunner
, CreateNewThread
.Definition at line 22 of file thread_test.cc.