Skip to content

Conversation

@munrocket
Copy link
Contributor

@munrocket munrocket commented Dec 20, 2024

Fixes #136109 P2
Related #148028 P1

Roadmap:

This PR:

  • Fixes Chrome bug from dart side
  • Adds pixelRatio mobile emulation in web
  • Adds new notation: 393,852 -> 393×852[@1]
  • Leaves previous behavior as it was, so 393,852 will give wrong size until Chrome will fix it. But you can use 393×852@1.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 20, 2024
@munrocket munrocket marked this pull request as ready for review December 22, 2024 10:51
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@munrocket
Copy link
Contributor Author

munrocket commented Dec 23, 2024

This PR is ready for review. Analyze broken because tree is red.

@jmagman
Copy link
Member

jmagman commented Dec 26, 2024

The analysis error is

 Found 1 Dart file which was formatted incorrectly.
 To fix, run `dart format packages/flutter_tools/lib/src/drive/web_driver_service.dart` or:
 git apply <<DONE
 diff --git a/packages/flutter_tools/lib/src/drive/web_driver_service.dart b/packages/flutter_tools/lib/src/drive/web_driver_service.dart
 index 02cbe7a84e..0000000000 100644
 --- a/packages/flutter_tools/lib/src/drive/web_driver_service.dart
 +++ b/packages/flutter_tools/lib/src/drive/web_driver_service.dart
 @@ -178,7 +178,8 @@ class WebDriverService extends DriverService {
                'height': height,
                'pixelRatio': double.parse(browserDimension[2]),
              },
 -            'userAgent': 'Mozilla/5.0 (Linux; Android 15) AppleWebKit/537.36 '
 +            'userAgent':
 +                'Mozilla/5.0 (Linux; Android 15) AppleWebKit/537.36 '
                  '(KHTML, like Gecko) Chrome/131.0.6778.200 Mobile Safari/537.36',
            };
          }
 @@ -382,3 +383,4 @@ Map<String, dynamic> getDesiredCapabilities(
      },
    },
  };
 DONE

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8727677075114199649/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout

@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 #160678 at sha bdbf90d

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Dec 27, 2024
@munrocket
Copy link
Contributor Author

munrocket commented Dec 27, 2024

@jmagman thanks for answer, I have little progress.

It’s not obvious how to find proper build, because there are no link from github and searching by PR/hash is off, only by test name.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

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 #160678 at sha 47f3e0c

@munrocket
Copy link
Contributor Author

It was not easy, but CI passed. Ready for review.

@jmagman
Copy link
Member

jmagman commented Dec 27, 2024

It was not easy, but CI passed. Ready for review.

Thank you for figuring it all out! We're a bit slower to review around the end of the year due to holidays, the web or tool team will take a look during their regularly scheduled triage.
cc @yjbanov

@bkonyi bkonyi requested review from bkonyi and yjbanov January 9, 2025 21:10
@bkonyi
Copy link
Contributor

bkonyi commented Jan 16, 2025

Hi @munrocket, just checking in. Do you have plans to pick this PR back up?

@mdebbar
Copy link
Contributor

mdebbar commented Apr 29, 2025

Looks good to me, thanks for the contribution!

I hit "Update branch" to bring the PR up to date. Let's see if CI is happy or not.

@mdebbar
Copy link
Contributor

mdebbar commented Apr 29, 2025

I think we need a 2nd review to land this PR. @bkonyi do you wanna take a look?

Copy link
Contributor

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

Sorry for the delay on this. LGTM.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label May 26, 2025
@auto-submit auto-submit bot added this pull request to the merge queue May 26, 2025
Merged via the queue into flutter:master with commit a9e9ff9 May 26, 2025
143 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 26, 2025
stan-at-work pushed a commit to stan-at-work/flutter that referenced this pull request May 26, 2025
…0678)

Fixes flutter#136109 P2
Related flutter#148028 P1

Roadmap:
- [x] find why not working (described in flutter#136109)
- [x] create new API with backward compatibility
(`--browser-dimension=393×852@3`)
- [x] fix edge cases
- [x] internal testing
- [x] add documentation (flutter drive -h)

This PR:
- Fixes Chrome bug from dart side
- Adds pixelRatio mobile emulation in web
- Adds new notation: 393,852 -> 393×852[@1]
- Leaves previous behavior as it was, so 393,852 will give wrong size
until Chrome will fix it. But you can use 393×852@1.

---------

Co-authored-by: Mouad Debbar <[email protected]>
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 28, 2025
flutter/flutter@4372bfb...0e536eb

2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399)
2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581)
2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298)
2025-05-28 [email protected] Update DEPS to  add dart-lang/ai repo (flutter/flutter#169540)
2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552)
2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231)
2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297)
2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542)
2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530)
2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275)
2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392)
2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514)
2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498)
2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157)
2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467)
2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478)
2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784)
2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471)
2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319)
2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320)
2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473)
2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678)
2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387)
2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353)
2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386)
2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604)
2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996)

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…r#9334)

flutter/flutter@4372bfb...0e536eb

2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399)
2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581)
2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298)
2025-05-28 [email protected] Update DEPS to  add dart-lang/ai repo (flutter/flutter#169540)
2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552)
2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231)
2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297)
2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542)
2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530)
2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275)
2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392)
2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514)
2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498)
2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157)
2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467)
2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478)
2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784)
2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471)
2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319)
2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320)
2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473)
2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678)
2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387)
2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353)
2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386)
2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604)
2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996)

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Ortes pushed a commit to Ortes/packages that referenced this pull request Jun 25, 2025
…r#9334)

flutter/flutter@4372bfb...0e536eb

2025-05-28 [email protected] Introduces FlutterPluginRegistrant protocol. (flutter/flutter#169399)
2025-05-28 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Initialize `default-flavor` in `FlutterCommand`, adds integration test. (#169298)" (flutter/flutter#169581)
2025-05-28 [email protected] Initialize `default-flavor` in `FlutterCommand`, adds integration test. (flutter/flutter#169298)
2025-05-28 [email protected] Update DEPS to  add dart-lang/ai repo (flutter/flutter#169540)
2025-05-28 [email protected] Roll Skia from 92311f2ba0b7 to 82d326fc2148 (1 revision) (flutter/flutter#169552)
2025-05-28 [email protected] dev/bots: improve service worker test code (flutter/flutter#169231)
2025-05-28 [email protected] Make Android team platform view TESTOWNERS (flutter/flutter#169297)
2025-05-28 [email protected] Roll Skia from 044f58f78a73 to 92311f2ba0b7 (9 revisions) (flutter/flutter#169542)
2025-05-27 [email protected] Roll Skia from 443f5257f382 to 044f58f78a73 (16 revisions) (flutter/flutter#169530)
2025-05-27 [email protected] [web] Fix unresponsive input above SelectionArea in Safari and Firefox. (flutter/flutter#167275)
2025-05-27 [email protected] Set pause_isolates_on_start flag if --start-paused (flutter/flutter#169392)
2025-05-27 [email protected] Roll Packages from af0b9a9 to 6eebe72 (24 revisions) (flutter/flutter#169514)
2025-05-27 [email protected] Roll Fuchsia Linux SDK from 5mpmPsuD8rpeiJizT... to nC9hLWjYVlChDTEPh... (flutter/flutter#169498)
2025-05-27 [email protected] Split hint from label and expose it via aria-description or aria-describedby (flutter/flutter#169157)
2025-05-26 [email protected] 🐛 Normalize generated file paths for the l10n generator (flutter/flutter#169467)
2025-05-26 [email protected] Roll Dart SDK from d811152316e4 to 6aeb798bdbe2 (2 revisions) (flutter/flutter#169478)
2025-05-26 [email protected] [Cupertino] Apply RSuperellipse to most Cupertino widgets (flutter/flutter#167784)
2025-05-26 [email protected] Roll `package:dds` to 5.0.2 (flutter/flutter#169471)
2025-05-26 [email protected] Use `.flutter-plugins-dependencies` for crash reporting. (flutter/flutter#169319)
2025-05-26 [email protected] Remove now disabled code that would generate `.flutter-plugins`. (flutter/flutter#169320)
2025-05-26 [email protected] Roll Dart SDK from 7dab9bffe1f7 to d811152316e4 (1 revision) (flutter/flutter#169473)
2025-05-26 [email protected] Precise browser resizing with integration_test and driver (flutter/flutter#160678)
2025-05-26 [email protected] Add `/coverage/` to `.gitignore.tmp` (flutter/flutter#169387)
2025-05-26 [email protected] Make test output with encoded `dart-defines=...` human readable. (flutter/flutter#169353)
2025-05-26 [email protected] Use at most `PROC~/2` tasks to transform assets. (flutter/flutter#169386)
2025-05-26 [email protected] Forward exit code from dart test to flutter test (flutter/flutter#168604)
2025-05-26 [email protected] Fix warning when building for macOS desktop (flutter/flutter#165996)

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flutter drive --browser-dimension not working

8 participants