зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572560 - Fix intermittent of dom/ipc/tests/JSWindowActor/browser_destroy_callbacks.js; r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57325 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
978b02969c
Коммит
cbfb3e24dc
|
@ -3,7 +3,6 @@ support-files =
|
|||
head.js
|
||||
|
||||
[browser_destroy_callbacks.js]
|
||||
skip-if = os == 'mac' #Bug 1572560
|
||||
[browser_event_listener.js]
|
||||
[browser_getActor.js]
|
||||
[browser_getActor_filter.js]
|
||||
|
|
|
@ -70,7 +70,34 @@ declTest("destroy actor by page navigates", {
|
|||
let child = frame.contentWindow.window.getWindowGlobalChild();
|
||||
let actorChild = child.getActor("Test");
|
||||
ok(actorChild, "JSWindowActorChild should have value.");
|
||||
await ContentTaskUtils.waitForEvent(frame, "load");
|
||||
|
||||
let willDestroyPromise = new Promise(resolve => {
|
||||
const TOPIC = "test-js-window-actor-willdestroy";
|
||||
Services.obs.addObserver(function obs(subject, topic, data) {
|
||||
ok(data, "willDestroyCallback data should be true.");
|
||||
is(subject, actorChild, "Should have this value");
|
||||
|
||||
Services.obs.removeObserver(obs, TOPIC);
|
||||
resolve();
|
||||
}, TOPIC);
|
||||
});
|
||||
|
||||
let didDestroyPromise = new Promise(resolve => {
|
||||
const TOPIC = "test-js-window-actor-diddestroy";
|
||||
Services.obs.addObserver(function obs(subject, topic, data) {
|
||||
ok(data, "didDestroyCallback data should be true.");
|
||||
is(subject, actorChild, "Should have this value");
|
||||
|
||||
Services.obs.removeObserver(obs, TOPIC);
|
||||
resolve();
|
||||
}, TOPIC);
|
||||
});
|
||||
|
||||
await Promise.all([
|
||||
willDestroyPromise,
|
||||
didDestroyPromise,
|
||||
ContentTaskUtils.waitForEvent(frame, "load"),
|
||||
]);
|
||||
|
||||
Assert.throws(
|
||||
() => child.getActor("Test"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче