diff --git a/packages/flutter/test/cupertino/scrollbar_test.dart b/packages/flutter/test/cupertino/scrollbar_test.dart index e0b8fad30182..71dd6c355d44 100644 --- a/packages/flutter/test/cupertino/scrollbar_test.dart +++ b/packages/flutter/test/cupertino/scrollbar_test.dart @@ -251,7 +251,7 @@ void main() { const double inset = 3; const double scaleFactor = 2; - final Size screenSize = tester.binding.window.physicalSize / tester.binding.window.devicePixelRatio; + final Size screenSize = tester.view.physicalSize / tester.view.devicePixelRatio; final ScrollController scrollController = ScrollController(); await tester.pumpWidget( diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index da1a86637295..80e8f730f90f 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -2,15 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// no-shuffle: -// //TODO(gspencergoog): Remove this tag once this test's state leaks/test -// dependencies have been fixed. -// https://github.com/flutter/flutter/issues/85160 -// Fails with "flutter test --test-randomize-ordering-seed=456" // reduced-test-set: // This file is run as part of a reduced test set in CI on Mac and Windows // machines. -@Tags(['reduced-test-set', 'no-shuffle']) +@Tags(['reduced-test-set']) library; import 'dart:ui' as ui show BoxHeightStyle, BoxWidthStyle, Color; @@ -5003,9 +4998,11 @@ void main() { group('Text selection toolbar', () { testWidgets('Collapsed selection works', (WidgetTester tester) async { + tester.view.physicalSize = const Size(400, 400); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + EditableText.debugDeterministicCursor = true; - tester.binding.window.physicalSizeTestValue = const Size(400, 400); - tester.binding.window.devicePixelRatioTestValue = 1; TextEditingController controller; EditableTextState state; Offset bottomLeftSelectionPosition; @@ -5183,15 +5180,14 @@ void main() { ), ), ); - - tester.binding.window.clearPhysicalSizeTestValue(); - tester.binding.window.clearDevicePixelRatioTestValue(); }); testWidgets('selecting multiple words works', (WidgetTester tester) async { + tester.view.physicalSize = const Size(400, 400); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + EditableText.debugDeterministicCursor = true; - tester.binding.window.physicalSizeTestValue = const Size(400, 400); - tester.binding.window.devicePixelRatioTestValue = 1; final TextEditingController controller; final EditableTextState state; @@ -5253,15 +5249,14 @@ void main() { ), ), ); - - tester.binding.window.clearPhysicalSizeTestValue(); - tester.binding.window.clearDevicePixelRatioTestValue(); }); testWidgets('selecting multiline works', (WidgetTester tester) async { + tester.view.physicalSize = const Size(400, 400); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + EditableText.debugDeterministicCursor = true; - tester.binding.window.physicalSizeTestValue = const Size(400, 400); - tester.binding.window.devicePixelRatioTestValue = 1; final TextEditingController controller; final EditableTextState state; @@ -5327,9 +5322,6 @@ void main() { ), ), ); - - tester.binding.window.clearPhysicalSizeTestValue(); - tester.binding.window.clearDevicePixelRatioTestValue(); }); // This is a regression test for diff --git a/packages/flutter/test/cupertino/text_selection_test.dart b/packages/flutter/test/cupertino/text_selection_test.dart index 2a63b04b40ab..b5283ab91404 100644 --- a/packages/flutter/test/cupertino/text_selection_test.dart +++ b/packages/flutter/test/cupertino/text_selection_test.dart @@ -246,8 +246,8 @@ void main() { testWidgets("When a menu item doesn't fit, a second page is used.", (WidgetTester tester) async { // Set the screen size to more narrow, so that Paste can't fit. - tester.binding.window.physicalSizeTestValue = const Size(800, 800); - addTearDown(tester.binding.window.clearPhysicalSizeTestValue); + tester.view.physicalSize = const Size(800, 800); + addTearDown(tester.view.reset); final TextEditingController controller = TextEditingController(text: 'abc def ghi'); await tester.pumpWidget(CupertinoApp( @@ -318,8 +318,8 @@ void main() { testWidgets('A smaller menu puts each button on its own page.', (WidgetTester tester) async { // Set the screen size to more narrow, so that two buttons can't fit on // the same page. - tester.binding.window.physicalSizeTestValue = const Size(640, 800); - addTearDown(tester.binding.window.clearPhysicalSizeTestValue); + tester.view.physicalSize = const Size(640, 800); + addTearDown(tester.view.reset); final TextEditingController controller = TextEditingController(text: 'abc def ghi'); await tester.pumpWidget(CupertinoApp( diff --git a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart index 83b6d4b53270..3912bc116bc8 100644 --- a/packages/flutter/test/cupertino/text_selection_toolbar_test.dart +++ b/packages/flutter/test/cupertino/text_selection_toolbar_test.dart @@ -188,8 +188,8 @@ void main() { testWidgets('does not paginate if children fit with zero margin', (WidgetTester tester) async { final List children = List.generate(7, (int i) => const TestBox()); - final double spacerWidth = 1.0 / tester.binding.window.devicePixelRatio; - final double dividerWidth = 1.0 / tester.binding.window.devicePixelRatio; + final double spacerWidth = 1.0 / tester.view.devicePixelRatio; + final double dividerWidth = 1.0 / tester.view.devicePixelRatio; const double borderRadius = 8.0; // Should match _kToolbarBorderRadius final double width = 7 * TestBox.itemWidth + 6 * (dividerWidth + 2 * spacerWidth) + 2 * borderRadius; await tester.pumpWidget(