#include <shell_test.h>
Classes | |
| struct | Config |
Public Types | |
| enum | ServiceProtocolEnum { kGetSkSLs , kEstimateRasterCacheMemory , kSetAssetBundlePath , kRunInView } |
Public Member Functions | |
| ShellTest () | |
| Settings | CreateSettingsForFixture () override |
| std::unique_ptr< Shell > | CreateShell (const Settings &settings, std::optional< TaskRunners > task_runners={}) |
| std::unique_ptr< Shell > | CreateShell (const Config &config) |
| void | DestroyShell (std::unique_ptr< Shell > shell) |
| void | DestroyShell (std::unique_ptr< Shell > shell, const TaskRunners &task_runners) |
| TaskRunners | GetTaskRunnersForFixture () |
| fml::TimePoint | GetLatestFrameTargetTime (Shell *shell) const |
| void | SendPlatformMessage (Shell *shell, std::unique_ptr< PlatformMessage > message) |
| void | SendSemanticsAction (Shell *shell, int64_t view_id, int32_t node_id, SemanticsAction action, fml::MallocMapping args) |
| void | SendEnginePlatformMessage (Shell *shell, std::unique_ptr< PlatformMessage > message) |
| std::shared_ptr< txt::FontCollection > | GetFontCollection (Shell *shell) |
Public Member Functions inherited from flutter::testing::FixtureTest | |
| FixtureTest () | |
| FixtureTest (std::string kernel_filename, std::string elf_filename, std::string elf_split_filename) | |
Public Member Functions inherited from flutter::testing::DartFixture | |
| DartFixture () | |
| DartFixture (std::string kernel_filename, std::string elf_filename, std::string elf_split_filename) | |
| void | AddNativeCallback (const std::string &name, Dart_NativeFunction callback) |
| void | AddFfiNativeCallback (const std::string &name, void *callback_ptr) |
Public Member Functions inherited from flutter::testing::ThreadTest | |
| 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. | |
| 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. | |
Static Public Member Functions | |
| static void | PlatformViewNotifyCreated (Shell *shell) |
| static void | PlatformViewNotifyDestroyed (Shell *shell) |
| static void | RunEngine (Shell *shell, RunConfiguration configuration) |
| static void | RestartEngine (Shell *shell, RunConfiguration configuration) |
| static void | VSyncFlush (Shell *shell, bool *will_draw_new_frame=nullptr) |
| static void | SetViewportMetrics (Shell *shell, double width, double height) |
| static void | NotifyIdle (Shell *shell, fml::TimeDelta deadline) |
| static void | PumpOneFrame (Shell *shell) |
| static void | PumpOneFrame (Shell *shell, FrameContent frame_content) |
| static void | DispatchFakePointerData (Shell *shell, double x) |
| static void | DispatchPointerData (Shell *shell, std::unique_ptr< PointerDataPacket > packet) |
| static bool | GetNeedsReportTimings (Shell *shell) |
| static void | SetNeedsReportTimings (Shell *shell, bool value) |
| static void | StorePersistentCache (PersistentCache *cache, const SkData &key, const SkData &value) |
| static bool | IsAnimatorRunning (Shell *shell) |
| static void | OnServiceProtocol (Shell *shell, ServiceProtocolEnum some_protocol, const fml::RefPtr< fml::TaskRunner > &task_runner, const ServiceProtocol::Handler::ServiceProtocolMap ¶ms, rapidjson::Document *response) |
| static int | UnreportedTimingsCount (Shell *shell) |
| static void | TurnOffGPU (Shell *shell, bool value) |
| static bool | ShouldDiscardLayerTree (Shell *shell, int64_t view_id, const flutter::LayerTree &tree) |
Additional Inherited Members | |
Protected Member Functions inherited from flutter::testing::DartFixture | |
| void | SetSnapshotsAndAssets (Settings &settings) |
Protected Attributes inherited from flutter::testing::DartFixture | |
| std::shared_ptr< TestDartNativeResolver > | native_resolver_ |
| ELFAOTSymbols | split_aot_symbols_ |
| std::string | kernel_filename_ |
| std::string | elf_filename_ |
| fml::UniqueFD | assets_dir_ |
| ELFAOTSymbols | aot_symbols_ |
Definition at line 63 of file shell_test.h.
| Enumerator | |
|---|---|
| kGetSkSLs | |
| kEstimateRasterCacheMemory | |
| kSetAssetBundlePath | |
| kRunInView | |
Definition at line 140 of file shell_test.h.
| flutter::testing::ShellTest::ShellTest | ( | ) |
Definition at line 58 of file shell_test.cc.
|
overridevirtual |
Reimplemented from flutter::testing::DartFixture.
Definition at line 345 of file shell_test.cc.
References fml::MessageLoopTaskQueues::AddTaskObserver(), fml::MessageLoop::GetCurrentTaskQueueId(), fml::MessageLoopTaskQueues::GetInstance(), handler, flutter::Settings::isolate_create_callback, key, flutter::Settings::leak_vm, fml::MessageLoopTaskQueues::RemoveTaskObserver(), flutter::Settings::task_observer_add, flutter::Settings::task_observer_remove, and flutter::Settings::verbose_logging.
Referenced by flutter::testing::TestSimulatedInputEvents().
Definition at line 391 of file shell_test.cc.
References flutter::testing::GetTaskRunnersForFixture(), flutter::testing::ShellTest::Config::is_gpu_disabled, flutter::testing::ShellTest::Config::platform_view_create_callback, flutter::testing::ShellTest::Config::settings, and flutter::testing::ShellTest::Config::task_runners.
| std::unique_ptr< Shell > flutter::testing::ShellTest::CreateShell | ( | const Settings & | settings, |
| std::optional< TaskRunners > | task_runners = {} |
||
| ) |
Definition at line 382 of file shell_test.cc.
Referenced by flutter::testing::TestSimulatedInputEvents().
| void flutter::testing::ShellTest::DestroyShell | ( | std::unique_ptr< Shell > | shell | ) |
Definition at line 413 of file shell_test.cc.
References flutter::testing::GetTaskRunnersForFixture().
| void flutter::testing::ShellTest::DestroyShell | ( | std::unique_ptr< Shell > | shell, |
| const TaskRunners & | task_runners | ||
| ) |
Definition at line 417 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), fml::TaskRunner::RunNowOrPostTask(), and fml::AutoResetWaitableEvent::Wait().
|
static |
Definition at line 273 of file shell_test.cc.
References flutter::PointerData::change, and x.
Referenced by flutter::testing::TestSimulatedInputEvents().
|
static |
Definition at line 282 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetPlatformView(), flutter::Shell::GetTaskRunners(), fml::TaskRunner::PostTask(), fml::AutoResetWaitableEvent::Signal(), and fml::AutoResetWaitableEvent::Wait().
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| std::shared_ptr< txt::FontCollection > flutter::testing::ShellTest::GetFontCollection | ( | Shell * | shell | ) |
Definition at line 340 of file shell_test.cc.
| fml::TimePoint flutter::testing::ShellTest::GetLatestFrameTargetTime | ( | Shell * | shell | ) | const |
Definition at line 378 of file shell_test.cc.
|
static |
Definition at line 302 of file shell_test.cc.
| TaskRunners flutter::testing::ShellTest::GetTaskRunnersForFixture | ( | ) |
Definition at line 368 of file shell_test.cc.
References thread_host_.
Referenced by flutter::testing::TestSimulatedInputEvents().
|
static |
|
static |
Definition at line 212 of file shell_test.cc.
References engine, flutter::Shell::GetTaskRunners(), flutter::TaskRunners::GetUITaskRunner(), fml::TaskRunner::PostTask(), and fml::AutoResetWaitableEvent::Signal().
|
static |
Definition at line 312 of file shell_test.cc.
References params, and fml::TaskRunner::RunNowOrPostTask().
|
static |
Definition at line 93 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetTaskRunners(), fml::TaskRunner::RunNowOrPostTask(), and fml::AutoResetWaitableEvent::Wait().
Referenced by flutter::testing::ValidateShell().
|
static |
Definition at line 103 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetTaskRunners(), fml::TaskRunner::RunNowOrPostTask(), and fml::AutoResetWaitableEvent::Wait().
Referenced by flutter::testing::ValidateDestroyPlatformView().
|
static |
Definition at line 224 of file shell_test.cc.
|
static |
Definition at line 228 of file shell_test.cc.
References engine, fml::TimeDelta::FromSecondsF(), flutter::Shell::GetTaskRunners(), flutter::TaskRunners::GetUITaskRunner(), fml::TimePoint::Now(), fml::TaskRunner::PostTask(), fml::AutoResetWaitableEvent::Signal(), and view_id.
|
static |
Definition at line 127 of file shell_test.cc.
References flutter::Shell::GetTaskRunners(), flutter::TaskRunners::GetUITaskRunner(), and fml::TaskRunner::RunNowOrPostTask().
Referenced by flutter::testing::TestSimulatedInputEvents().
|
static |
Definition at line 113 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetTaskRunners(), and fml::TaskRunner::RunNowOrPostTask().
Referenced by flutter::testing::TestSimulatedInputEvents().
| void flutter::testing::ShellTest::SendEnginePlatformMessage | ( | Shell * | shell, |
| std::unique_ptr< PlatformMessage > | message | ||
| ) |
Definition at line 77 of file shell_test.cc.
References flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetTaskRunners(), fml::MakeCopyable(), message, fml::TaskRunner::RunNowOrPostTask(), and fml::AutoResetWaitableEvent::Signal().
| void flutter::testing::ShellTest::SendPlatformMessage | ( | Shell * | shell, |
| std::unique_ptr< PlatformMessage > | message | ||
| ) |
Definition at line 63 of file shell_test.cc.
References message.
| void flutter::testing::ShellTest::SendSemanticsAction | ( | Shell * | shell, |
| int64_t | view_id, | ||
| int32_t | node_id, | ||
| SemanticsAction | action, | ||
| fml::MallocMapping | args | ||
| ) |
Definition at line 68 of file shell_test.cc.
|
static |
Definition at line 298 of file shell_test.cc.
References value.
|
static |
Definition at line 163 of file shell_test.cc.
References engine, flutter::Shell::GetTaskRunners(), flutter::TaskRunners::GetUITaskRunner(), height, fml::TaskRunner::PostTask(), fml::AutoResetWaitableEvent::Signal(), and width.
|
static |
Definition at line 432 of file shell_test.cc.
References view_id.
|
static |
Definition at line 306 of file shell_test.cc.
|
static |
Definition at line 428 of file shell_test.cc.
References value.
|
static |
Definition at line 294 of file shell_test.cc.
|
static |
Issue as many VSYNC as needed to flush the UI tasks so far, and reset the content of will_draw_new_frame to true if it's not nullptr.
Definition at line 137 of file shell_test.cc.
References fml::TimeDelta::FromMilliseconds(), flutter::TaskRunners::GetPlatformTaskRunner(), flutter::Shell::GetPlatformView(), flutter::Shell::GetTaskRunners(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), and flutter::testing::ShellTestPlatformView::SimulateVSync().
Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TestSimulatedInputEvents().