From 30d7c12e3908c18d4c44f6c30e8fa651732cbd75 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 30 May 2017 16:38:56 -0400 Subject: [PATCH] Bug 1370102 - Make browser_console_dead_objects.js correctly wait for the window to be destroyed instead of relying on the scheduling of the corresponding event; r=kmag --- .../client/webconsole/test/browser_console_dead_objects.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devtools/client/webconsole/test/browser_console_dead_objects.js b/devtools/client/webconsole/test/browser_console_dead_objects.js index 46b15d59bd3c..06e8bf26e973 100644 --- a/devtools/client/webconsole/test/browser_console_dead_objects.js +++ b/devtools/client/webconsole/test/browser_console_dead_objects.js @@ -30,6 +30,8 @@ function test() { function* runner() { Services.prefs.setBoolPref("devtools.chrome.enabled", true); yield loadTab(TEST_URI); + let browser = gBrowser.selectedBrowser; + let winID = browser.outerWindowID; info("open the browser console"); @@ -50,6 +52,11 @@ function test() { gBrowser.removeCurrentTab(); + yield TestUtils.topicObserved("outer-window-destroyed", (subject, data) => { + let id = subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data; + return id == winID; + }); + let msg = yield jsterm.execute("foobarzTezt"); isnot(hud.outputNode.textContent.indexOf("[object DeadObject]"), -1,