[macOS] Remove extra setViewController and extra import (flutter/engine#52255)

This stub PR removes and extra `setViewController`, which is unnecessary because the view controller's initializer already attaches itself to the engine.

This PR also removes an extra import since `FlutterCompositor` is not used in the engine's definition. As a result, `FlutterEngineTest.mm` needs to import it explicitly.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Tong Mu
2024-04-24 17:26:12 -07:00
committed by GitHub
parent 3385d10982
commit 43fed272aa
3 changed files with 1 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterAppDelegate.h"
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterAppLifecycleDelegate.h"
#import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterPluginMacOS.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterEngineTestUtils.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewControllerTestUtils.h"
#include "flutter/shell/platform/embedder/embedder.h"

View File

@@ -14,7 +14,6 @@
#include "flutter/shell/platform/common/app_lifecycle_state.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMac.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.h"
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderer.h"

View File

@@ -212,7 +212,6 @@ TEST_F(FlutterViewControllerTest, ReparentsPluginWhenAccessibilityDisabled) {
nibName:nil
bundle:nil];
[viewController loadView];
[engine setViewController:viewController];
// Creates a NSWindow so that sub view can be first responder.
NSWindow* window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600)
styleMask:NSBorderlessWindowMask