Bug 1245107 - browser_closeTab.js: wait for the tab to close. r=jaws
The UITour content API call uses sendAsyncMessage so we can't assume a synchronous close.
MozReview-Commit-ID: JXm2ztcLwW5
--- a/browser/components/uitour/test/browser_closeTab.js
+++ b/browser/components/uitour/test/browser_closeTab.js
@@ -6,11 +6,13 @@ var gTestTab;
var gContentAPI;
var gContentWindow;
add_task(setup_UITourTest);
add_UITour_task(function* test_closeTab() {
// Setting gTestTab to null indicates that the tab has already been closed,
// and if this does not happen the test run will fail.
+ let closePromise = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabClose");
yield gContentAPI.closeTab();
+ yield closePromise;
gTestTab = null;
});