Skip to content

Conversation

@shindonghwi
Copy link
Contributor

@shindonghwi shindonghwi commented Dec 16, 2025

Fixes #171504

Problem

When running flutter drive -d chrome --chrome-binary=/path/to/chrome, the --chrome-binary flag was only being passed to WebDriver Chrome, not to the app hosting Chrome instance.

Solution

Added webChromeBinary field to DebuggingOptions and passed it through to ChromiumLauncher.launch().

Changes

  • Add webChromeBinary field to DebuggingOptions
  • Add chromeBinary parameter to ChromiumLauncher.launch()
  • Forward webChromeBinary in WebDriverService.start()
  • Add test for custom chrome binary path

Test

flutter drive -d chrome --chrome-binary="/custom/path/chrome" -v

Verified that log shows Will use Chromium executable at /custom/path/chrome.

… drive

Fixes flutter#171504

The --chrome-binary flag was only being passed to WebDriver Chrome,
not to the app hosting Chrome instance. This change passes the flag
through DebuggingOptions so both Chrome instances use the specified binary.

Changes:
- Add webChromeBinary field to DebuggingOptions
- Pass chromeBinary parameter to ChromiumLauncher.launch()
- Forward webChromeBinary in WebDriverService.start()
- Add test for custom chrome binary path
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 16, 2025
Copy link
Contributor

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

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 introduces a new feature that allows users to specify a custom path for the Chrome executable when running Flutter web applications. The changes involve adding a webChromeBinary parameter to the DebuggingOptions class and its constructors, propagating this parameter through the createDebuggingOptions method in RunCommandBase, and enabling the flutter drive command to accept a --chrome-binary argument. The ChromiumLauncher is updated to use the provided custom binary path if available, otherwise falling back to its default browser discovery. A new test case has been added to verify the functionality of launching Chrome with a custom binary path. No review comments were provided.

Update TestChromiumLauncher.launch() method signature in test files
to include the chromeBinary parameter added to ChromiumLauncher.launch()
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

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.

@bkonyi bkonyi added the team-web Owned by Web platform team label Jan 6, 2026
@bkonyi bkonyi requested review from bkonyi and mdebbar January 6, 2026 21:54
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.

LGTM!

However, it looks like packages/flutter_tools/test/web.shard/chrome_test.dart needs to be formatted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

2 participants