-
Notifications
You must be signed in to change notification settings - Fork 46
Disable autoplay policy enforcement in Chrome #552
base: master
Are you sure you want to change the base?
Conversation
Recent changes in the Chrome browser's policy for media "autoplay" [1] have implications for automated tests. At least 84 tests that were previously known to pass in automated scenarios now fail with error messages like: > play() failed because the user didn't interact with the document > first. https://goo.gl/xX8pDD Extend the invocation of the Chrome browser with a flag which is purported to disable this feature [2]. [1] https://developers.google.com/web/updates/2017/09/autoplay-policy-changes [2] https://peter.sh/experiments/chromium-command-line-switches/#no-user-gesture-required
@@ -83,7 +83,10 @@ def makeWptRunCommand(properties): | |||
# Chrome to call getUserMedia without failing out. | |||
command.extend([ | |||
'--binary-arg=--use-fake-ui-for-media-stream', | |||
'--binary-arg=--use-fake-device-for-media-stream' | |||
'--binary-arg=--use-fake-device-for-media-stream', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I wish we would put these flags in wptrunner directly rather than having special configuration here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. That feature needs a bit more definition before I can implement it, so I've opened gh-10823 to discuss it further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...which is in another repository, so I'll need a URL:
@mounirlamouri will know for sure what you need there. |
'--binary-arg=--use-fake-device-for-media-stream', | ||
# See | ||
# https://developers.google.com/web/updates/2017/09/autoplay-policy-changes | ||
'--binary-arg=--autoplay-policy=no-user-gesture-required' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@mounirlamouri or @foolip are the flags here the same as when tests are run in your infrastructure? Is there some other flag that we're missing (generally, not specifically about these 84 tests)? |
I'm included to say that rather than disabling the requirement, tests should be adapted to pass the requirement. A bit of work, though, for sure. |
There are a few ways to interpret the statement "tests should be adapted to pass the requirement":
Did you have one of these in mind? Or something else? |
I mean tests using the existing |
I think the overhead may not be worth it in most cases. In Chrome, we run all tests without autoplay policy and have a virtual test suite with some tests running with the policy enabled. |
@mounirlamouri, I can't find where For the two existing command line arguments we have a plan to get rid of them, and IMHO we should prefer WebDriver solutions where they exist because then we need not solve the problem once for every browser. In this case, we'll presumably have to do something for Safari as well. @kereliuk, WDYT? |
@foolip I think the flag comes from here: https://cs.chromium.org/chromium/src/content/shell/app/shell_main_delegate.cc?rcl=b32d39b663bc6f4e4b6a5d565bfd7babf51bf011&l=209 |
OK, looks like @zcorpan, you must have written a bunch of these tests originally, do you have some hunch about how long it might take to change them to use |
Recent changes in the Chrome browser's policy for media "autoplay" [1]
have implications for automated tests. At least 84 tests that were
previously known to pass in automated scenarios now fail with error
messages like:
Extend the invocation of the Chrome browser with a flag which is
purported to disable this feature [2].
[1] https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
[2] https://peter.sh/experiments/chromium-command-line-switches/#no-user-gesture-required
Hi @beaufortfrancois! I'd like to avoid regressing with future releases of Chrome; do you know of a canonical source documenting the
--autoplay-policy
command-line option?Listing of the 84 ests effected by policy change
These tests were identified by searching results data for references to
"https://goo.gl/xX8pDD"