Skip to content

[flutter_tools] Fix flutter drive --chrome-binary being ignored on web#185481

Merged
auto-submit[bot] merged 8 commits into
flutter:masterfrom
temoorx:codex/fix-drive-chrome-binary-web
Jun 1, 2026
Merged

[flutter_tools] Fix flutter drive --chrome-binary being ignored on web#185481
auto-submit[bot] merged 8 commits into
flutter:masterfrom
temoorx:codex/fix-drive-chrome-binary-web

Conversation

@temoorx

@temoorx temoorx commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a mismatch in the internal web platform args used by flutter drive.

For web runs, DriveCommand was passing --no-launch-chrome, but
ChromiumDevice.startApp checks for no-launch-chrome. Because of that,
Flutter still launched its default Chrome instance instead of leaving browser
startup to WebDriver, which made --chrome-binary ineffective.

This change updates the platform arg key to match what the web device expects
and adds a regression test covering the web flutter drive path.

Fixes #171504

Tests

  • FLUTTER_ROOT=/Users/temoor/Documents/Codex/2026-04-23-so-i-wanna-be-contributor-on/flutter ../../bin/cache/dart-sdk/bin/dart test test/commands.shard/hermetic/drive_test.dart -r expanded
  • FLUTTER_ROOT=/Users/temoor/Documents/Codex/2026-04-23-so-i-wanna-be-contributor-on/flutter ../../bin/cache/dart-sdk/bin/dart test test/general.shard/drive/web_driver_service_test.dart -r expanded

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 23, 2026
@temoorx temoorx marked this pull request as ready for review April 23, 2026 16:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the DriveCommand to use 'no-launch-chrome' instead of '--no-launch-chrome' in the platform arguments for web targets. It introduces a new test case and several helper classes in drive_test.dart to verify this change. The review feedback identifies that the newly added public classes lack documentation, which is a requirement of the repository's style guide.

}
}

