This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
shell/platform/darwin/ios/framework/Source Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2104,6 +2104,15 @@ - (int32_t)accessibilityFlags {
21042104 return flags;
21052105}
21062106
2107+ - (BOOL )accessibilityPerformEscape {
2108+ FlutterMethodChannel* navigationChannel = [_engine.get () navigationChannel ];
2109+ if (navigationChannel != nil ) {
2110+ [self popRoute ];
2111+ return YES ;
2112+ }
2113+ return NO ;
2114+ }
2115+
21072116+ (BOOL )accessibilityIsOnOffSwitchLabelsEnabled {
21082117 if (@available (iOS 13 , *)) {
21092118 return UIAccessibilityIsOnOffSwitchLabelsEnabled ();
Original file line number Diff line number Diff line change @@ -1365,6 +1365,20 @@ - (void)testItReportsAccessibilityOnOffSwitchLabelsFlagSet {
13651365 XCTAssert ((flags & (int32_t )flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels ) != 0 );
13661366}
13671367
1368+ - (void )testAccessibilityPerformEscapePopsRoute {
1369+ FlutterEnginePartialMock* mockEngine = [[FlutterEnginePartialMock alloc ] init ];
1370+ id mockNavigationChannel = OCMClassMock ([FlutterBasicMessageChannel class ]);
1371+ mockEngine.navigationChannel = mockNavigationChannel;
1372+
1373+ FlutterViewController* viewController =
1374+ [[FlutterViewController alloc ] initWithEngine: self .mockEngine nibName: nil bundle: nil ];
1375+ [viewController accessibilityPerformEscape ];
1376+
1377+ OCMVerify ([mockNavigationChannel invokeMethod: @" popRoute" arguments: nil ]);
1378+
1379+ [settingsChannel mockNavigationChannel ];
1380+ }
1381+
13681382- (void )testPerformOrientationUpdateForcesOrientationChange {
13691383 [self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortrait
13701384 currentOrientation: UIInterfaceOrientationLandscapeLeft
You can’t perform that action at this time.
0 commit comments