Bug 1287007 - Fix timing issue in browser_ext_tabs_getCurrent.js r=billm
authorRob Wu <rob@robwu.nl>
Tue, 06 Sep 2016 14:45:58 -0700
changeset 428710 3d18af0cc52663e03e7c81d3646cc3baf8d2b3f1
parent 428709 9746d5da8a517c1e3d47d3a87f867c82ed1c576a
child 428711 6b9a398be651f28216e4693a6151776d73f44156
push id33405
push userbcampen@mozilla.com
push dateMon, 24 Oct 2016 15:32:53 +0000
reviewersbillm
bugs1287007
milestone52.0a1
Bug 1287007 - Fix timing issue in browser_ext_tabs_getCurrent.js r=billm browser.test.sendMessage does not have enough time to finish before tabs.remove since test moved to ChildAPIManager for extension pages, causing the test to time out. MozReview-Commit-ID: 1mmGZOi9fzm
browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
--- a/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
@@ -22,17 +22,16 @@ add_task(function* () {
             if (tabId == currentTab.id) {
               browser.tabs.onActivated.removeListener(listener);
 
               browser.tabs.getCurrent(currentTab => {
                 browser.test.assertEq(currentTab.id, tabId, "in active background tab");
                 browser.test.assertEq(currentTab.url, url, "getCurrent in non-active background tab");
 
                 browser.test.sendMessage("tab-finished");
-                browser.tabs.remove(tabId);
               });
             }
           });
           browser.tabs.update(currentTab.id, {active: true});
         });
       },
 
       "popup.js": function() {
@@ -61,10 +60,11 @@ add_task(function* () {
   yield extension.awaitMessage("background-finished");
   yield extension.awaitMessage("tab-finished");
 
   clickBrowserAction(extension);
   yield awaitExtensionPanel(extension);
   yield extension.awaitMessage("popup-finished");
   yield closeBrowserAction(extension);
 
+  // The extension tab is automatically closed when the extension unloads.
   yield extension.unload();
 });