Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::testing::FlutterEngineTest Class Reference

#include <FlutterEngineTestUtils.h>

Inheritance diagram for flutter::testing::FlutterEngineTest:
flutter::testing::AutoreleasePoolTest flutter::testing::AutoreleasePoolTestMixin

Public Member Functions

 FlutterEngineTest ()
 
FlutterEngineGetFlutterEngine ()
 
void SetUp () override
 
void TearDown () override
 
void AddNativeCallback (const char *name, Dart_NativeFunction function)
 
void ShutDownEngine ()
 
- Public Member Functions inherited from flutter::testing::AutoreleasePoolTest
 AutoreleasePoolTest ()=default
 
 ~AutoreleasePoolTest ()=default
 
- Public Member Functions inherited from flutter::testing::AutoreleasePoolTestMixin
 AutoreleasePoolTestMixin ()=default
 
 ~AutoreleasePoolTestMixin ()=default
 

Static Public Member Functions

static void IsolateCreateCallback (void *user_data)
 

Detailed Description

Definition at line 18 of file FlutterEngineTestUtils.h.

Constructor & Destructor Documentation

◆ FlutterEngineTest()

FlutterEngineTest::FlutterEngineTest ( )
default

Member Function Documentation

◆ AddNativeCallback()

void FlutterEngineTest::AddNativeCallback ( const char *  name,
Dart_NativeFunction  function 
)

Definition at line 72 of file FlutterEngineTestUtils.mm.

72 {
73 native_resolver_->AddNativeCallback({name}, function);
74}
Dart_NativeFunction function
Definition: fuchsia.cc:51
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ GetFlutterEngine()

FlutterEngine * flutter::testing::FlutterEngineTest::GetFlutterEngine ( )
inline

Definition at line 22 of file FlutterEngineTestUtils.h.

22{ return engine_; };

◆ IsolateCreateCallback()

void FlutterEngineTest::IsolateCreateCallback ( void *  user_data)
static

Definition at line 68 of file FlutterEngineTestUtils.mm.

68 {
69 native_resolver_->SetNativeResolverForIsolate();
70}

◆ SetUp()

void FlutterEngineTest::SetUp ( )
override

Definition at line 45 of file FlutterEngineTestUtils.mm.

45 {
46 native_resolver_ = std::make_shared<TestDartNativeResolver>();
47 NSString* fixtures = @(testing::GetFixturesPath());
48 project_ = [[FlutterDartProject alloc]
49 initWithAssetsPath:fixtures
50 ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
52 engine_ = [[FlutterEngine alloc] initWithName:@"test"
53 project:project_
54 allowHeadlessExecution:true];
55}
static void IsolateCreateCallback(void *user_data)
void(* rootIsolateCreateCallback)(void *_Nullable)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...

◆ ShutDownEngine()

void FlutterEngineTest::ShutDownEngine ( )

Definition at line 63 of file FlutterEngineTestUtils.mm.

63 {
64 [engine_ shutDownEngine];
65 engine_ = nil;
66}

◆ TearDown()

void FlutterEngineTest::TearDown ( )
override

Definition at line 57 of file FlutterEngineTestUtils.mm.

57 {
58 [engine_ shutDownEngine];
59 engine_ = nil;
60 native_resolver_.reset();
61}

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