diff --git a/packages/dynamic_layouts/example/test/staggered_example_test.dart b/packages/dynamic_layouts/example/test/staggered_example_test.dart index caa6c38aa70a..c43b4ff413d6 100644 --- a/packages/dynamic_layouts/example/test/staggered_example_test.dart +++ b/packages/dynamic_layouts/example/test/staggered_example_test.dart @@ -9,13 +9,9 @@ import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('StaggeredExample lays out children correctly', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(400, 200); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(400, 200); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( const MaterialApp( diff --git a/packages/dynamic_layouts/test/staggered_layout_test.dart b/packages/dynamic_layouts/test/staggered_layout_test.dart index 622f03aed6c4..e86b2b4e3db3 100644 --- a/packages/dynamic_layouts/test/staggered_layout_test.dart +++ b/packages/dynamic_layouts/test/staggered_layout_test.dart @@ -11,13 +11,9 @@ void main() { testWidgets( 'DynamicGridView works when using DynamicSliverGridDelegateWithFixedCrossAxisCount', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(400, 100); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(400, 100); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -59,13 +55,9 @@ void main() { testWidgets( 'DynamicGridView works when using DynamicSliverGridDelegateWithMaxCrossAxisExtent', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(440, 100); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(440, 100); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -106,13 +98,9 @@ void main() { group('DynamicGridView.staggered', () { testWidgets('DynamicGridView.staggered works with simple layout', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(400, 100); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(400, 100); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -158,13 +146,9 @@ void main() { }); testWidgets('DynamicGridView.staggered works with a horizontal grid', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(100, 500); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(100, 500); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -216,13 +200,9 @@ void main() { }); testWidgets('DynamicGridView.staggered works with a reversed grid', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(600, 200); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(600, 200); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -290,13 +270,10 @@ void main() { testWidgets('DynamicGridView.staggered deletes children appropriately', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(600, 1000); + tester.view.physicalSize = const Size(600, 1000); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; final List children = List.generate( 50, (int index) => SizedBox( @@ -375,13 +352,9 @@ void main() { group('DynamicGridView.builder', () { testWidgets('DynamicGridView.builder works with a staggered layout', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(400, 100); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(400, 100); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( @@ -430,13 +403,9 @@ void main() { testWidgets( 'DynamicGridView.builder works with an infinite grid using a staggered layout', (WidgetTester tester) async { - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(400, 100); - - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatioTestValue = 1.0; + tester.view.physicalSize = const Size(400, 100); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( diff --git a/packages/dynamic_layouts/test/wrap_layout_test.dart b/packages/dynamic_layouts/test/wrap_layout_test.dart index 1b0f7958c93c..31daa8b3476e 100644 --- a/packages/dynamic_layouts/test/wrap_layout_test.dart +++ b/packages/dynamic_layouts/test/wrap_layout_test.dart @@ -508,9 +508,7 @@ void main() { expect(find.text('Item 4'), findsNothing); await tester.binding.setSurfaceSize(const Size(280, 100)); // resets the screen to its original size after the test end - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - addTearDown(tester.binding.window.clearPhysicalSizeTestValue); + addTearDown(tester.view.resetPhysicalSize); await tester.pumpAndSettle(); expect(find.text('Item 0'), findsOneWidget); expect(find.text('Item 1'), findsOneWidget); @@ -572,9 +570,7 @@ void main() { await tester.binding.setSurfaceSize(const Size(560, 100)); // resets the screen to its original size after the test end - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - addTearDown(tester.binding.window.clearPhysicalSizeTestValue); + addTearDown(tester.view.resetPhysicalSize); await tester.pumpAndSettle(); expect(find.text('Item 0'), findsOneWidget); diff --git a/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart b/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart index 7b056b0d3779..98ea6d932b25 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart @@ -58,17 +58,11 @@ void runTests() { } else { expect( coordinate.x, - ((rect.center.dx - rect.topLeft.dx) * - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatio) + ((rect.center.dx - rect.topLeft.dx) * tester.view.devicePixelRatio) .round()); expect( coordinate.y, - ((rect.center.dy - rect.topLeft.dy) * - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatio) + ((rect.center.dy - rect.topLeft.dy) * tester.view.devicePixelRatio) .round()); } await tester.binding.setSurfaceSize(null); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index 345038f6ad9a..ded85725e649 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -470,17 +470,11 @@ void googleMapsTests() { final Rect rect = tester.getRect(find.byKey(key)); expect( coordinate.x, - ((rect.center.dx - rect.topLeft.dx) * - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatio) + ((rect.center.dx - rect.topLeft.dx) * tester.view.devicePixelRatio) .round()); expect( coordinate.y, - ((rect.center.dy - rect.topLeft.dy) * - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.devicePixelRatio) + ((rect.center.dy - rect.topLeft.dy) * tester.view.devicePixelRatio) .round()); await tester.binding.setSurfaceSize(null); }); diff --git a/packages/google_sign_in/google_sign_in/test/widgets_test.dart b/packages/google_sign_in/google_sign_in/test/widgets_test.dart index 5b4721114fcd..717edc3699ee 100644 --- a/packages/google_sign_in/google_sign_in/test/widgets_test.dart +++ b/packages/google_sign_in/google_sign_in/test/widgets_test.dart @@ -101,9 +101,8 @@ void main() { photoUrl: 'photoUrl', ); - // TODO(pdblasi-google): Update `window` usages to new API after 3.9.0 is in stable. https://github.com/flutter/flutter/issues/122912 - // ignore: deprecated_member_use - tester.binding.window.physicalSizeTestValue = const Size(100, 100); + tester.view.physicalSize = const Size(100, 100); + addTearDown(tester.view.reset); await HttpOverrides.runZoned( () async {