Flutter Engine
The Flutter Engine
Protected Member Functions | Protected Attributes | List of all members
flutter::testing::FuchsiaShellTest Class Reference
Inheritance diagram for flutter::testing::FuchsiaShellTest:
flutter::testing::ShellTest flutter::testing::FixtureTest flutter::testing::DartFixture flutter::testing::ThreadTest

Protected Member Functions

 FuchsiaShellTest ()
 
 ~FuchsiaShellTest ()
 
IntlSettings GetSettings ()
 
void SetTimezone (const std::string &timezone_name)
 
std::string GetLocalTimezone ()
 
std::string GetLocalTime ()
 
void AssertTimezone (const std::string &expected, const IntlSettings &settings)
 
- Protected Member Functions inherited from flutter::testing::DartFixture
void SetSnapshotsAndAssets (Settings &settings)
 

Protected Attributes

std::unique_ptr< sys::ComponentContext > ctx_
 
fuchsia::settings::IntlSyncPtr intl_
 
fuchsia::settings::IntlSettings save_settings_
 
- Protected Attributes inherited from flutter::testing::DartFixture
std::shared_ptr< TestDartNativeResolvernative_resolver_
 
ELFAOTSymbols split_aot_symbols_
 
std::string kernel_filename_
 
std::string elf_filename_
 
fml::UniqueFD assets_dir_
 
ELFAOTSymbols aot_symbols_
 

Additional Inherited Members

- Public Types inherited from flutter::testing::ShellTest
enum  ServiceProtocolEnum {
  kGetSkSLs , kEstimateRasterCacheMemory , kSetAssetBundlePath , kRunInView ,
  kRenderFrameWithRasterStats
}
 
- Public Member Functions inherited from flutter::testing::ShellTest
 ShellTest ()
 
Settings CreateSettingsForFixture () override
 
std::unique_ptr< ShellCreateShell (const Settings &settings, std::optional< TaskRunners > task_runners={})
 
std::unique_ptr< ShellCreateShell (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 SendEnginePlatformMessage (Shell *shell, std::unique_ptr< PlatformMessage > message)
 
std::shared_ptr< txt::FontCollectionGetFontCollection (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)
 
virtual Settings CreateSettingsForFixture ()
 
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::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 (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...
 
- Static Public Member Functions inherited from flutter::testing::ShellTest
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 &params, rapidjson::Document *response)
 
static int UnreportedTimingsCount (Shell *shell)
 
static size_t GetLiveTrackedPathCount (const std::shared_ptr< VolatilePathTracker > &tracker)
 
static void TurnOffGPU (Shell *shell, bool value)
 

Detailed Description

Definition at line 33 of file shell_fuchsia_unittests.cc.

Constructor & Destructor Documentation

◆ FuchsiaShellTest()

flutter::testing::FuchsiaShellTest::FuchsiaShellTest ( )
inlineprotected

Definition at line 35 of file shell_fuchsia_unittests.cc.

36 : ctx_(sys::ComponentContext::CreateAndServeOutgoingDirectory()),
37 intl_() {
38 ctx_->svc()->Connect(intl_.NewRequest());
39 }
std::unique_ptr< sys::ComponentContext > ctx_
fuchsia::settings::IntlSyncPtr intl_

◆ ~FuchsiaShellTest()

flutter::testing::FuchsiaShellTest::~FuchsiaShellTest ( )
inlineprotected

Definition at line 41 of file shell_fuchsia_unittests.cc.

41 {
42 // Restore the time zone that matches that of the test harness. This is
43 // the default.
44 // TODO(https://fxbug.dev/110019): This crashes right now.
45
46 // const std::string local_timezone = GetLocalTimezone();
47 // SetTimezone(local_timezone);
48 // AssertTimezone(local_timezone, GetSettings());
49 }

Member Function Documentation

◆ AssertTimezone()

void flutter::testing::FuchsiaShellTest::AssertTimezone ( const std::string &  expected,
const IntlSettings &  settings 
)
inlineprotected

Definition at line 91 of file shell_fuchsia_unittests.cc.

92 {
93 ASSERT_EQ(expected, settings.time_zone_id().id);
94 }

◆ GetLocalTime()

std::string flutter::testing::FuchsiaShellTest::GetLocalTime ( )
inlineprotected

Definition at line 77 of file shell_fuchsia_unittests.cc.

77 {
78 const time_t timestamp = time(nullptr);
79 const struct tm* local_time = localtime(&timestamp);
80 EXPECT_NE(local_time, nullptr)
81 << "Could not get local time: errno=" << errno << ": "
82 << strerror(errno);
83 char buffer[sizeof("2020-08-26 14")];
84 const size_t written =
85 strftime(buffer, sizeof(buffer), "%Y-%m-%d %H", local_time);
86 EXPECT_LT(0UL, written);
87 return std::string(buffer);
88 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
static double time(int loops, Benchmark *bench, Target *target)
Definition: nanobench.cpp:394

◆ GetLocalTimezone()

std::string flutter::testing::FuchsiaShellTest::GetLocalTimezone ( )
inlineprotected

Definition at line 68 of file shell_fuchsia_unittests.cc.

68 {
69 const time_t timestamp = time(nullptr);
70 const struct tm* local_time = localtime(&timestamp);
71 EXPECT_NE(local_time, nullptr)
72 << "Could not get local time: errno=" << errno << ": "
73 << strerror(errno);
74 return std::string(local_time->tm_zone);
75 }

◆ GetSettings()

IntlSettings flutter::testing::FuchsiaShellTest::GetSettings ( )
inlineprotected

Definition at line 52 of file shell_fuchsia_unittests.cc.

52 {
53 IntlSettings settings;
54 zx_status_t status = intl_->Watch(&settings);
55 EXPECT_EQ(status, ZX_OK);
56 return settings;
57 }

◆ SetTimezone()

void flutter::testing::FuchsiaShellTest::SetTimezone ( const std::string &  timezone_name)
inlineprotected

Definition at line 60 of file shell_fuchsia_unittests.cc.

60 {
61 fuchsia::settings::IntlSettings settings;
62 settings.set_time_zone_id(TimeZoneId{.id = timezone_name});
63 Intl_Set_Result result;
64 zx_status_t status = intl_->Set(std::move(settings), &result);
65 ASSERT_EQ(status, ZX_OK);
66 }
GAsyncResult * result

Member Data Documentation

◆ ctx_

std::unique_ptr<sys::ComponentContext> flutter::testing::FuchsiaShellTest::ctx_
protected

Definition at line 96 of file shell_fuchsia_unittests.cc.

◆ intl_

fuchsia::settings::IntlSyncPtr flutter::testing::FuchsiaShellTest::intl_
protected

Definition at line 97 of file shell_fuchsia_unittests.cc.

◆ save_settings_

fuchsia::settings::IntlSettings flutter::testing::FuchsiaShellTest::save_settings_
protected

Definition at line 99 of file shell_fuchsia_unittests.cc.


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