| Flutter macOS Embedder |

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:

## Public Member Functions
| FlutterEngineTest ()
FlutterEngine * | GetFlutterEngine ()
void | SetUp () override
void | TearDown () override
void | AddNativeCallback (const char *name, Dart_NativeFunction function)
void | ShutDownEngine ()

## Static Public Member Functions
static void | IsolateCreateCallback (void *user_data)

## Detailed Description

Definition at line 13 of file FlutterEngineTestUtils.h.

## Constructor & Destructor Documentation

## ◆ FlutterEngineTest()

flutter::testing::FlutterEngineTest::FlutterEngineTest | ( |  | ) |
| default

## Member Function Documentation

## ◆ AddNativeCallback()

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

Definition at line 43 of file FlutterEngineTestUtils.mm.

43 {
44 native_resolver_->AddNativeCallback({name}, function);
45 }

## ◆ GetFlutterEngine()

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

Definition at line 17 of file FlutterEngineTestUtils.h.

17 { return engine_; };

## ◆ IsolateCreateCallback()

void flutter::testing::FlutterEngineTest::IsolateCreateCallback | ( | void * | user_data | ) |
| static

Definition at line 39 of file FlutterEngineTestUtils.mm.

39 {
40 native_resolver_->SetNativeResolverForIsolate();
41 }

Referenced by SetUp().

## ◆ SetUp()

void flutter::testing::FlutterEngineTest::SetUp | ( |  | ) |
| override

Definition at line 16 of file FlutterEngineTestUtils.mm.

16 {
17 native_resolver_ = std::make_shared<TestDartNativeResolver>();
18 NSString* fixtures = @(testing::GetFixturesPath());
19 project_ = [[FlutterDartProject alloc]
20 initWithAssetsPath:fixtures
21 ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
22 project_.rootIsolateCreateCallback = FlutterEngineTest::IsolateCreateCallback;
23 engine_ = [[FlutterEngine alloc] initWithName:@"test"
24 project:project_
25 allowHeadlessExecution:true];
26 }

References IsolateCreateCallback().

## ◆ ShutDownEngine()

void flutter::testing::FlutterEngineTest::ShutDownEngine | ( |  | ) |

Definition at line 34 of file FlutterEngineTestUtils.mm.

34 {
35 [engine_ shutDownEngine];
36 engine_ = nil;
37 }

## ◆ TearDown()

void flutter::testing::FlutterEngineTest::TearDown | ( |  | ) |
| override

Definition at line 28 of file FlutterEngineTestUtils.mm.

28 {
29 [engine_ shutDownEngine];
30 engine_ = nil;
31 native_resolver_.reset();
32 }

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

- shell/platform/darwin/macos/framework/Source/FlutterEngineTestUtils.h
- shell/platform/darwin/macos/framework/Source/FlutterEngineTestUtils.mm

FlutterEngine
Definition: FlutterEngine.h:30
FlutterDartProject
Definition: FlutterDartProject.mm:24
flutter::testing::FlutterEngineTest::IsolateCreateCallback
static void IsolateCreateCallback(void *user_data)
Definition: FlutterEngineTestUtils.mm:39