| Flutter macOS Embedder |

FlutterEngineTestUtils.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterEngine.h"
6
7 #import <OCMock/OCMock.h>
8 #include "flutter/testing/test_dart_native_resolver.h"
9 #include "gtest/gtest.h"
10
11 namespace flutter::testing {
12
13 class FlutterEngineTest : public ::testing::Test {
14 public:
15 FlutterEngineTest();
16
17 FlutterEngine* GetFlutterEngine() { return engine_; };
18
19 void SetUp() override;
20 void TearDown() override;
21
22 void AddNativeCallback(const char* name, Dart_NativeFunction function);
23
24 static void IsolateCreateCallback(void* user_data);
25
26 void ShutDownEngine();
27
28 private:
29 inline static std::shared_ptr<TestDartNativeResolver> native_resolver_;
30
31 FlutterDartProject* project_;
32 FlutterEngine* engine_;
33
34 FML_DISALLOW_COPY_AND_ASSIGN(FlutterEngineTest);
35 };
36
37 // Returns a mock FlutterEngine that is able to work in environments
38 // without a real pasteboard.
39 id CreateMockFlutterEngine(NSString* pasteboardString);
40
41 } // namespace flutter::testing
flutter::testing::FlutterEngineTest::FlutterEngineTest
FlutterEngineTest()
FlutterEngine
Definition: FlutterEngine.h:30
flutter::testing::FlutterEngineTest::ShutDownEngine
void ShutDownEngine()
Definition: FlutterEngineTestUtils.mm:34
FlutterEngine.h
flutter::testing::CreateMockFlutterEngine
id CreateMockFlutterEngine(NSString *pasteboardString)
Definition: FlutterEngineTestUtils.mm:47
flutter::testing::FlutterEngineTest::TearDown
void TearDown() override
Definition: FlutterEngineTestUtils.mm:28
user_data
void * user_data
Definition: texture_registrar_unittests.cc:27
flutter::testing
Definition: AccessibilityBridgeMacTest.mm:11
flutter::testing::FlutterEngineTest
Definition: FlutterEngineTestUtils.h:13
flutter::testing::FlutterEngineTest::SetUp
void SetUp() override
Definition: FlutterEngineTestUtils.mm:16
flutter::testing::FlutterEngineTest::AddNativeCallback
void AddNativeCallback(const char *name, Dart_NativeFunction function)
Definition: FlutterEngineTestUtils.mm:43
FlutterDartProject
Definition: FlutterDartProject.mm:24
flutter::testing::FlutterEngineTest::GetFlutterEngine
FlutterEngine * GetFlutterEngine()
Definition: FlutterEngineTestUtils.h:17
flutter::testing::FlutterEngineTest::IsolateCreateCallback
static void IsolateCreateCallback(void *user_data)
Definition: FlutterEngineTestUtils.mm:39