Updates flutter/test/gestures to no longer reference TestWindow (#122327)

Updates `flutter/test/gestures` to no longer reference `TestWindow`
This commit is contained in:
pdblasi-google 2023-03-09 14:21:34 -08:00 committed by GitHub
parent 67e17e45f0
commit c2a5111cc0
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() {
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();
await tester.pumpWidget(MaterialApp(
@ -108,11 +110,11 @@ void main() {
expect(result.dragStarted, true);
expect(result.dragUpdate, true);
tester.binding.window.clearGestureSettingsTestValue();
});
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();
@ -131,6 +133,5 @@ void main() {
expect(result.dragStarted, true);
expect(result.dragUpdate, true);
tester.binding.window.clearGestureSettingsTestValue();
});
}