Bug 1245107 - browser_closeTab.js: wait for the tab to close. r=jaws
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 18 Feb 2016 12:40:47 -0800
changeset 284702 a6c12ea824d635e7607a8567d02ecbcc3d448aff
parent 284701 c34fe673bb97d511920d2986cb84057f62e0c4a0
child 284703 1a1ec353998f06293c5d6c9ed6b63be2fc14e752
push id30012
push usercbook@mozilla.com
push dateFri, 19 Feb 2016 11:00:58 +0000
treeherdermozilla-central@9166484e331b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1245107
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
 });