Reland: Updates flutter/test/gestures to no longer reference TestWindow (#122619)

Reland: Updates `flutter/test/gestures` to no longer reference `TestWindow`
This commit is contained in:
pdblasi-google 2023-03-14 12:02:37 -07:00 committed by GitHub
parent f41ae4f4c9
commit 87c2ed1854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,9 @@ class NestedDraggableCase extends StatelessWidget {
void main() { void main() {
testWidgets('Scroll Views get the same ScrollConfiguration as GestureDetectors', (WidgetTester tester) async { testWidgets('Scroll Views get the same ScrollConfiguration as GestureDetectors', (WidgetTester tester) async {
tester.binding.window.gestureSettingsTestValue = const ui.GestureSettings(physicalTouchSlop: 4); tester.view.gestureSettings = const ui.GestureSettings(physicalTouchSlop: 4);
addTearDown(tester.view.reset);
final TestResult result = TestResult(); final TestResult result = TestResult();
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
@ -108,11 +110,11 @@ void main() {
expect(result.dragStarted, true); expect(result.dragStarted, true);
expect(result.dragUpdate, true); expect(result.dragUpdate, true);
tester.binding.window.clearGestureSettingsTestValue();
}); });
testWidgets('Scroll Views get the same ScrollConfiguration as Draggables', (WidgetTester tester) async { testWidgets('Scroll Views get the same ScrollConfiguration as Draggables', (WidgetTester tester) async {
tester.binding.window.gestureSettingsTestValue = const ui.GestureSettings(physicalTouchSlop: 4); tester.view.gestureSettings = const ui.GestureSettings(physicalTouchSlop: 4);
addTearDown(tester.view.reset);
final TestResult result = TestResult(); final TestResult result = TestResult();
@ -131,6 +133,5 @@ void main() {
expect(result.dragStarted, true); expect(result.dragStarted, true);
expect(result.dragUpdate, true); expect(result.dragUpdate, true);
tester.binding.window.clearGestureSettingsTestValue();
}); });
} }