Flutter macOS Embedder
FlutterWindowControllerTest.mm
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 
7 
13 #import "flutter/testing/testing.h"
14 #import "third_party/googletest/googletest/include/gtest/gtest.h"
15 
16 // CREATE_NATIVE_ENTRY is leaky.
17 // NOLINTBEGIN(clang-analyzer-core.StackAddressEscape)
18 
19 namespace flutter::testing {
20 
22  public:
24 
25  void SetUp() {
27 
28  [GetFlutterEngine() runWithEntrypoint:@"testWindowController"];
29 
30  signalled_ = false;
31 
32  AddFfiNativeCallback("SignalNativeTest", CREATE_FFI_LAMBDA([&]() {
34  signalled_ = true;
35  }));
36 
37  while (!signalled_) {
38  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
39  }
40  }
41 
42  void TearDown() {
43  [GetFlutterEngine().windowController closeAllWindows];
45  }
46 
47  protected:
49  if (isolate_) {
50  return *isolate_;
51  } else {
52  FML_LOG(ERROR) << "Isolate is not set.";
53  FML_UNREACHABLE();
54  }
55  }
56 
57  std::optional<flutter::Isolate> isolate_;
58  bool signalled_;
59 };
60 
61 class FlutterWindowControllerRetainTest : public ::testing::Test {};
62 
64 
65 TEST_F(FlutterWindowControllerTest, FixMoveRunLoopMode) {
66  FlutterEngine* engine = GetFlutterEngine();
67  [engine.windowController fixMoveRunLoopModeIfNeeded];
68 
69  // Make sure that after fixMoveRunLoopMode _NSMoveTimerRunLoopMode becomes
70  // common run loop mode.
71  __block BOOL signalled = NO;
72  CFRunLoopPerformBlock(CFRunLoopGetCurrent(), kCFRunLoopCommonModes, ^{
73  signalled = YES;
74  });
75  CFRunLoopRunInMode(CFSTR("_NSMoveTimerRunLoopMode"), 1.0, YES);
76  EXPECT_TRUE(signalled);
77 }
78 
79 TEST_F(FlutterWindowControllerTest, CreateRegularWindow) {
81  .has_size = true,
82  .size = {.width = 800, .height = 600},
83  .resizable = true,
84  .on_should_close = [] {},
85  .on_will_close = [] {},
86  .notify_listeners = [] {},
87  };
88 
89  FlutterEngine* engine = GetFlutterEngine();
90  int64_t engineId = reinterpret_cast<int64_t>(engine);
91 
92  {
93  IsolateScope isolate_scope(isolate());
94  int64_t handle = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
95  EXPECT_EQ(handle, 1);
96 
97  FlutterViewController* viewController = [engine viewControllerForIdentifier:handle];
98  EXPECT_NE(viewController, nil);
99  CGSize size = viewController.view.frame.size;
100  EXPECT_EQ(size.width, 800);
101  EXPECT_EQ(size.height, 600);
102  }
103 }
104 
105 TEST_F(FlutterWindowControllerTest, CreateTooltipWindow) {
106  IsolateScope isolate_scope(isolate());
107  FlutterEngine* engine = GetFlutterEngine();
108  int64_t engineId = reinterpret_cast<int64_t>(engine);
109 
110  auto request = FlutterWindowCreationRequest{
111  .has_size = true,
112  .size = {.width = 800, .height = 600},
113  .resizable = true,
114  .on_should_close = [] {},
115  .on_will_close = [] {},
116  .notify_listeners = [] {},
117  };
118  int64_t parentViewId = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
119  EXPECT_EQ(parentViewId, 1);
120 
121  auto position_callback = [](const FlutterWindowSize& child_size,
122  const FlutterWindowRect& parent_rect,
123  const FlutterWindowRect& output_rect) -> FlutterWindowRect* {
124  FlutterWindowRect* rect = static_cast<FlutterWindowRect*>(malloc(sizeof(FlutterWindowRect)));
125  rect->left = parent_rect.left + 10;
126  rect->top = parent_rect.top + 10;
127  rect->width = child_size.width;
128  rect->height = child_size.height;
129  return rect;
130  };
131 
133  .has_constraints = true,
134  .constraints{
135  .max_width = 1000,
136  .max_height = 1000,
137  },
138  .resizable = true,
139  .parent_view_id = parentViewId,
140  .on_should_close = [] {},
141  .on_will_close = [] {},
142  .notify_listeners = [] {},
143  .on_get_window_position = position_callback,
144  };
145 
146  const int64_t tooltipViewId =
148  EXPECT_NE(tooltipViewId, 0);
149 }
150 
151 TEST_F(FlutterWindowControllerTest, CreatePopupWindow) {
152  IsolateScope isolate_scope(isolate());
153  FlutterEngine* engine = GetFlutterEngine();
154  int64_t engineId = reinterpret_cast<int64_t>(engine);
155 
156  auto request = FlutterWindowCreationRequest{
157  .has_size = true,
158  .size = {.width = 800, .height = 600},
159  .resizable = true,
160  .on_should_close = [] {},
161  .on_will_close = [] {},
162  .notify_listeners = [] {},
163  };
164  int64_t parentViewId = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
165  EXPECT_EQ(parentViewId, 1);
166 
167  auto position_callback = [](const FlutterWindowSize& child_size,
168  const FlutterWindowRect& parent_rect,
169  const FlutterWindowRect& output_rect) -> FlutterWindowRect* {
170  FlutterWindowRect* rect = static_cast<FlutterWindowRect*>(malloc(sizeof(FlutterWindowRect)));
171  rect->left = parent_rect.left + 10;
172  rect->top = parent_rect.top + 10;
173  rect->width = child_size.width;
174  rect->height = child_size.height;
175  return rect;
176  };
177 
179  .has_constraints = true,
180  .constraints{
181  .max_width = 1000,
182  .max_height = 1000,
183  },
184  .resizable = true,
185  .parent_view_id = parentViewId,
186  .on_should_close = [] {},
187  .on_will_close = [] {},
188  .notify_listeners = [] {},
189  .on_get_window_position = position_callback,
190  };
191 
192  const int64_t tooltipViewId =
194  EXPECT_NE(tooltipViewId, 0);
195 }
196 
197 TEST_F(FlutterWindowControllerRetainTest, WindowControllerDoesNotRetainEngine) {
199  .has_size = true,
200  .size = {.width = 800, .height = 600},
201  .resizable = true,
202  .on_should_close = [] {},
203  .on_will_close = [] {},
204  .notify_listeners = [] {},
205  };
206 
207  __weak FlutterEngine* weakEngine = nil;
208  @autoreleasepool {
209  NSString* fixtures = @(flutter::testing::GetFixturesPath());
210  NSLog(@"Fixtures path: %@", fixtures);
211  FlutterDartProject* project = [[FlutterDartProject alloc]
212  initWithAssetsPath:fixtures
213  ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
214 
215  static std::optional<flutter::Isolate> isolate;
216  isolate = std::nullopt;
217 
218  project.rootIsolateCreateCallback = [](void*) { isolate = flutter::Isolate::Current(); };
219  FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test"
220  project:project
221  allowHeadlessExecution:YES];
222  weakEngine = engine;
223  [engine runWithEntrypoint:@"testWindowControllerRetainCycle"];
224 
225  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, false);
226 
227  int64_t engineId = reinterpret_cast<int64_t>(engine);
228 
229  {
230  FML_DCHECK(isolate.has_value());
231  // NOLINTNEXTLINE(bugprone-unchecked-optional-access)
232  IsolateScope isolateScope(*isolate);
233  int64_t handle = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
234  EXPECT_EQ(handle, 1);
235  }
236 
237  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, false);
238 
239  [engine.windowController closeAllWindows];
240  [engine shutDownEngine];
241  }
242  EXPECT_EQ(weakEngine, nil);
243 }
244 
245 TEST_F(FlutterWindowControllerTest, DestroyRegularWindow) {
247  .has_size = true,
248  .size = {.width = 800, .height = 600},
249  .resizable = true,
250  .on_should_close = [] {},
251  .on_will_close = [] {},
252  .notify_listeners = [] {},
253  };
254 
255  FlutterEngine* engine = GetFlutterEngine();
256  int64_t engine_id = reinterpret_cast<int64_t>(engine);
257 
258  IsolateScope isolate_scope(isolate());
259  int64_t handle = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
260  FlutterViewController* viewController = [engine viewControllerForIdentifier:handle];
261 
262  InternalFlutter_Window_Destroy(engine_id, (__bridge void*)viewController.view.window);
263  viewController = [engine viewControllerForIdentifier:handle];
264  EXPECT_EQ(viewController, nil);
265 }
266 
267 TEST_F(FlutterWindowControllerTest, InternalFlutterWindowGetHandle) {
269  .has_size = true,
270  .size = {.width = 800, .height = 600},
271  .resizable = true,
272  .on_should_close = [] {},
273  .on_will_close = [] {},
274  .notify_listeners = [] {},
275  };
276 
277  FlutterEngine* engine = GetFlutterEngine();
278  int64_t engine_id = reinterpret_cast<int64_t>(engine);
279 
280  IsolateScope isolate_scope(isolate());
281  int64_t handle = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
282  FlutterViewController* viewController = [engine viewControllerForIdentifier:handle];
283 
284  void* window_handle = InternalFlutter_Window_GetHandle(engine_id, handle);
285  EXPECT_EQ(window_handle, (__bridge void*)viewController.view.window);
286 }
287 
290  .has_size = true,
291  .size = {.width = 800, .height = 600},
292  .resizable = true,
293  .on_should_close = [] {},
294  .on_will_close = [] {},
295  .notify_listeners = [] {},
296  };
297 
298  FlutterEngine* engine = GetFlutterEngine();
299  int64_t engine_id = reinterpret_cast<int64_t>(engine);
300 
301  IsolateScope isolate_scope(isolate());
302  int64_t handle = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
303 
304  FlutterViewController* viewController = [engine viewControllerForIdentifier:handle];
305  NSWindow* window = viewController.view.window;
306  void* windowHandle = (__bridge void*)window;
307 
308  EXPECT_EQ(window.zoomed, NO);
309  EXPECT_EQ(window.miniaturized, NO);
310  EXPECT_EQ(window.styleMask & NSWindowStyleMaskFullScreen, 0u);
311 
312  InternalFlutter_Window_SetMaximized(windowHandle, true);
313  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5, false);
314  EXPECT_EQ(window.zoomed, YES);
315 
316  InternalFlutter_Window_SetMaximized(windowHandle, false);
317  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5, false);
318  EXPECT_EQ(window.zoomed, NO);
319 
320  // FullScreen toggle does not seem to work when the application is not run from a bundle.
321 
322  InternalFlutter_Window_Minimize(windowHandle);
323  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.5, false);
324  EXPECT_EQ(window.miniaturized, YES);
325 }
326 
327 TEST_F(FlutterWindowControllerTest, ClosesAllWindowsOnEngineRestart) {
329  .has_size = true,
330  .size = {.width = 800, .height = 600},
331  .resizable = true,
332  .on_should_close = [] {},
333  .on_will_close = [] {},
334  .notify_listeners = [] {},
335  };
336  FlutterEngine* engine = GetFlutterEngine();
337  int64_t engine_id = reinterpret_cast<int64_t>(engine);
338 
339  IsolateScope isolate_scope(isolate());
340 
341  // Create multiple windows
342  int64_t handle1 = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
343  int64_t handle2 = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
344  int64_t handle3 = InternalFlutter_WindowController_CreateRegularWindow(engine_id, &request);
345 
346  // Verify windows are created
347  FlutterViewController* viewController1 = [engine viewControllerForIdentifier:handle1];
348  FlutterViewController* viewController2 = [engine viewControllerForIdentifier:handle2];
349  FlutterViewController* viewController3 = [engine viewControllerForIdentifier:handle3];
350  EXPECT_NE(viewController1, nil);
351  EXPECT_NE(viewController2, nil);
352  EXPECT_NE(viewController3, nil);
353 
354  // Close all windows on engine restart
355  [engine engineCallbackOnPreEngineRestart];
356 
357  // Verify all windows are closed and view controllers are disposed
358  viewController1 = [engine viewControllerForIdentifier:handle1];
359  viewController2 = [engine viewControllerForIdentifier:handle2];
360  viewController3 = [engine viewControllerForIdentifier:handle3];
361  EXPECT_EQ(viewController1, nil);
362  EXPECT_EQ(viewController2, nil);
363  EXPECT_EQ(viewController3, nil);
364 };
365 
366 TEST_F(FlutterWindowControllerTest, ViewMetricsRespectPositionCallbackConstraints) {
367  IsolateScope isolate_scope(isolate());
368  FlutterEngine* engine = GetFlutterEngine();
369  int64_t engineId = reinterpret_cast<int64_t>(engine);
370 
371  // Create parent window.
372  auto parentRequest = FlutterWindowCreationRequest{
373  .has_size = true,
374  .size = {.width = 800, .height = 600},
375  .resizable = true,
376  .on_should_close = [] {},
377  .on_will_close = [] {},
378  .notify_listeners = [] {},
379  };
380  int64_t parentViewId =
382  EXPECT_EQ(parentViewId, 1);
383 
384  auto position_callback = [](const FlutterWindowSize& child_size,
385  const FlutterWindowRect& parent_rect,
386  const FlutterWindowRect& output_rect) -> FlutterWindowRect* {
387  FlutterWindowRect* rect = static_cast<FlutterWindowRect*>(malloc(sizeof(FlutterWindowRect)));
388  rect->left = parent_rect.left;
389  rect->top = parent_rect.top;
390  rect->width = 500;
391  rect->height = 400;
392  return rect;
393  };
394 
395  auto tooltipRequest = FlutterWindowCreationRequest{
396  .has_constraints = true,
397  .constraints{
398  .min_width = 0,
399  .min_height = 0,
400  .max_width = 1000,
401  .max_height = 1000,
402  },
403  .parent_view_id = parentViewId,
404  .on_should_close = [] {},
405  .on_will_close = [] {},
406  .notify_listeners = [] {},
407  .on_get_window_position = position_callback,
408  };
409 
410  const int64_t tooltipViewId =
411  InternalFlutter_WindowController_CreateTooltipWindow(engineId, &tooltipRequest);
412  EXPECT_NE(tooltipViewId, 0);
413 
414  FlutterViewController* viewController = [engine viewControllerForIdentifier:tooltipViewId];
415  FlutterView* flutterView = viewController.flutterView;
416 
417  EXPECT_EQ(flutterView.sizedToContents, YES);
418 
419  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, false);
420 
421  [flutterView.contentDelegate viewDidUpdateContents:flutterView withSize:NSMakeSize(1000, 1000)];
422 
423  // The constraints from request are 1000x1000, but additional constraints came from the positioner
424  // and must be respected.
425  CGSize maxSize = flutterView.maximumContentSize;
426  EXPECT_LE(maxSize.width, 500);
427  EXPECT_LE(maxSize.height, 400);
428 }
429 
430 TEST_F(FlutterWindowControllerTest, GetOffsetInParent) {
431  NSWindow* parentWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
432  styleMask:NSWindowStyleMaskTitled
433  backing:NSBackingStoreBuffered
434  defer:NO];
435  [parentWindow setReleasedWhenClosed:NO];
436  NSWindow* childWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100)
437  styleMask:NSWindowStyleMaskBorderless
438  backing:NSBackingStoreBuffered
439  defer:NO];
440  [childWindow setReleasedWhenClosed:NO];
441 
442  // Bottom left origin.
443  [parentWindow setFrame:NSMakeRect(100, 100, 800, 600) display:NO];
444  [childWindow setFrame:NSMakeRect(150, 150, 100, 100) display:NO];
445 
446  // Establish the parent-child relationship required by GetOffsetInParent.
447  [parentWindow addChildWindow:childWindow ordered:NSWindowAbove];
448 
449  FlutterWindowOffset offset =
450  InternalFlutter_Window_GetOffsetInParent((__bridge void*)childWindow);
451 
452  // GetOffsetInParent has relative coordinates with top left origin.
453  NSRect parentContentRect = [parentWindow contentRectForFrameRect:parentWindow.frame];
454 
455  double expectedX = 150 - parentContentRect.origin.x;
456  double expectedY = (parentContentRect.origin.y + parentContentRect.size.height) - (150 + 100);
457 
458  EXPECT_NEAR(offset.x, expectedX, 0.001);
459  EXPECT_NEAR(offset.y, expectedY, 0.001);
460 
461  [parentWindow removeChildWindow:childWindow];
462  [childWindow close];
463  [parentWindow close];
464 }
465 
466 const CFAbsoluteTime kTestTimeout = 30.0;
467 
468 TEST_F(FlutterWindowControllerSizeTest, SizedToContentResizable) {
470  .has_size = false,
471  .has_constraints = true,
472  .constraints{
473  .min_width = 0,
474  .min_height = 0,
475  .max_width = 1000,
476  .max_height = 1000,
477  },
478  .resizable = true,
479  .on_should_close = [] {},
480  .on_will_close = [] {},
481  .notify_listeners = [] {},
482  };
483 
484  std::optional<Isolate> isolate;
485 
486  bool signaled = false;
487  AddFfiNativeCallback("SignalNativeTest", CREATE_FFI_LAMBDA([&](Dart_NativeArguments args) {
488  signaled = true;
489  isolate = Isolate::Current();
490  }));
491 
492  auto engine = GetFlutterEngine();
493  [engine runWithEntrypoint:@"testRenderSizedToContentResizable"];
494 
495  auto engineId = reinterpret_cast<int64_t>(GetFlutterEngine());
496 
497  while (!signaled) {
498  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
499  }
500 
501  int64_t viewId = 0;
502  {
503  IsolateScope isolate_scope(*isolate);
504  viewId = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
505  }
506 
507  auto controller = [engine viewControllerForIdentifier:viewId];
508  auto window = controller.view.window;
509  CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
510  double pixelRatio = [window backingScaleFactor];
511  while (window.frame.size.width != 300 / pixelRatio &&
512  CFAbsoluteTimeGetCurrent() - startTime < kTestTimeout) {
513  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
514  }
515 
516  NSRect contentRect = [window contentRectForFrameRect:window.frame];
517  EXPECT_EQ(contentRect.size.width, 300 / pixelRatio);
518  EXPECT_EQ(contentRect.size.height, 300 / pixelRatio);
519  EXPECT_TRUE((window.styleMask & NSWindowStyleMaskResizable) != 0);
520 
521  [engine.windowController closeAllWindows];
522  [engine shutDownEngine];
523 }
524 
525 TEST_F(FlutterWindowControllerSizeTest, SizedToContentNotResizable) {
527  .has_size = false,
528  .has_constraints = true,
529  .constraints{
530  .min_width = 0,
531  .min_height = 0,
532  .max_width = 1000,
533  .max_height = 1000,
534  },
535  .resizable = false,
536  .on_should_close = [] {},
537  .on_will_close = [] {},
538  .notify_listeners = [] {},
539  };
540 
541  std::optional<Isolate> isolate;
542 
543  bool signaled = false;
544  AddFfiNativeCallback("SignalNativeTest", CREATE_FFI_LAMBDA([&](Dart_NativeArguments args) {
545  signaled = true;
546  isolate = Isolate::Current();
547  }));
548 
549  auto engine = GetFlutterEngine();
550  [engine runWithEntrypoint:@"testRenderSizedToContent"];
551 
552  auto engineId = reinterpret_cast<int64_t>(GetFlutterEngine());
553 
554  while (!signaled) {
555  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
556  }
557 
558  int64_t viewId = 0;
559  {
560  IsolateScope isolate_scope(*isolate);
561  viewId = InternalFlutter_WindowController_CreateRegularWindow(engineId, &request);
562  }
563 
564  auto controller = [engine viewControllerForIdentifier:viewId];
565  auto window = controller.view.window;
566 
567  CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
568  double pixelRatio = [window backingScaleFactor];
569  while (window.frame.size.width != 300 / pixelRatio &&
570  CFAbsoluteTimeGetCurrent() - startTime < kTestTimeout) {
571  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
572  }
573 
574  NSRect contentRect = [window contentRectForFrameRect:window.frame];
575  EXPECT_EQ(contentRect.size.width, 300 / pixelRatio);
576  EXPECT_EQ(contentRect.size.height, 300 / pixelRatio);
577  EXPECT_TRUE((window.styleMask & NSWindowStyleMaskResizable) == 0);
578 
579  // Wait until the second frame is rendered, which should resize the window based
580  // on new content.
581  startTime = CFAbsoluteTimeGetCurrent();
582  while (window.frame.size.width == 300 / pixelRatio &&
583  CFAbsoluteTimeGetCurrent() - startTime < kTestTimeout) {
584  CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.1, true);
585  }
586 
587  contentRect = [window contentRectForFrameRect:window.frame];
588  EXPECT_EQ(contentRect.size.width, 200 / pixelRatio);
589  EXPECT_EQ(contentRect.size.height, 200 / pixelRatio);
590 
591  [engine.windowController closeAllWindows];
592  [engine shutDownEngine];
593 }
594 
595 } // namespace flutter::testing
596 
597 // NOLINTEND(clang-analyzer-core.StackAddressEscape)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateRegularWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT FlutterWindowOffset InternalFlutter_Window_GetOffsetInParent(void *window)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreateTooltipWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_SetMaximized(void *window, bool maximized)
FLUTTER_DARWIN_EXPORT int64_t InternalFlutter_WindowController_CreatePopupWindow(int64_t engine_id, const FlutterWindowCreationRequest *request)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Destroy(int64_t engine_id, void *window)
FLUTTER_DARWIN_EXPORT void * InternalFlutter_Window_GetHandle(int64_t engine_id, FlutterViewIdentifier view_id)
FLUTTER_DARWIN_EXPORT void InternalFlutter_Window_Minimize(void *window)
static Isolate Current()
Definition: isolate_scope.cc:9
void AddFfiNativeCallback(const char *name, void *function)
CGSize maximumContentSize
Definition: FlutterView.h:142
BOOL sizedToContents
Definition: FlutterView.h:130
id< FlutterViewContentDelegate > contentDelegate
Definition: FlutterView.h:98
TEST_F(AccessibilityBridgeMacWindowTest, SendsAccessibilityCreateNotificationFlutterViewWindow)
const CFAbsoluteTime kTestTimeout