[test cross imports] More test/rendering + flutter_test/test fixes#188954
Conversation
…, proxy_box_test, proxy_getters_and_setters_test, and object_test
| colors: <Color>[Color(0xFFFF00FF), Color(0xFFFFFF00)], | ||
| ), | ||
| boxShadow: kElevationToShadow[3], | ||
| boxShadow: <BoxShadow>[ |
There was a problem hiding this comment.
This is copy paste from kElevationToShadow
| await tester.pumpWidget(const SizedBox()); | ||
|
|
||
| final Duration timeStampBefore = widgetsBinding.currentSystemFrameTimeStamp; | ||
| tester.binding.scheduleFrame(); |
There was a problem hiding this comment.
Strangely without forcing a frame the test fails, presumably because the CircularProgressIndicator animated widget schedules one?
There was a problem hiding this comment.
Yes, that must have been why CircularProgressIndicator was chosen here. I guess there is no Widgets-only equivalent though, so this is ok.
There was a problem hiding this comment.
Code Review
This pull request removes dependencies on the Material library from several rendering and flutter_test tests, allowing them to be removed from the cross-import checker's exclusion list. Material-specific widgets and colors are replaced with basic widgets and raw Color values. The review feedback suggests simplifying the newly added defaultPageRouteBuilder helper functions in live_binding_test.dart and test_text_input_test.dart by using arrow functions and naming unused parameters with underscores.
| PageRoute<T> defaultPageRouteBuilder<T>(RouteSettings settings, WidgetBuilder builder) { | ||
| return PageRouteBuilder<T>( | ||
| settings: settings, | ||
| pageBuilder: | ||
| ( | ||
| BuildContext context, | ||
| Animation<double> animation, | ||
| Animation<double> secondaryAnimation, | ||
| ) => builder(context), | ||
| transitionsBuilder: | ||
| ( | ||
| BuildContext context, | ||
| Animation<double> animation, | ||
| Animation<double> secondaryAnimation, | ||
| Widget child, | ||
| ) => child, | ||
| ); | ||
| } |
There was a problem hiding this comment.
This local helper function can be simplified and made more readable by using arrow functions and naming the unused parameters with underscores (_, __, ___). This reduces verbosity and avoids multi-line declarations for unused parameters.
PageRoute<T> defaultPageRouteBuilder<T>(RouteSettings settings, WidgetBuilder builder) {
return PageRouteBuilder<T>(
settings: settings,
pageBuilder: (BuildContext context, _, _) => builder(context),
transitionsBuilder: (_, __, ___, Widget child) => child,
);
}References
- The style guide encourages suggesting simplification and refactoring to enhance readability and maintainability, and optimizing for readability. (link)
| PageRoute<T> defaultPageRouteBuilder<T>(RouteSettings settings, WidgetBuilder builder) { | ||
| return PageRouteBuilder<T>( | ||
| settings: settings, | ||
| pageBuilder: | ||
| ( | ||
| BuildContext context, | ||
| Animation<double> animation, | ||
| Animation<double> secondaryAnimation, | ||
| ) => builder(context), | ||
| transitionsBuilder: | ||
| ( | ||
| BuildContext context, | ||
| Animation<double> animation, | ||
| Animation<double> secondaryAnimation, | ||
| Widget child, | ||
| ) => child, | ||
| ); | ||
| } |
There was a problem hiding this comment.
This local helper function can be simplified and made more readable by using arrow functions and naming the unused parameters with underscores (_, __, ___). This reduces verbosity and avoids multi-line declarations for unused parameters.
PageRoute<T> defaultPageRouteBuilder<T>(RouteSettings settings, WidgetBuilder builder) {
return PageRouteBuilder<T>(
settings: settings,
pageBuilder: (BuildContext context, _, _) => builder(context),
transitionsBuilder: (_, __, ___, Widget child) => child,
);
}References
- The style guide encourages suggesting simplification and refactoring to enhance readability and maintainability, and optimizing for readability. (link)
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| // TODO(gspencergoog): Remove this tag once this test's state leaks/test |
There was a problem hiding this comment.
I tried running this test with flutter test packages/flutter_test/test/test_text_input_test.dart --test-randomize-ordering-seed=20210721 and it did not cause any issues?
Can revert this if it does
There was a problem hiding this comment.
That issue is pretty old so hopefully this just got fixed in the meantime 🤞
| await tester.pumpWidget(const SizedBox()); | ||
|
|
||
| final Duration timeStampBefore = widgetsBinding.currentSystemFrameTimeStamp; | ||
| tester.binding.scheduleFrame(); |
There was a problem hiding this comment.
Yes, that must have been why CircularProgressIndicator was chosen here. I guess there is no Widgets-only equivalent though, so this is ok.
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| // TODO(gspencergoog): Remove this tag once this test's state leaks/test |
There was a problem hiding this comment.
That issue is pretty old so hopefully this just got fixed in the meantime 🤞
…12169) Manual roll Flutter from 91939cc4db78 to dc2a8703e12b (50 revisions) Manual roll requested by [email protected] flutter/flutter@91939cc...dc2a870 2026-07-09 [email protected] [ios,macos] Update swiftc.py flags to match swiftc (flutter/flutter#189174) 2026-07-09 [email protected] [AGP 9] Update Warn Version to AGP 9+ (flutter/flutter#189109) 2026-07-09 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#189203) 2026-07-09 [email protected] [web] Roll Chrome to 145 (framework) (flutter/flutter#182861) 2026-07-09 [email protected] Roll Packages from 52d84d6 to 20928d5 (6 revisions) (flutter/flutter#189194) 2026-07-09 [email protected] [web] Avoid absolute positioning for base CanvasKit canvas (flutter/flutter#188337) 2026-07-09 [email protected] Roll Dart SDK from cdb7217e65aa to a11fb7ed40a5 (6 revisions) (flutter/flutter#189195) 2026-07-09 [email protected] Fix dereference of nullptr in the moved-to-rect signal in the Linux embedder (flutter/flutter#189152) 2026-07-09 [email protected] Fix data for design packages (flutter/flutter#189140) 2026-07-09 [email protected] Roll Skia from 7b42d1251d54 to ab3a7b98c94d (2 revisions) (flutter/flutter#189181) 2026-07-09 [email protected] Roll Skia from 05d9d214e0b7 to 7b42d1251d54 (2 revisions) (flutter/flutter#189175) 2026-07-09 [email protected] Roll Skia from 542c8bdd7f4f to 05d9d214e0b7 (4 revisions) (flutter/flutter#189169) 2026-07-09 [email protected] UberSDF rect handling for thin (line-like) rectangles (flutter/flutter#188821) 2026-07-09 [email protected] Roll Skia from dd572c07f63c to 542c8bdd7f4f (4 revisions) (flutter/flutter#189160) 2026-07-09 [email protected] [flutter_tools] Fix hot restart for WASM web builds (flutter/flutter#187898) 2026-07-08 [email protected] Split FlViewRenderer into OpenGL and software backends (flutter/flutter#188824) 2026-07-08 [email protected] Promote android_hardware_smoke_tests out of bringup in CI (flutter/flutter#189081) 2026-07-08 [email protected] Roll Skia from 8df24be66531 to dd572c07f63c (4 revisions) (flutter/flutter#189150) 2026-07-08 [email protected] Expose LinuxWindowRegistrar on _window_linux.dart in order to better support out of tree LinuxWindowingOwners (flutter/flutter#188917) 2026-07-08 [email protected] Roll pub packages (flutter/flutter#189149) 2026-07-08 [email protected] fix(ci): harden some workflows (flutter/flutter#189087) 2026-07-08 [email protected] Roll Skia from 51a62da33da0 to 8df24be66531 (1 revision) (flutter/flutter#189139) 2026-07-08 [email protected] Roll Dart SDK to Dart 3.13 beta3 (flutter/flutter#189122) 2026-07-08 [email protected] [flutter_tools] Don't crash on non-UTF-8 plugin pubspec.yaml (flutter/flutter#188976) 2026-07-08 [email protected] [flutter_tools] Watch transitive #include headers for FragmentProgram hot reload (flutter/flutter#187945) 2026-07-08 [email protected] Roll Skia from 040d9f55de00 to 51a62da33da0 (1 revision) (flutter/flutter#189135) 2026-07-08 [email protected] Roll Packages from 92525f5 to 52d84d6 (7 revisions) (flutter/flutter#189134) 2026-07-08 [email protected] [flutter_tools] Forcefully kill hung subprocesses 5 seconds after timeout (flutter/flutter#187178) 2026-07-08 [email protected] Expose the app's build name and number as compile-time constants (flutter/flutter#187935) 2026-07-08 [email protected] Roll Skia from 1ff92f879815 to 040d9f55de00 (1 revision) (flutter/flutter#189131) 2026-07-08 [email protected] Roll Skia from 6137414bef5c to 1ff92f879815 (6 revisions) (flutter/flutter#189126) 2026-07-08 [email protected] [test cross imports] More test/rendering + flutter_test/test fixes (flutter/flutter#188954) 2026-07-08 [email protected] engine: explain why each candidate build was skipped in Flutter web loader (flutter/flutter#186254) 2026-07-08 [email protected] vscode: add missing unicode.h (flutter/flutter#189102) 2026-07-08 [email protected] Roll Fuchsia Linux SDK from 7RjQJBW3m-3Jl-7jr... to QcRFUtvCw2EobfJ8s... (flutter/flutter#189104) 2026-07-08 [email protected] Roll Skia from 075fbe4778d9 to 6137414bef5c (10 revisions) (flutter/flutter#189106) 2026-07-08 [email protected] engine: warn on WASM load failure when not crossOriginIsolated (flutter/flutter#186252) 2026-07-08 [email protected] Roll Dart SDK from c9bccc09e733 to db2155f56bf3 (2 revisions) (flutter/flutter#189105) 2026-07-08 [email protected] [flutter_tools] Prevent interactive device selection in machine mode (flutter/flutter#188267) 2026-07-08 [email protected] [flutter_tools] Fix wireless ADB device discovery when serial contains spaces (flutter/flutter#187943) 2026-07-07 [email protected] [web] Fix grouped autofill on iOS Chrome (flutter/flutter#187459) 2026-07-07 [email protected] Fix TextSelectionOverlay crash when layout is degenerate (flutter/flutter#188672) 2026-07-07 [email protected] [flutter_tools] Provision Android NDK in the main Gradle invocation (flutter/flutter#186337) 2026-07-07 [email protected] Android_hardware_smoke_test: Migrate to AGP 9 (flutter/flutter#189082) ...
This PR fixes some more cross imports in tests:
packages/flutter/test/rendering/box_test.dartpackages/flutter/test/rendering/pipeline_owner_tree_test.dartpackages/flutter/test/rendering/proxy_getters_and_setters_test.dartpackages/flutter/test/rendering/proxy_box_test.dartpackages/flutter/test/rendering/object_test.dartpackages/flutter_test/test/display_test.dartpackages/flutter_test/test/bindings_test.dartpackages/flutter_test/test/live_binding_test.dartpackages/flutter_test/test/test_text_input_test.dartpackages/flutter_test/test/multi_view_accessibility_test.dartPart of #177415
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.