Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b54eae3

Browse files
cbrackenharryterkelsen
authored andcommitted
[macOS] Eliminate extraneous loadView calls (#47166)
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. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 8070e52 commit b54eae3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMacTest.mm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ @implementation AccessibilityBridgeTestViewController
6161
TEST(AccessibilityBridgeMacTest, SendsAccessibilityCreateNotificationToWindowOfFlutterView) {
6262
FlutterViewController* viewController = CreateTestViewController();
6363
FlutterEngine* engine = viewController.engine;
64-
[viewController loadView];
6564

6665
NSWindow* expectedTarget = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
6766
styleMask:NSBorderlessWindowMask
@@ -122,7 +121,6 @@ @implementation AccessibilityBridgeTestViewController
122121
TEST(AccessibilityBridgeMacTest, NonZeroRootNodeId) {
123122
FlutterViewController* viewController = CreateTestViewController();
124123
FlutterEngine* engine = viewController.engine;
125-
[viewController loadView];
126124

127125
NSWindow* expectedTarget = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
128126
styleMask:NSBorderlessWindowMask
@@ -192,7 +190,7 @@ @implementation AccessibilityBridgeTestViewController
192190
TEST(AccessibilityBridgeMacTest, DoesNotSendAccessibilityCreateNotificationWhenHeadless) {
193191
FlutterViewController* viewController = CreateTestViewController();
194192
FlutterEngine* engine = viewController.engine;
195-
[viewController loadView];
193+
196194
// Setting up bridge so that the AccessibilityBridgeMacDelegateSpy
197195
// can query semantics information from.
198196
engine.semanticsEnabled = YES;
@@ -238,7 +236,6 @@ @implementation AccessibilityBridgeTestViewController
238236
TEST(AccessibilityBridgeMacTest, DoesNotSendAccessibilityCreateNotificationWhenNoWindow) {
239237
FlutterViewController* viewController = CreateTestViewController();
240238
FlutterEngine* engine = viewController.engine;
241-
[viewController loadView];
242239

243240
// Setting up bridge so that the AccessibilityBridgeMacDelegateSpy
244241
// can query semantics information from.

0 commit comments

Comments
 (0)