Bug 1211081 - Wait for tabs to close. r=felipe
authorBlake Kaplan <mrbkap@gmail.com>
Sun, 27 Mar 2016 14:18:00 +0200
changeset 290711 75a1822f9cb2e95da462e067d1f2cb1cee114f25
parent 290710 601ab3bdf31c3ee85e2183c2ec146164a1f6afa2
child 290712 3f54e19a24326db7c75d49ee000d53db6b628c83
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1211081
milestone48.0a1
Bug 1211081 - Wait for tabs to close. r=felipe MozReview-Commit-ID: 5k1hVXntMBl
browser/base/content/test/general/browser_bug596687.js
--- a/browser/base/content/test/general/browser_bug596687.js
+++ b/browser/base/content/test/general/browser_bug596687.js
@@ -1,26 +1,25 @@
-function test() {
-  var tab = gBrowser.addTab(null, {skipAnimation: true});
-  gBrowser.selectedTab = tab;
+add_task(function* test() {
+  var tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   var gotTabAttrModified = false;
   var gotTabClose = false;
 
   function onTabClose() {
     gotTabClose = true;
     tab.addEventListener("TabAttrModified", onTabAttrModified, false);
   }
 
   function onTabAttrModified() {
     gotTabAttrModified = true;
   }
 
   tab.addEventListener("TabClose", onTabClose, false);
 
-  gBrowser.removeTab(tab);
+  yield BrowserTestUtils.removeTab(tab);
 
   ok(gotTabClose, "should have got the TabClose event");
   ok(!gotTabAttrModified, "shouldn't have got the TabAttrModified event after TabClose");
 
   tab.removeEventListener("TabClose", onTabClose, false);
   tab.removeEventListener("TabAttrModified", onTabAttrModified, false);
-}
+});