Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[macOS] Eliminate extraneous loadView calls
Eliminate unnecessary calls to [NSViewController loadView]. To quote the
[documentation][loadview] for this method: "Do not call this method. If
you require this method to be called, access the view property."

In several of the existing tests, we do read viewController.view, and
the other tests pass without this line regardless.

[loadView]: https://developer.apple.com/documentation/appkit/nsviewcontroller/1434405-loadview?language=objc#
  • Loading branch information
cbracken committed Oct 20, 2023
commit 3d313b8a49f8fa7d8013052d1634a2433524bc65
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ @implementation AccessibilityBridgeTestViewController
TEST(AccessibilityBridgeMacTest, SendsAccessibilityCreateNotificationToWindowOfFlutterView) {
FlutterViewController* viewController = CreateTestViewController();
FlutterEngine* engine = viewController.engine;
[viewController loadView];

NSWindow* expectedTarget = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
styleMask:NSBorderlessWindowMask
Expand Down Expand Up @@ -122,7 +121,6 @@ @implementation AccessibilityBridgeTestViewController
TEST(AccessibilityBridgeMacTest, NonZeroRootNodeId) {
FlutterViewController* viewController = CreateTestViewController();
FlutterEngine* engine = viewController.engine;
[viewController loadView];

NSWindow* expectedTarget = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
styleMask:NSBorderlessWindowMask
Expand Down Expand Up @@ -192,7 +190,7 @@ @implementation AccessibilityBridgeTestViewController
TEST(AccessibilityBridgeMacTest, DoesNotSendAccessibilityCreateNotificationWhenHeadless) {
FlutterViewController* viewController = CreateTestViewController();
FlutterEngine* engine = viewController.engine;
[viewController loadView];

// Setting up bridge so that the AccessibilityBridgeMacDelegateSpy
// can query semantics information from.
engine.semanticsEnabled = YES;
Expand Down Expand Up @@ -238,7 +236,6 @@ @implementation AccessibilityBridgeTestViewController
TEST(AccessibilityBridgeMacTest, DoesNotSendAccessibilityCreateNotificationWhenNoWindow) {
FlutterViewController* viewController = CreateTestViewController();
FlutterEngine* engine = viewController.engine;
[viewController loadView];

// Setting up bridge so that the AccessibilityBridgeMacDelegateSpy
// can query semantics information from.
Expand Down