Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp committed Jun 11, 2022
1 parent 60c55cb commit 96859b3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ + (void)respondFalseForSendEvent:(const FlutterKeyEvent&)event
EXPECT_EQ(accessibilityChildren[0], viewControllerMock.flutterView);
}

TEST(FlutterViewController, SetsFlutterViewFirstResponderWhenAccessibilityDisabled) {
TEST(FlutterViewController, ReparentsPluginWhenAccessibilityDisabled) {
FlutterEngine* engine = CreateTestEngine();
NSString* fixtures = @(testing::GetFixturesPath());
FlutterDartProject* project = [[FlutterDartProject alloc]
Expand All @@ -86,14 +86,17 @@ + (void)respondFalseForSendEvent:(const FlutterKeyEvent&)event
backing:NSBackingStoreBuffered
defer:NO];
window.contentView = viewController.view;
NSView* dummyView = [[NSView alloc] initWithFrame:CGRectZero];
[viewController.view addSubview:dummyView];
// Attaches FlutterTextInputPlugin to the view;
[viewController.view addSubview:viewController.textInputPlugin];
[dummyView addSubview:viewController.textInputPlugin];
// Makes sure the textInputPlugin can be the first responder.
EXPECT_TRUE([window makeFirstResponder:viewController.textInputPlugin]);
EXPECT_EQ([window firstResponder], viewController.textInputPlugin);
EXPECT_FALSE(viewController.textInputPlugin.superview == viewController.view);
[viewController onAccessibilityStatusChanged:NO];
// FlutterView becomes the first responder.
EXPECT_EQ([window firstResponder], viewController.flutterView);
// FlutterView becomes child of view controller
EXPECT_TRUE(viewController.textInputPlugin.superview == viewController.view);
}

TEST(FlutterViewController, CanSetMouseTrackingModeBeforeViewLoaded) {
Expand Down

0 comments on commit 96859b3

Please sign in to comment.