Closed
Bug 1421518
Opened 7 years ago
Closed 7 years ago
Add an automation test for new autoplay policy
Categories
(Core :: Audio/Video: Playback, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(1 file)
Will add a chrome-browser test to ensure the play() can start or fail on different user-gestures scenario.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Priority: -- → P3
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8932724 [details]
Bug 1421518 - add user-gestures test for the autoplay policy.
https://reviewboard.mozilla.org/r/203774/#review210432
::: toolkit/content/tests/browser/browser_autoplay_policy_user_gestures.js:59
(Diff revision 2)
> + info("- can't autoplay without user activation -");
> + await canplayPromise;
> + ok(video.paused, "video can't start without user input.");
> +
> + info("- call play() without user activation -");
> + await video.play().catch(function() {
You don't need 'await' if you want to call .then() or .catch() on a promise.
::: toolkit/content/tests/browser/browser_autoplay_policy_user_gestures.js:84
(Diff revision 2)
> + info("- can't autoplay without user activation -");
> + await canplayPromise;
> + ok(video.paused, "video can't start without user input.");
> +
> + info("- call play() without user activation -");
> + await video.play().catch(function() {
This test is already done in test_play_without_user_gesture(). You don't need to duplicate the test here.
Attachment #8932724 -
Flags: review?(jwwang) → review+
Assignee | ||
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8932724 [details]
Bug 1421518 - add user-gestures test for the autoplay policy.
https://reviewboard.mozilla.org/r/203774/#review210450
::: toolkit/content/tests/browser/browser_autoplay_policy_user_gestures.js:59
(Diff revision 2)
> + info("- can't autoplay without user activation -");
> + await canplayPromise;
> + ok(video.paused, "video can't start without user input.");
> +
> + info("- call play() without user activation -");
> + await video.play().catch(function() {
That awit is used to keep the code running in correct sequence. If you remove it, the catch might be executed after removeTab().
Comment hidden (mozreview-request) |
Assignee | ||
Comment 6•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/213ae1ab70d4
add user-gestures test for the autoplay policy. r=jwwang
Comment 11•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•