11 #include "flutter/testing/testing.h"
25 size_t changeCount = (_result != nil) ? 1 : 0;
30 - (NSString*)stringForType:(NSPasteboardType)dataType {
34 - (BOOL)setString:(NSString*)
string forType:(NSPasteboardType)dataType {
43 FlutterEngineTest::FlutterEngineTest() =
default;
45 void FlutterEngineTest::SetUp() {
46 native_resolver_ = std::make_shared<TestDartNativeResolver>();
47 NSString* fixtures = @(testing::GetFixturesPath());
49 initWithAssetsPath:fixtures
50 ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
51 project_.rootIsolateCreateCallback = FlutterEngineTest::IsolateCreateCallback;
54 allowHeadlessExecution:true];
57 void FlutterEngineTest::TearDown() {
60 native_resolver_.reset();
63 void FlutterEngineTest::ShutDownEngine() {
68 void FlutterEngineTest::IsolateCreateCallback(
void*
user_data) {
69 native_resolver_->SetNativeResolverForIsolate();
72 void FlutterEngineTest::AddNativeCallback(
const char* name, Dart_NativeFunction
function) {
73 native_resolver_->AddNativeCallback({name},
function);
77 NSString* fixtures = @(testing::GetFixturesPath());
79 initWithAssetsPath:fixtures
80 ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
83 allowHeadlessExecution:true];
87 engine.pasteboard = pasteboardMock;
88 id engineMock = OCMPartialMock(engine);
92 MockFlutterEngineTest::MockFlutterEngineTest() =
default;
94 void MockFlutterEngineTest::SetUp() {
98 void MockFlutterEngineTest::TearDown() {
99 [engine_mock_ shutDownEngine];
100 [engine_mock_ stopMocking];
104 void MockFlutterEngineTest::ShutDownEngine() {
105 [engine_mock_ shutDownEngine];