| Flutter macOS Embedder |

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
flutter::testing::FlutterWindowControllerTest Class Reference
Inheritance diagram for flutter::testing::FlutterWindowControllerTest:

## Public Member Functions
| FlutterWindowControllerTest ()=default
void | SetUp ()
void | TearDown ()
Public Member Functions inherited from flutter::testing::FlutterEngineTest
| FlutterEngineTest ()
FlutterEngine * | GetFlutterEngine ()
void | SetUp () override
void | TearDown () override
void | AddNativeCallback (const char *name, Dart_NativeFunction function)
void | ShutDownEngine ()

## Protected Member Functions
flutter::Isolate & | isolate ()

## Protected Attributes
std::optional< flutter::Isolate > | isolate_
bool | signalled_

## Additional Inherited Members
Static Public Member Functions inherited from flutter::testing::FlutterEngineTest
static void | IsolateCreateCallback (void *user_data)

## Detailed Description

Definition at line 18 of file FlutterWindowControllerTest.mm.

## Constructor & Destructor Documentation

## ◆ FlutterWindowControllerTest()

flutter::testing::FlutterWindowControllerTest::FlutterWindowControllerTest | ( |  | ) |
| default

## Member Function Documentation

## ◆ isolate()

flutter::Isolate& flutter::testing::FlutterWindowControllerTest::isolate | ( |  | ) |
| inline protected

Definition at line 45 of file FlutterWindowControllerTest.mm.

45 {
46 if (isolate_) {
47 return *isolate_;
48 } else {
49 FML_LOG(ERROR) << "Isolate is not set.";
50 FML_UNREACHABLE();
51 }
52 }
flutter::testing::FlutterWindowControllerTest::isolate_
std::optional< flutter::Isolate > isolate_
Definition: FlutterWindowControllerTest.mm:54

References isolate_.

## ◆ SetUp()

void flutter::testing::FlutterWindowControllerTest::SetUp | ( |  | ) |
| inline

Definition at line 22 of file FlutterWindowControllerTest.mm.

22 {
23 FlutterEngineTest::SetUp();
24
25 [GetFlutterEngine() runWithEntrypoint:@"testWindowController"];
26
27 signalled_ = false;
28
29 AddNativeCallback("SignalNativeTest", CREATE_NATIVE_ENTRY([&](Dart_NativeArguments args) {
30 isolate_ = Isolate::Current();
31 signalled_ = true;
32 }));
33
34 while (!signalled_) {
35 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
36 }
37 }
flutter::Isolate::Current
static Isolate Current()
Definition: isolate_scope.cc:9
flutter::testing::FlutterEngineTest::AddNativeCallback
void AddNativeCallback(const char *name, Dart_NativeFunction function)
Definition: FlutterEngineTestUtils.mm:72
flutter::testing::FlutterEngineTest::SetUp
void SetUp() override
Definition: FlutterEngineTestUtils.mm:45
flutter::testing::FlutterEngineTest::GetFlutterEngine
FlutterEngine * GetFlutterEngine()
Definition: FlutterEngineTestUtils.h:22
flutter::testing::FlutterWindowControllerTest::signalled_
bool signalled_
Definition: FlutterWindowControllerTest.mm:55

References flutter::testing::FlutterEngineTest::AddNativeCallback(), flutter::Isolate::Current(), flutter::testing::FlutterEngineTest::GetFlutterEngine(), isolate_, flutter::testing::FlutterEngineTest::SetUp(), and signalled_.

## ◆ TearDown()

void flutter::testing::FlutterWindowControllerTest::TearDown | ( |  | ) |
| inline

Definition at line 39 of file FlutterWindowControllerTest.mm.

39 {
40 [GetFlutterEngine().windowController closeAllWindows];
41 FlutterEngineTest::TearDown();
42 }
flutter::testing::FlutterEngineTest::TearDown
void TearDown() override
Definition: FlutterEngineTestUtils.mm:57

References flutter::testing::FlutterEngineTest::GetFlutterEngine(), and flutter::testing::FlutterEngineTest::TearDown().

## Member Data Documentation

## ◆ isolate_

std::optional<flutter::Isolate> flutter::testing::FlutterWindowControllerTest::isolate_
| protected

Definition at line 54 of file FlutterWindowControllerTest.mm.

Referenced by isolate(), and SetUp().

## ◆ signalled_

bool flutter::testing::FlutterWindowControllerTest::signalled_
| protected

Definition at line 55 of file FlutterWindowControllerTest.mm.

Referenced by SetUp().

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

- shell/platform/darwin/macos/framework/Source/FlutterWindowControllerTest.mm