зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1590864 - part3 : use 'notifyUserGestureActivation()' to activate 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
This commit is contained in:
Родитель
b077049e5f
Коммит
a35ea86333
|
@ -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") {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче