Skip to content

Commit c5a061b

Browse files
[cross imports] navigator_test.dart (flutter#190954)
This PR fixes cross imports in navigator_test.dart, except for one test that is a regression test with TabBarView/TabController. (That test will need to be moved first, and the old test be deleted, rewritten after it was moved) It also cleans up some bits around test routes. Part of flutter#177415 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. 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](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot 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. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 0b771a5 commit c5a061b

5 files changed

Lines changed: 458 additions & 478 deletions

File tree

‎packages/flutter/test/widgets/focus_traversal_test.dart‎

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
1212

1313
import 'button_tester.dart';
1414
import 'semantics_tester.dart';
15+
import 'test_page_tester.dart';
1516
import 'utils.dart';
1617

1718
void main() {
@@ -3956,13 +3957,16 @@ void main() {
39563957

39573958
final focusIntentWithCallback = RequestFocusIntent(
39583959
nodeA,
3959-
requestFocusCallback: (
3960-
FocusNode node, {
3961-
double? alignment,
3962-
ScrollPositionAlignmentPolicy? alignmentPolicy,
3963-
Curve? curve,
3964-
Duration? duration,
3965-
}) => calledCallback = true,
3960+
requestFocusCallback:
3961+
(
3962+
FocusNode node, {
3963+
double? alignment,
3964+
ScrollPositionAlignmentPolicy? alignmentPolicy,
3965+
Curve? curve,
3966+
Duration? duration,
3967+
}) {
3968+
calledCallback = true;
3969+
},
39663970
);
39673971

39683972
RequestFocusAction().invoke(focusIntentWithCallback);
@@ -4207,24 +4211,6 @@ void main() {
42074211
);
42084212
}
42094213

4210-
class TestPage<T> extends Page<T> {
4211-
const TestPage({required this.child, super.key, super.name});
4212-
4213-
final Widget child;
4214-
4215-
@override
4216-
Route<T> createRoute(BuildContext context) {
4217-
return PageRouteBuilder<T>(
4218-
settings: this,
4219-
pageBuilder: (
4220-
BuildContext context,
4221-
Animation<double> animation,
4222-
Animation<double> secondaryAnimation,
4223-
) => child,
4224-
);
4225-
}
4226-
}
4227-
42284214
/// Used to test removal of nodes while sorting.
42294215
class SkipAllButFirstAndLastPolicy extends FocusTraversalPolicy
42304216
with DirectionalFocusTraversalPolicyMixin {

0 commit comments

Comments
 (0)