Unverified Commit 45c94ec3 authored by pdblasi-google's avatar pdblasi-google Committed by GitHub

Updates `flutter_localizations/test` to stop using `TestWindow` (#122564)

Reland: Updates `flutter_localizations/test` to stop using `TestWindow`
parent baaa43c6
......@@ -227,10 +227,9 @@ void main() {
const Size kCommonScreenSizeLandscape = Size(1770, 1070);
Future<void> showPicker(WidgetTester tester, Locale locale, Size size) async {
tester.binding.window.physicalSizeTestValue = size;
addTearDown(tester.binding.window.clearPhysicalSizeTestValue);
tester.binding.window.devicePixelRatioTestValue = 1.0;
addTearDown(tester.binding.window.clearDevicePixelRatioTestValue);
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1.0;
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(
home: Builder(
......
......@@ -9,8 +9,9 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('can localize the header in all known formats - portrait', (WidgetTester tester) async {
// Ensure picker is displayed in portrait mode.
tester.binding.window.physicalSizeTestValue = const Size(400, 800);
tester.binding.window.devicePixelRatioTestValue = 1;
tester.view.physicalSize = const Size(400, 800);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final Finder stringFragmentTextFinder = find.descendant(
of: find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_StringFragment'),
......@@ -74,15 +75,13 @@ void main() {
await tester.tapAt(Offset(center.dx, center.dy - 50.0));
await finishPicker(tester);
}
tester.binding.window.clearPhysicalSizeTestValue();
tester.binding.window.clearDevicePixelRatioTestValue();
});
testWidgets('can localize the header in all known formats - landscape', (WidgetTester tester) async {
// Ensure picker is displayed in landscape mode.
tester.binding.window.physicalSizeTestValue = const Size(800, 400);
tester.binding.window.devicePixelRatioTestValue = 1;
tester.view.physicalSize = const Size(800, 400);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final Finder stringFragmentTextFinder = find.descendant(
of: find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_StringFragment'),
......@@ -151,9 +150,6 @@ void main() {
await tester.tapAt(Offset(center.dx, center.dy - 50.0));
await finishPicker(tester);
}
tester.binding.window.clearPhysicalSizeTestValue();
tester.binding.window.clearDevicePixelRatioTestValue();
});
testWidgets('can localize input mode in all known formats', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment