Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::testing::WindowsTestContext Class Reference

#include <windows_test_context.h>

Public Member Functions

 WindowsTestContext (std::string_view assets_path="")
 
virtual ~WindowsTestContext ()
 
const std::wstring & GetAssetsPath () const
 
const std::wstring & GetIcuDataPath () const
 
const std::wstring & GetAotLibraryPath () const
 
void AddNativeFunction (std::string_view name, Dart_NativeFunction function)
 
fml::closure GetRootIsolateCallback ()
 

Detailed Description

Definition at line 24 of file windows_test_context.h.

Constructor & Destructor Documentation

◆ WindowsTestContext()

flutter::testing::WindowsTestContext::WindowsTestContext ( std::string_view  assets_path = "")
explicit

Definition at line 12 of file windows_test_context.cc.

13 : assets_path_(fml::Utf8ToWideString(assets_path)),
14 native_resolver_(std::make_shared<TestDartNativeResolver>()) {
15 isolate_create_callbacks_.push_back(
16 [weak_resolver =
17 std::weak_ptr<TestDartNativeResolver>{native_resolver_}]() {
18 if (auto resolver = weak_resolver.lock()) {
19 resolver->SetNativeResolverForIsolate();
20 }
21 });
22}
std::wstring Utf8ToWideString(const std::string_view str)

◆ ~WindowsTestContext()

flutter::testing::WindowsTestContext::~WindowsTestContext ( )
virtualdefault

Member Function Documentation

◆ AddNativeFunction()

void flutter::testing::WindowsTestContext::AddNativeFunction ( std::string_view  name,
Dart_NativeFunction  function 
)

Definition at line 38 of file windows_test_context.cc.

39 {
40 native_resolver_->AddNativeCallback(std::string{name}, function);
41}
Dart_NativeFunction function
Definition fuchsia.cc:51
DEF_SWITCHES_START aot vmservice shared library name
Definition switches.h:32

◆ GetAotLibraryPath()

const std::wstring & flutter::testing::WindowsTestContext::GetAotLibraryPath ( ) const

Definition at line 34 of file windows_test_context.cc.

34 {
35 return aot_library_path_;
36}

◆ GetAssetsPath()

const std::wstring & flutter::testing::WindowsTestContext::GetAssetsPath ( ) const

Definition at line 26 of file windows_test_context.cc.

26 {
27 return assets_path_;
28}

◆ GetIcuDataPath()

const std::wstring & flutter::testing::WindowsTestContext::GetIcuDataPath ( ) const

Definition at line 30 of file windows_test_context.cc.

30 {
31 return icu_data_path_;
32}

◆ GetRootIsolateCallback()

fml::closure flutter::testing::WindowsTestContext::GetRootIsolateCallback ( )

Definition at line 43 of file windows_test_context.cc.

43 {
44 return [this]() {
45 for (auto closure : this->isolate_create_callbacks_) {
46 closure();
47 }
48 };
49}
std::function< void()> closure
Definition closure.h:14

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