Delete scenario test TextSemanticsFocusTest (flutter/engine#29370)
This commit is contained in:
@@ -30,7 +30,7 @@ Build the `ios_debug_sim_unopt` engine variant, and run
|
||||
in your shell.
|
||||
|
||||
To run or debug in Xcode, open the xcodeproj file located in
|
||||
`<engine_out_dir>/scenario_app/Scenarios/Scenaios.xoceproj`.
|
||||
`<engine_out_dir>/ios_debug_sim_unopt/scenario_app/Scenarios/Scenaios.xcodeproj`.
|
||||
|
||||
### iOS Platform View Tests
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0A02E8F724EFAD27002D54E5 /* BogusFontTextTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A02E8F624EFAD27002D54E5 /* BogusFontTextTest.m */; };
|
||||
0A42BFB42447E179007E212E /* TextSemanticsFocusTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A42BFB32447E179007E212E /* TextSemanticsFocusTest.m */; };
|
||||
0A57B3BD2323C4BD00DD9521 /* ScreenBeforeFlutter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A57B3BC2323C4BD00DD9521 /* ScreenBeforeFlutter.m */; };
|
||||
0A57B3BF2323C74200DD9521 /* FlutterEngine+ScenariosTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A57B3BE2323C74200DD9521 /* FlutterEngine+ScenariosTest.m */; };
|
||||
0A57B3C22323D2D700DD9521 /* AppLifecycleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A57B3C12323D2D700DD9521 /* AppLifecycleTests.m */; };
|
||||
@@ -113,8 +112,6 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0A02E8F624EFAD27002D54E5 /* BogusFontTextTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BogusFontTextTest.m; sourceTree = "<group>"; };
|
||||
0A42BFB32447E179007E212E /* TextSemanticsFocusTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TextSemanticsFocusTest.m; sourceTree = "<group>"; };
|
||||
0A42BFB52447E19F007E212E /* TextSemanticsFocusTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextSemanticsFocusTest.h; sourceTree = "<group>"; };
|
||||
0A57B3BB2323C4BD00DD9521 /* ScreenBeforeFlutter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScreenBeforeFlutter.h; sourceTree = "<group>"; };
|
||||
0A57B3BC2323C4BD00DD9521 /* ScreenBeforeFlutter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScreenBeforeFlutter.m; sourceTree = "<group>"; };
|
||||
0A57B3BE2323C74200DD9521 /* FlutterEngine+ScenariosTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "FlutterEngine+ScenariosTest.m"; sourceTree = "<group>"; };
|
||||
@@ -272,8 +269,6 @@
|
||||
68A5B63323EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m */,
|
||||
0D8470A2240F0B1F0030B565 /* StatusBarTest.h */,
|
||||
0D8470A3240F0B1F0030B565 /* StatusBarTest.m */,
|
||||
0A42BFB32447E179007E212E /* TextSemanticsFocusTest.m */,
|
||||
0A42BFB52447E19F007E212E /* TextSemanticsFocusTest.h */,
|
||||
246A6610252E693A00EAB0F3 /* RenderingSelectionTest.m */,
|
||||
0DDEBC88258830B40065D0E8 /* SpawnEngineTest.m */,
|
||||
F26F15B7268B6B5500EC54D3 /* iPadGestureTests.m */,
|
||||
@@ -494,7 +489,6 @@
|
||||
F26F15B8268B6B5600EC54D3 /* iPadGestureTests.m in Sources */,
|
||||
246A6611252E693A00EAB0F3 /* RenderingSelectionTest.m in Sources */,
|
||||
4F06F1B32473296E000AF246 /* LocalizationInitializationTest.m in Sources */,
|
||||
0A42BFB42447E179007E212E /* TextSemanticsFocusTest.m in Sources */,
|
||||
0DDEBC89258830B40065D0E8 /* SpawnEngineTest.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -82,10 +82,6 @@
|
||||
argument = "--bogus-font-text"
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--text-semantics-focus"
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--platform-view"
|
||||
isEnabled = "NO">
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
@"--gesture-reject-eager" : @"platform_view_gesture_reject_eager",
|
||||
@"--gesture-accept" : @"platform_view_gesture_accept",
|
||||
@"--tap-status-bar" : @"tap_status_bar",
|
||||
@"--text-semantics-focus" : @"text_semantics_focus",
|
||||
@"--animated-color-square" : @"animated_color_square",
|
||||
@"--platform-view-with-continuous-texture" : @"platform_view_with_continuous_texture",
|
||||
@"--bogus-font-text" : @"bogus_font_text",
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright 2020 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#import <Flutter/Flutter.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TextSemanticsFocusTest : XCTestCase
|
||||
@property(nonatomic, strong) XCUIApplication* application;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,87 +0,0 @@
|
||||
// Copyright 2020 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#import "TextSemanticsFocusTest.h"
|
||||
|
||||
FLUTTER_ASSERT_ARC
|
||||
|
||||
@interface XCUIElement (ftr_waitForNonExistence)
|
||||
/// Keeps waiting until the element doesn't exist. Returns NO if the timeout is
|
||||
/// reached before it doesn't exist.
|
||||
- (BOOL)ftr_waitForNonExistenceWithTimeout:(NSTimeInterval)timeout;
|
||||
/// Waits the full duration to ensure something doesn't exist for that duration.
|
||||
/// Returns NO if at some point the element exists during the duration.
|
||||
- (BOOL)ftr_waitForNonExistenceForDuration:(NSTimeInterval)duration;
|
||||
@end
|
||||
|
||||
@implementation XCUIElement (ftr_waitForNonExistence)
|
||||
- (BOOL)ftr_waitForNonExistenceWithTimeout:(NSTimeInterval)timeout {
|
||||
NSTimeInterval delta = 0.5;
|
||||
while (timeout > 0.0) {
|
||||
if (!self.exists) {
|
||||
return YES;
|
||||
}
|
||||
usleep(delta * 1000000);
|
||||
timeout -= delta;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)ftr_waitForNonExistenceForDuration:(NSTimeInterval)duration {
|
||||
return ![self waitForExistenceWithTimeout:duration];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation TextSemanticsFocusTest
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
self.continueAfterFailure = NO;
|
||||
|
||||
self.application = [[XCUIApplication alloc] init];
|
||||
self.application.launchArguments = @[ @"--text-semantics-focus" ];
|
||||
[self.application launch];
|
||||
}
|
||||
|
||||
- (void)skip_testAccessibilityFocusOnTextSemanticsProducesCorrectIosViews {
|
||||
NSTimeInterval timeout = 10.0;
|
||||
// Find the initial TextInputSemanticsObject which was sent from the mock framework on first
|
||||
// frame.
|
||||
XCUIElement* textInputSemanticsObject =
|
||||
[[[self.application textFields] matchingIdentifier:@"flutter textfield"] element];
|
||||
XCTAssertTrue([textInputSemanticsObject waitForExistenceWithTimeout:timeout]);
|
||||
XCTAssertEqualObjects([textInputSemanticsObject valueForKey:@"hasKeyboardFocus"], @(NO));
|
||||
|
||||
// Since the first mock framework text field isn't focused on, it shouldn't produce a UITextInput
|
||||
// in the view hierarchy.
|
||||
XCUIElement* delegateTextInput = [[self.application textViews] element];
|
||||
XCTAssertTrue([delegateTextInput ftr_waitForNonExistenceWithTimeout:timeout]);
|
||||
|
||||
// Nor should there be a keyboard for text entry.
|
||||
XCUIElement* keyboard = [[self.application keyboards] element];
|
||||
XCTAssertTrue([keyboard ftr_waitForNonExistenceWithTimeout:timeout]);
|
||||
|
||||
// The tap location doesn't matter. The mock framework just sends a focused text field on tap.
|
||||
[textInputSemanticsObject tap];
|
||||
|
||||
// The new TextInputSemanticsObject now has keyboard focus (the only trait accessible through
|
||||
// UI tests on a XCUIElement).
|
||||
textInputSemanticsObject =
|
||||
[[[self.application textFields] matchingIdentifier:@"focused flutter textfield"] element];
|
||||
XCTAssertTrue([textInputSemanticsObject waitForExistenceWithTimeout:timeout]);
|
||||
XCTAssertEqualObjects([textInputSemanticsObject valueForKey:@"hasKeyboardFocus"], @(YES));
|
||||
|
||||
// The delegate UITextInput is also inserted on the window but we make only the
|
||||
// TextInputSemanticsObject visible and not the FlutterTextInputView to avoid confusing
|
||||
// accessibility, it shouldn't be visible to the UI test either.
|
||||
delegateTextInput = [[self.application textViews] element];
|
||||
XCTAssertTrue([delegateTextInput ftr_waitForNonExistenceForDuration:3.0]);
|
||||
|
||||
// But since there is focus, the soft keyboard is visible on the simulator.
|
||||
keyboard = [[self.application keyboards] element];
|
||||
XCTAssertTrue([keyboard waitForExistenceWithTimeout:timeout]);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,7 +11,6 @@ import 'locale_initialization.dart';
|
||||
import 'platform_view.dart';
|
||||
import 'poppable_screen.dart';
|
||||
import 'scenario.dart';
|
||||
import 'send_text_focus_semantics.dart';
|
||||
import 'touches_scenario.dart';
|
||||
|
||||
typedef ScenarioFactory = Scenario Function(); // ignore: public_member_api_docs
|
||||
@@ -45,7 +44,6 @@ Map<String, ScenarioFactory> _scenarios = <String, ScenarioFactory>{
|
||||
'platform_view_gesture_reject_after_touches_ended': () => PlatformViewForTouchIOSScenario(PlatformDispatcher.instance, 'platform view touch', id: _viewId++, accept: false, rejectUntilTouchesEnded: true),
|
||||
'platform_view_scrolling_under_widget':()=>PlatformViewScrollingUnderWidget(PlatformDispatcher.instance, firstPlatformViewId: _viewId++, lastPlatformViewId: _viewId+=16),
|
||||
'tap_status_bar': () => TouchesScenario(PlatformDispatcher.instance),
|
||||
'text_semantics_focus': () => SendTextFocusSemantics(PlatformDispatcher.instance),
|
||||
'initial_route_reply': () => InitialRouteReply(PlatformDispatcher.instance),
|
||||
'platform_view_with_continuous_texture': () => PlatformViewWithContinuousTexture(PlatformDispatcher.instance, 'Platform View', id: _viewId++),
|
||||
'bogus_font_text': () => BogusFontText(PlatformDispatcher.instance),
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import 'channel_util.dart';
|
||||
import 'scenario.dart';
|
||||
|
||||
/// A scenario that sends back messages when touches are received.
|
||||
class SendTextFocusSemantics extends Scenario {
|
||||
/// Constructor for `SendTextFocusScemantics`.
|
||||
SendTextFocusSemantics(PlatformDispatcher dispatcher) : super(dispatcher);
|
||||
|
||||
@override
|
||||
void onBeginFrame(Duration duration) {
|
||||
// Doesn't matter what we draw. Just paint white.
|
||||
final SceneBuilder builder = SceneBuilder();
|
||||
final PictureRecorder recorder = PictureRecorder();
|
||||
final Canvas canvas = Canvas(recorder);
|
||||
|
||||
canvas.drawRect(
|
||||
Rect.fromLTWH(0, 0, window.physicalSize.width, window.physicalSize.height),
|
||||
Paint()..color = const Color.fromARGB(255, 255, 255, 255),
|
||||
);
|
||||
final Picture picture = recorder.endRecording();
|
||||
|
||||
builder.addPicture(
|
||||
Offset.zero,
|
||||
picture,
|
||||
);
|
||||
final Scene scene = builder.build();
|
||||
window.render(scene);
|
||||
scene.dispose();
|
||||
|
||||
// On the first frame, also pretend that it drew a text field. Send the
|
||||
// corresponding semantics tree comprised of 1 node for the text field.
|
||||
window.updateSemantics((SemanticsUpdateBuilder()
|
||||
..updateNode(
|
||||
id: 0,
|
||||
// SemanticsFlag.isTextField.
|
||||
flags: 16,
|
||||
// SemanticsAction.tap.
|
||||
actions: 1,
|
||||
rect: const Rect.fromLTRB(0.0, 0.0, 414.0, 48.0),
|
||||
label: 'flutter textfield',
|
||||
labelAttributes: <StringAttribute>[],
|
||||
textDirection: TextDirection.ltr,
|
||||
textSelectionBase: -1,
|
||||
textSelectionExtent: -1,
|
||||
platformViewId: -1,
|
||||
maxValueLength: -1,
|
||||
currentValueLength: 0,
|
||||
scrollChildren: 0,
|
||||
scrollIndex: 0,
|
||||
scrollPosition: 0.0,
|
||||
scrollExtentMax: 0.0,
|
||||
scrollExtentMin: 0.0,
|
||||
transform: Matrix4.identity().storage,
|
||||
elevation: 0.0,
|
||||
thickness: 0.0,
|
||||
hint: '',
|
||||
hintAttributes: <StringAttribute>[],
|
||||
value: '',
|
||||
valueAttributes: <StringAttribute>[],
|
||||
increasedValue: '',
|
||||
increasedValueAttributes: <StringAttribute>[],
|
||||
decreasedValue: '',
|
||||
decreasedValueAttributes: <StringAttribute>[],
|
||||
tooltip: '',
|
||||
childrenInTraversalOrder: Int32List(0),
|
||||
childrenInHitTestOrder: Int32List(0),
|
||||
additionalActions: Int32List(0),
|
||||
)).build()
|
||||
);
|
||||
}
|
||||
|
||||
// We don't really care about the touch itself. It's just a way for the
|
||||
// XCUITest to communicate timing to the mock framework.
|
||||
@override
|
||||
void onPointerDataPacket(PointerDataPacket packet) {
|
||||
// This mimics the framework which shows the FlutterTextInputView before
|
||||
// updating the TextInputSemanticsObject.
|
||||
sendJsonMethodCall(
|
||||
dispatcher: dispatcher,
|
||||
channel: 'flutter/textinput',
|
||||
method: 'TextInput.setClient',
|
||||
arguments: <dynamic>[
|
||||
1,
|
||||
// The arguments are text field configurations. It doesn't really matter
|
||||
// since we're just testing text field accessibility here.
|
||||
<String, dynamic>{ 'obscureText': false },
|
||||
]
|
||||
);
|
||||
|
||||
sendJsonMethodCall(
|
||||
dispatcher: dispatcher,
|
||||
channel: 'flutter/textinput',
|
||||
method: 'TextInput.show',
|
||||
);
|
||||
|
||||
window.updateSemantics((SemanticsUpdateBuilder()
|
||||
..updateNode(
|
||||
id: 0,
|
||||
// SemanticsFlag.isTextField and SemanticsFlag.isFocused.
|
||||
flags: 48,
|
||||
actions: 18433,
|
||||
rect: const Rect.fromLTRB(0.0, 0.0, 414.0, 48.0),
|
||||
label: 'focused flutter textfield',
|
||||
labelAttributes: <StringAttribute>[],
|
||||
textDirection: TextDirection.ltr,
|
||||
textSelectionBase: 0,
|
||||
textSelectionExtent: 0,
|
||||
platformViewId: -1,
|
||||
maxValueLength: -1,
|
||||
currentValueLength: 0,
|
||||
scrollChildren: 0,
|
||||
scrollIndex: 0,
|
||||
scrollPosition: 0.0,
|
||||
scrollExtentMax: 0.0,
|
||||
scrollExtentMin: 0.0,
|
||||
transform: Matrix4.identity().storage,
|
||||
elevation: 0.0,
|
||||
thickness: 0.0,
|
||||
hint: '',
|
||||
hintAttributes: <StringAttribute>[],
|
||||
value: '',
|
||||
valueAttributes: <StringAttribute>[],
|
||||
increasedValue: '',
|
||||
increasedValueAttributes: <StringAttribute>[],
|
||||
decreasedValue: '',
|
||||
decreasedValueAttributes: <StringAttribute>[],
|
||||
tooltip: '',
|
||||
childrenInTraversalOrder: Int32List(0),
|
||||
childrenInHitTestOrder: Int32List(0),
|
||||
additionalActions: Int32List(0),
|
||||
)).build()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user