Flutter Engine
flutter::testing::TypeConversionsTest Class Reference
Inheritance diagram for flutter::testing::TypeConversionsTest:
flutter::testing::FixtureTest flutter::testing::ThreadTest

Public Member Functions

 TypeConversionsTest ()
 
 ~TypeConversionsTest ()=default
 
bool RunWithEntrypoint (const std::string &entrypoint)
 
- Public Member Functions inherited from flutter::testing::FixtureTest
 FixtureTest ()
 
virtual Settings CreateSettingsForFixture ()
 
void AddNativeCallback (std::string name, Dart_NativeFunction callback)
 
- Public Member Functions inherited from flutter::testing::ThreadTest
 ThreadTest ()
 
fml::RefPtr< fml::TaskRunnerGetCurrentTaskRunner ()
 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::TaskRunnerCreateNewThread (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...
 

Additional Inherited Members

- Protected Member Functions inherited from flutter::testing::FixtureTest
void SetSnapshotsAndAssets (Settings &settings)
 
- Protected Attributes inherited from flutter::testing::FixtureTest
std::shared_ptr< TestDartNativeResolvernative_resolver_
 

Detailed Description

Definition at line 14 of file type_conversions_unittests.cc.

Constructor & Destructor Documentation

◆ TypeConversionsTest()

flutter::testing::TypeConversionsTest::TypeConversionsTest ( )
inline

Definition at line 16 of file type_conversions_unittests.cc.

References ~TypeConversionsTest().

Settings settings_
static DartVMRef Create(Settings settings, fml::RefPtr< DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< DartSnapshot > isolate_snapshot=nullptr)
virtual Settings CreateSettingsForFixture()
Definition: fixture_test.cc:17

◆ ~TypeConversionsTest()

flutter::testing::TypeConversionsTest::~TypeConversionsTest ( )
default

Referenced by TypeConversionsTest().

Member Function Documentation

◆ RunWithEntrypoint()

bool flutter::testing::TypeConversionsTest::RunWithEntrypoint ( const std::string &  entrypoint)
inline

Definition at line 22 of file type_conversions_unittests.cc.

References flutter::testing::ThreadTest::CreateNewThread(), flutter::testing::GetCurrentTestName(), flutter::testing::GetFixturesPath(), flutter::testing::RunDartCodeInIsolate(), and flutter::DartIsolate::Running.

Referenced by flutter::testing::TEST_F().

22  {
23  if (running_isolate_) {
24  return false;
25  }
26  auto thread = CreateNewThread();
27  TaskRunners single_threaded_task_runner(GetCurrentTestName(), thread,
28  thread, thread, thread);
29  auto isolate =
30  RunDartCodeInIsolate(vm_, settings_, single_threaded_task_runner,
31  entrypoint, {}, GetFixturesPath());
32  if (!isolate || isolate->get()->GetPhase() != DartIsolate::Phase::Running) {
33  return false;
34  }
35 
36  running_isolate_ = std::move(isolate);
37  return true;
38  }
Settings settings_
fml::RefPtr< fml::TaskRunner > CreateNewThread(std::string name="")
Creates a new thread, initializes a message loop on it, and, returns its task runner to the unit-test...
Definition: thread_test.cc:26
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
Definition: testing.cc:12
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
std::unique_ptr< AutoIsolateShutdown > RunDartCodeInIsolate(DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &fixtures_path, fml::WeakPtr< IOManager > io_manager)

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