Bug 1245107 - browser_closeTab.js: wait for the tab to close. r=jaws draft
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 18 Feb 2016 12:40:47 -0800
changeset 331937 0a7c3cdcd8e66eb33c56b143fe96b4f5dfd3bfc5
parent 331936 86fbe58122a229201f7f86412a0c4219d50e418c
child 514506 058c8a8a9a57eb296e86bac6876a4757e35fa7b0
push id11122
push usermozilla@noorenberghe.ca
push dateThu, 18 Feb 2016 20:43:46 +0000
reviewersjaws
bugs1245107
milestone47.0a1
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
browser/components/uitour/test/browser_closeTab.js
--- 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;
 });