13#import "third_party/googletest/googletest/include/gtest/gtest.h"
26 bool signalled =
false;
34 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1,
false);
48 FML_LOG(ERROR) <<
"Isolate is not set.";
61 .size = {.width = 800, .height = 600},
62 .on_should_close = [] {},
63 .on_will_close = [] {},
64 .notify_listeners = [] {},
68 int64_t engineId =
reinterpret_cast<int64_t
>(
engine);
78 EXPECT_EQ(
size.width, 800);
79 EXPECT_EQ(
size.height, 600);
86 .size = {.width = 800, .height = 600},
87 .on_should_close = [] {},
88 .on_will_close = [] {},
89 .notify_listeners = [] {},
95 NSLog(
@"Fixtures path: %@", fixtures);
97 initWithAssetsPath:fixtures
98 ICUDataPath:[fixtures stringByAppendingString:
@"/icudtl.dat"]];
100 static std::optional<flutter::Isolate> isolate;
101 isolate = std::nullopt;
106 allowHeadlessExecution:YES];
108 [
engine runWithEntrypoint:
@"testWindowControllerRetainCycle"];
110 int64_t engineId =
reinterpret_cast<int64_t
>(
engine);
117 EXPECT_EQ(handle, 1);
120 [
engine.windowController closeAllWindows];
123 EXPECT_EQ(weakEngine, nil);
129 .size = {.width = 800, .height = 600},
130 .on_should_close = [] {},
131 .on_will_close = [] {},
132 .notify_listeners = [] {},
136 int64_t engine_id =
reinterpret_cast<int64_t
>(
engine);
150 .size = {.width = 800, .height = 600},
151 .on_should_close = [] {},
152 .on_will_close = [] {},
153 .notify_listeners = [] {},
157 int64_t engine_id =
reinterpret_cast<int64_t
>(
engine);
164 EXPECT_EQ(window_handle, (__bridge
void*)
viewController.view.window);
170 .size = {.width = 800, .height = 600},
171 .on_should_close = [] {},
172 .on_will_close = [] {},
173 .notify_listeners = [] {},
177 int64_t engine_id =
reinterpret_cast<int64_t
>(
engine);
184 void* windowHandle = (__bridge
void*)
window;
186 EXPECT_EQ(
window.zoomed, NO);
187 EXPECT_EQ(
window.miniaturized, NO);
188 EXPECT_EQ(
window.styleMask & NSWindowStyleMaskFullScreen, 0u);
191 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5,
false);
192 EXPECT_EQ(
window.zoomed, YES);
195 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5,
false);
196 EXPECT_EQ(
window.zoomed, NO);
201 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5,
false);
202 EXPECT_EQ(
window.miniaturized, YES);
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateRegularWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
FlutterEngine * GetFlutterEngine()
void AddNativeCallback(const char *name, Dart_NativeFunction function)
std::optional< flutter::Isolate > isolate_
FlutterWindowControllerTest()=default
flutter::Isolate & isolate()
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_LOG(severity)
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
void(* rootIsolateCreateCallback)(void *_Nullable)
FlutterViewController * viewController
TEST_F(DisplayListTest, Defaults)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#define CREATE_NATIVE_ENTRY(native_entry)