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:
John Dai 2019-12-17 13:37:22 +00:00
Родитель 978b02969c
Коммит cbfb3e24dc
2 изменённых файлов: 28 добавлений и 2 удалений

Просмотреть файл

@ -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"),