Skip to content

Commit

Permalink
Bug 1590864 - part3 : use 'notifyUserGestureActivation()' to activate…
Browse files Browse the repository at this point in the history
… document directly. r=edgar

I found that this test sometime would fail on the try server, and the reason is that the child document doesn't be activated correctly even if we have called `synthesizeMouseAtCenter()`.

In order to reduce the dependency of other modules, which might affect synthesizing event, we should use `notifyUserGestureActivation` to ensure that we indeed activate the document.

Differential Revision: https://phabricator.services.mozilla.com/D51685

--HG--
extra : moz-landing-system : lando
  • Loading branch information
alastor0325 committed Nov 5, 2019
1 parent b077049 commit a35ea86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dom/media/test/file_autoplay_policy_activation_frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
window.addEventListener("message",
(event) => {
if (event.data == "click") {
synthesizeMouseAtCenter(document.body, {});
SpecialPowers.wrap(document).notifyUserGestureActivation();
} else if (event.data == "play-audible") {
playAndPostResult(false, event.source);
} else if (event.data == "play-muted") {
Expand Down
2 changes: 1 addition & 1 deletion dom/media/test/file_autoplay_policy_activation_window.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
let test_case = event.data;
// Click the window to activate if appropriate.
if (test_case.activated_parent) {
synthesizeMouseAtCenter(document.body, {});
SpecialPowers.wrap(document).notifyUserGestureActivation();
}
let parent_window = event.source;
if (test_case.same_origin_child === undefined) {
Expand Down

0 comments on commit a35ea86

Please sign in to comment.