class CapturingFlutterDriverFactory extends Fake implements FlutterDriverFactory {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The class CapturingFlutterDriverFactory is missing documentation. According to the Flutter style guide, all public members should have documentation.

Suggested change
class CapturingFlutterDriverFactory extends Fake implements FlutterDriverFactory {
/// A [FlutterDriverFactory] that returns a [CapturingDriverService].
class CapturingFlutterDriverFactory extends Fake implements FlutterDriverFactory {
References
  1. All public members should have documentation. (link)

}
}

class CapturingDriverService extends Fake implements DriverService {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The class CapturingDriverService is missing documentation. According to the Flutter style guide, all public members should have documentation.

Suggested change
class CapturingDriverService extends Fake implements DriverService {
/// A [DriverService] that captures the [platformArgs] passed to [start].
class CapturingDriverService extends Fake implements DriverService {
References
  1. All public members should have documentation. (link)

Future<TargetPlatform> get targetPlatform async => TargetPlatform.ios;
}

class FakeChromiumDriveDevice extends Fake implements ChromiumDevice {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The class FakeChromiumDriveDevice is missing documentation. According to the Flutter style guide, all public members should have documentation.

Suggested change
class FakeChromiumDriveDevice extends Fake implements ChromiumDevice {
/// A [ChromiumDevice] for testing web drive commands.
class FakeChromiumDriveDevice extends Fake implements ChromiumDevice {
References
  1. All public members should have documentation. (link)

@bkonyi bkonyi requested review from bkonyi and mdebbar May 4, 2026 14:22
bkonyi
bkonyi previously approved these changes May 4, 2026

@bkonyi bkonyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@mdebbar

mdebbar commented May 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for contributing this fix! This is a good first step towards fixing the issue. But I'm worried it doesn't fully resolve it.

Looking at the code here:

Map<String, Object> platformArgs = const <String, Object>{},

the platformArgs parameter isn't passed anywhere. There's still some work to do to make sure platformArgs is reaching all the way to ChromiumDevice.startApp.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 4, 2026
@temoorx

temoorx commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, good catch. You're right — platformArgs was reaching WebDriverService.start, but it was not being forwarded through the web runner path to ChromiumDevice.startApp. I've updated the fix to thread platformArgs through WebRunnerFactory and ResidentWebRunner, and added coverage for that path as well.

@bkonyi bkonyi added the CICD Run CI/CD label May 5, 2026
@bkonyi

bkonyi commented May 6, 2026

Copy link
Copy Markdown
Contributor

It looks like there's some failing tests that we'll need to resolve before this can land.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 6, 2026
@bkonyi bkonyi added the CICD Run CI/CD label May 7, 2026
@temoorx

temoorx commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@mdebbar

bkonyi
bkonyi previously approved these changes May 11, 2026
mdebbar
mdebbar previously approved these changes May 13, 2026
@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label May 13, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 13, 2026
@auto-submit

auto-submit Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/185481, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 13, 2026
@bkonyi bkonyi added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels May 13, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 13, 2026
@bkonyi bkonyi added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels May 15, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 15, 2026
@auto-submit

auto-submit Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/185481, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 2 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

bkonyi
bkonyi previously approved these changes May 15, 2026
@kevmoo kevmoo added the fyi-web For the attention of Web platform team label May 15, 2026
@temoorx

temoorx commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

All checks are green now. Please let me know if anything else is needed from my side. Thanks!

@temoorx temoorx requested a review from mdebbar May 19, 2026 16:03
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label May 19, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 19, 2026
@auto-submit

auto-submit Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/185481, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 25, 2026
@bkonyi bkonyi added team-web Owned by Web platform team CICD Run CI/CD labels Jun 1, 2026
@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 1, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 1, 2026
Merged via the queue into flutter:master with commit 4d5e75f Jun 1, 2026
170 of 171 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 1, 2026
@temoorx temoorx deleted the codex/fix-drive-chrome-binary-web branch June 2, 2026 07:24
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 2, 2026
flutter/flutter@54e199a...701665b

2026-06-02 engine-flutter-autoroll@skia.org Roll Skia from c97e939eb5c9 to 279b17fe9fc1 (16 revisions) (flutter/flutter#187425)
2026-06-02 bdero@google.com [Flutter GPU] Add block-compressed texture format support (BC, ETC2, ASTC LDR) (flutter/flutter#187281)
2026-06-02 bdero@google.com [Impeller] Allow attaching specific texture mip levels and slices (flutter/flutter#187066)
2026-06-02 bdero@google.com [Impeller] Fix GLES command submission status before context is current (flutter/flutter#187293)
2026-06-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 3cdc25e8ffe9 to d39850bf4a01 (9 revisions) (flutter/flutter#187409)
2026-06-01 jason-simmons@users.noreply.github.com [Impeller] Use glVertexAttribDivisor on GLES3 and glVertexAttribDivisorEXT on GLES2 with the extension (flutter/flutter#187313)
2026-06-01 matt.boetger@gmail.com [Android] Add Javadoc documentation to TextInputChannel (flutter/flutter#186018)
2026-06-01 mvincentong@gmail.com Read FLTEnableWideGamut from Dart bundle (flutter/flutter#186509)
2026-06-01 matt.boetger@gmail.com [flutter_tools] Remove obsolete AndroidX console warning during Gradle builds (flutter/flutter#186077)
2026-06-01 kjlubick@users.noreply.github.com [skia] Update gni file list name hsw -> ml3 (flutter/flutter#184892)
2026-06-01 zhongliu88889@gmail.com [web] Always sync slider input attrs regardless of gesture mode (flutter/flutter#187217)
2026-06-01 zhongliu88889@gmail.com [flutter_driver] Don't throw when stderr is unavailable on web (flutter/flutter#187190)
2026-06-01 116356835+AbdeMohlbi@users.noreply.github.com Remove unused code in `FlutterPluginUtils.kt` (flutter/flutter#187012)
2026-06-01 taak140@gmail.com [flutter_tools] Fix `flutter drive --chrome-binary` being ignored on web (flutter/flutter#185481)
2026-06-01 davidmartos96@gmail.com Eager failure when building and no XCode build settings (flutter/flutter#184726)
2026-06-01 goung123@gmail.com Fix Windows Korean IME caret position during composition (flutter/flutter#186353)
2026-06-01 okorohelijah@google.com iOS: update provisioning profile for 2026-2027 cert (flutter/flutter#187280)
2026-06-01 154381524+flutteractionsbot@users.noreply.github.com Sync CHANGELOG.md from stable (flutter/flutter#187380)
2026-06-01 jason-simmons@users.noreply.github.com Reland "Move dart-lang/ai to a top level third party dependency in engine (#187268)" (flutter/flutter#187378)
2026-06-01 stuartmorgan@google.com Add vector_math to Framework triage (flutter/flutter#187389)
2026-06-01 engine-flutter-autoroll@skia.org Roll Packages from e930ced to f5d50ca (4 revisions) (flutter/flutter#187381)
2026-06-01 mr_nadeem_iqbal@yahoo.com [flutter_tools] Reject archive entries that escape into a sibling directory by name prefix (#185794) (flutter/flutter#186647)
2026-06-01 bkonyi@google.com [flutter_tools] Fix widget_preview unawaited async write race condition (flutter/flutter#187177)
2026-06-01 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187375)
2026-06-01 engine-flutter-autoroll@skia.org Roll Skia from 0aee4675e0ad to c97e939eb5c9 (7 revisions) (flutter/flutter#187371)
2026-06-01 mr_nadeem_iqbal@yahoo.com docs: Stack.clipBehavior = Clip.none does not extend hit testing (#160787) (flutter/flutter#186643)

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 stuartmorgan@google.com,tarrinneal@google.com 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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11822)

flutter/flutter@54e199a...701665b

2026-06-02 engine-flutter-autoroll@skia.org Roll Skia from c97e939eb5c9 to 279b17fe9fc1 (16 revisions) (flutter/flutter#187425)
2026-06-02 bdero@google.com [Flutter GPU] Add block-compressed texture format support (BC, ETC2, ASTC LDR) (flutter/flutter#187281)
2026-06-02 bdero@google.com [Impeller] Allow attaching specific texture mip levels and slices (flutter/flutter#187066)
2026-06-02 bdero@google.com [Impeller] Fix GLES command submission status before context is current (flutter/flutter#187293)
2026-06-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 3cdc25e8ffe9 to d39850bf4a01 (9 revisions) (flutter/flutter#187409)
2026-06-01 jason-simmons@users.noreply.github.com [Impeller] Use glVertexAttribDivisor on GLES3 and glVertexAttribDivisorEXT on GLES2 with the extension (flutter/flutter#187313)
2026-06-01 matt.boetger@gmail.com [Android] Add Javadoc documentation to TextInputChannel (flutter/flutter#186018)
2026-06-01 mvincentong@gmail.com Read FLTEnableWideGamut from Dart bundle (flutter/flutter#186509)
2026-06-01 matt.boetger@gmail.com [flutter_tools] Remove obsolete AndroidX console warning during Gradle builds (flutter/flutter#186077)
2026-06-01 kjlubick@users.noreply.github.com [skia] Update gni file list name hsw -> ml3 (flutter/flutter#184892)
2026-06-01 zhongliu88889@gmail.com [web] Always sync slider input attrs regardless of gesture mode (flutter/flutter#187217)
2026-06-01 zhongliu88889@gmail.com [flutter_driver] Don't throw when stderr is unavailable on web (flutter/flutter#187190)
2026-06-01 116356835+AbdeMohlbi@users.noreply.github.com Remove unused code in `FlutterPluginUtils.kt` (flutter/flutter#187012)
2026-06-01 taak140@gmail.com [flutter_tools] Fix `flutter drive --chrome-binary` being ignored on web (flutter/flutter#185481)
2026-06-01 davidmartos96@gmail.com Eager failure when building and no XCode build settings (flutter/flutter#184726)
2026-06-01 goung123@gmail.com Fix Windows Korean IME caret position during composition (flutter/flutter#186353)
2026-06-01 okorohelijah@google.com iOS: update provisioning profile for 2026-2027 cert (flutter/flutter#187280)
2026-06-01 154381524+flutteractionsbot@users.noreply.github.com Sync CHANGELOG.md from stable (flutter/flutter#187380)
2026-06-01 jason-simmons@users.noreply.github.com Reland "Move dart-lang/ai to a top level third party dependency in engine (#187268)" (flutter/flutter#187378)
2026-06-01 stuartmorgan@google.com Add vector_math to Framework triage (flutter/flutter#187389)
2026-06-01 engine-flutter-autoroll@skia.org Roll Packages from e930ced to f5d50ca (4 revisions) (flutter/flutter#187381)
2026-06-01 mr_nadeem_iqbal@yahoo.com [flutter_tools] Reject archive entries that escape into a sibling directory by name prefix (#185794) (flutter/flutter#186647)
2026-06-01 bkonyi@google.com [flutter_tools] Fix widget_preview unawaited async write race condition (flutter/flutter#187177)
2026-06-01 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187375)
2026-06-01 engine-flutter-autoroll@skia.org Roll Skia from 0aee4675e0ad to c97e939eb5c9 (7 revisions) (flutter/flutter#187371)
2026-06-01 mr_nadeem_iqbal@yahoo.com docs: Stack.clipBehavior = Clip.none does not extend hit testing (#160787) (flutter/flutter#186643)

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 stuartmorgan@google.com,tarrinneal@google.com 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
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
…web (flutter#185481)

## Description

Fixes a mismatch in the internal web platform args used by `flutter
drive`.

For web runs, `DriveCommand` was passing `--no-launch-chrome`, but
`ChromiumDevice.startApp` checks for `no-launch-chrome`. Because of
that,
Flutter still launched its default Chrome instance instead of leaving
browser
startup to WebDriver, which made `--chrome-binary` ineffective.

This change updates the platform arg key to match what the web device
expects
and adds a regression test covering the web `flutter drive` path.

Fixes flutter#171504

## Tests

-
`FLUTTER_ROOT=/Users/temoor/Documents/Codex/2026-04-23-so-i-wanna-be-contributor-on/flutter
../../bin/cache/dart-sdk/bin/dart test
test/commands.shard/hermetic/drive_test.dart -r expanded`
-
`FLUTTER_ROOT=/Users/temoor/Documents/Codex/2026-04-23-so-i-wanna-be-contributor-on/flutter
../../bin/cache/dart-sdk/bin/dart test
test/general.shard/drive/web_driver_service_test.dart -r expanded`

---------

Co-authored-by: Ben Konyi <bkonyi@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD fyi-web For the attention of Web platform team team-web Owned by Web platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] Flutter drive --chrome-binary flag has no effect

5 participants