Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devtools: Fix ignoreDefaultArgs capability option #5710

Merged

Conversation

koggdal
Copy link
Contributor

@koggdal koggdal commented Aug 10, 2020

Proposed changes

The value of ignoreDefaultArgs was previously passed directly to launch from the package chrome-launcher. However, that function doesn't take the same parameter, it takes an ignoreDefaultFlags boolean parameter. It also doesn't do any filtering of arguments, it's either just ignoring all default flags or using all of them.

This changes code in devtools to always send ignoreDefaultFlags: true. This should be fine, since we have the default arguments in a list in this project, and passing all default arguments, together with custom arguments, onwards to chrome-launcher.

To not break previous behavior, I'm also adding these arguments as default arguments, as they were used from within the default arguments in chrome-launcher, but not in devtools:

  • --no-default-browser-check
  • --force-fieldtrials=*BackgroundTracing/default/

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Reviewers: @webdriverio/project-committers

@jsf-clabot
Copy link

jsf-clabot commented Aug 10, 2020

CLA assistant check
All committers have signed the CLA.

"--password-store=basic",
"--use-mock-keychain",
"--disable-component-extensions-with-background-pages",
"--disable-breakpad",
"--disable-dev-shm-usage",
"--disable-ipc-flooding-protection",
"--disable-renderer-backgrounding",
"--force-fieldtrials=*BackgroundTracing/default/",
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to disable background tracing by default? Will this have any impact on trace gatherer? @christian-bromann

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From looking at the implementation in chrome-launcher it looks to me like it will always use DEFAULT_FLAGS if ignoreDefaultFlags is falsy. ignoreDefaultFlags should always have been falsy, since we weren't passing it (we passed ignoreDefaultArgs). DEFAULT_FLAGS contains --force-fieldtrials=*BackgroundTracing/default/. So it seems to me like we've always gotten the argument, so this PR shouldn't have any impact on this, as from what I can tell, nothing changes in this regard. Of course, if you'd like to actually stop using the argument, let me know!

The value of `ignoreDefaultArgs` was previously passed directly to `launch`
from the package `chrome-launcher`. However, that function doesn't take the
same parameter, it takes an `ignoreDefaultFlags` boolean parameter. It also
doesn't do any filtering of arguments, it's either just ignoring all default
flags or using all of them.

This changes code in `devtools` to always send `ignoreDefaultFlags: true`. This
should be fine, since we have the default arguments in a list in this project,
and passing all default arguments, together with custom arguments, onwards to
`chrome-launcher`.

To not break previous behavior, I'm also adding these arguments as default
arguments, as they were used from within the default arguments in
`chrome-launcher`, but not in `devtools`:
* `--no-default-browser-check`
* `--force-fieldtrials=*BackgroundTracing/default/`
@koggdal koggdal force-pushed the devtools-fix-ignore-chrome-flags branch from 105e859 to b681f2b Compare August 11, 2020 07:11
@koggdal
Copy link
Contributor Author

koggdal commented Aug 13, 2020

Thanks for the review @SrinivasanTarget! 🙏 Seems like we need someone with write access. @christian-bromann? Thanks!

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Thanks for the review @SrinivasanTarget

LGTM

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Aug 23, 2020
@christian-bromann christian-bromann merged commit ff125ba into webdriverio:master Aug 23, 2020
@koggdal koggdal deleted the devtools-fix-ignore-chrome-flags branch August 24, 2020 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Polish 💅 PRs that contain improvements on existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants