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 {
2104
2104
return flags;
2105
2105
}
2106
2106
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
+
2107
2116
+ (BOOL )accessibilityIsOnOffSwitchLabelsEnabled {
2108
2117
if (@available (iOS 13 , *)) {
2109
2118
return UIAccessibilityIsOnOffSwitchLabelsEnabled ();
Original file line number Diff line number Diff line change @@ -1365,6 +1365,20 @@ - (void)testItReportsAccessibilityOnOffSwitchLabelsFlagSet {
1365
1365
XCTAssert ((flags & (int32_t )flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels ) != 0 );
1366
1366
}
1367
1367
1368
+ - (void )testAccessibilityPerformEscapePopsRoute {
1369
+ FlutterEnginePartialMock* mockEngine = [[FlutterEnginePartialMock alloc ] init ];
1370
+ id mockNavigationChannel = OCMClassMock ([FlutterBasicMessageChannel class ]);
1371
+ OCMStub ([mockEngine navigationChannel ]).andReturn (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
+ [mockNavigationChannel stopMocking ];
1380
+ }
1381
+
1368
1382
- (void )testPerformOrientationUpdateForcesOrientationChange {
1369
1383
[self orientationTestWithOrientationUpdate: UIInterfaceOrientationMaskPortrait
1370
1384
currentOrientation: UIInterfaceOrientationLandscapeLeft
You can’t perform that action at this time.
0 commit comments