Skip to content

Conversation

@QuncCccccc
Copy link
Contributor

@QuncCccccc QuncCccccc commented Jun 12, 2023

Updates most of the unit tests in the packages/flutter/test/material folder so that they'll pass if ThemeData.useMaterial3 defaults to true.

All of the tests have wired useMaterial3 to false and will need to be updated with a M3 version.

related to #127064

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Jun 12, 2023
@QuncCccccc QuncCccccc closed this Jun 12, 2023
@QuncCccccc QuncCccccc force-pushed the update_rest_of_unit_tests branch from 8a22d81 to c5a81d1 Compare June 12, 2023 20:00
@github-actions github-actions bot removed a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. f: material design flutter/packages/flutter/material repository. labels Jun 12, 2023
@QuncCccccc QuncCccccc reopened this Jun 12, 2023
@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Jun 12, 2023
@QuncCccccc QuncCccccc force-pushed the update_rest_of_unit_tests branch 2 times, most recently from 330645a to 781a410 Compare June 12, 2023 22:27
@QuncCccccc QuncCccccc changed the title Update rest of unit tests in material library for Material 3 Update unit tests in material library for Material 3 Jun 12, 2023
@QuncCccccc QuncCccccc force-pushed the update_rest_of_unit_tests branch from 781a410 to 6656958 Compare June 12, 2023 22:36
@QuncCccccc QuncCccccc marked this pull request as ready for review June 12, 2023 23:08
@QuncCccccc QuncCccccc requested a review from HansMuller June 12, 2023 23:09
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #128725 at sha 6656958

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Jun 12, 2023
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


Widget boilerplate({ Widget? bottomNavigationBar, required TextDirection textDirection }) {
return MaterialApp(
theme: ThemeData(useMaterial3: false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If most of the tests that use this function fail when useMaterial3 is true by default, then this change is fine. If not. it would be better to redefine it like this and only set the new parameter when it's necessary:

Widget boilerplate({ Widget? bottomNavigationBar, required TextDirection textDirection, bool? useMaterial3 }) {
  return MaterialApp(
    theme: ThemeData(useMaterial3: useMaterial3),
    home: Localizations(
    ...

theme: ThemeData(scrollbarTheme: ScrollbarThemeData(
theme: ThemeData(
useMaterial3: false,
scrollbarTheme: ScrollbarThemeData(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent below ScrollbarThemeData got dropped. Here and elsewhere in this file.

cursorColor: Colors.blue,
cursorWidth: 15,
cursorRadius: Radius.circular(3.0),
final Widget widget = Theme(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that the extra Theme overrides are needed to affect the overlay and the overlay's child?

Copy link
Contributor Author

@QuncCccccc QuncCccccc Jun 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. We don't need Theme at all here. This golden test seems failed whenever useMaterial3 is true/false, I think it might be another case for M1 chip. Thanks for catching this!

@QuncCccccc QuncCccccc added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 13, 2023
@QuncCccccc QuncCccccc force-pushed the update_rest_of_unit_tests branch from 4b51b6f to 3de119b Compare June 13, 2023 20:37
@auto-submit auto-submit bot merged commit a5f8b64 into master Jun 13, 2023
@auto-submit auto-submit bot deleted the update_rest_of_unit_tests branch June 13, 2023 21:21
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 14, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 14, 2023
Manual roll requested by [email protected]

flutter/flutter@09b7e56...95be76a

2023-06-14 [email protected] [web] Migrate framework away from dart:html and package:js (flutter/flutter#128580)
2023-06-14 [email protected] Fixed slider value indicator not disappearing after a bit on desktop platform when slider is clicked not dragged (flutter/flutter#128137)
2023-06-14 [email protected] Inline AbstractNode into SemanticsNode and Layer (flutter/flutter#128467)
2023-06-14 [email protected] Roll Flutter Engine from 727b4413fe6f to 2d8d5ecfe4a8 (5 revisions) (flutter/flutter#128842)
2023-06-14 [email protected] Roll Flutter Engine from 66a5761412f9 to 727b4413fe6f (10 revisions) (flutter/flutter#128841)
2023-06-14 [email protected] Roll Flutter Engine from b6bf3a6f1ccd to 66a5761412f9 (1 revision) (flutter/flutter#128813)
2023-06-13 [email protected] Fix syntax error in docstring (flutter/flutter#128692)
2023-06-13 [email protected] Update unit tests in material library for Material 3 (flutter/flutter#128725)
2023-06-13 [email protected] [flutter_tools] Suppress git output in flutter channel (flutter/flutter#128475)
2023-06-13 [email protected] Fix ensureVisible and default focus traversal for reversed scrollables (flutter/flutter#128756)
2023-06-13 [email protected] Roll Flutter Engine from f9a0a0dafeea to b6bf3a6f1ccd (2 revisions) (flutter/flutter#128797)
2023-06-13 [email protected] Update rest of the unit tests in material library for Material 3 (flutter/flutter#128747)
2023-06-13 [email protected] Update tests in material library for Material 3 by default (flutter/flutter#128300)
2023-06-13 [email protected] Update misc tests for Material3 (flutter/flutter#128712)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Jul 12, 2023
Updated unit tests for `Divider`/ `VerticalDivider`  and theme to have M2 and M3 versions.

More info in #128725
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 13, 2023
…#130415)

Updated unit tests for `Divider`/ `VerticalDivider`  and theme to have M2 and M3 versions.

More info in flutter#128725
auto-submit bot pushed a commit that referenced this pull request Jul 14, 2023
Updated unit tests for `DialogTheme` to have M2 and M3 versions.

More info in #128725
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
Updated unit tests for `DialogTheme` to have M2 and M3 versions.

More info in flutter#128725
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants