Backed out changeset 3ee39b8e78be (bug 1307347) for rebase bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 23 Feb 2017 21:46:02 -0500
changeset 376409 48e712105745330e121750acf1193d20cfe9f918
parent 376408 48b049856be44ea59113efa763d8b30e9720cbf9
child 376410 883dd404cfa2bab84de402e87484e1b2b268f466
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1307347
milestone53.0a2
backs out3ee39b8e78be1b03da8d3f7282844bdc70ab3dd8
Backed out changeset 3ee39b8e78be (bug 1307347) for rebase bustage.
devtools/client/framework/test/shared-head.js
devtools/client/webconsole/test/head.js
--- a/devtools/client/framework/test/shared-head.js
+++ b/devtools/client/framework/test/shared-head.js
@@ -106,27 +106,25 @@ registerCleanupFunction(function* cleanu
 });
 
 /**
  * Add a new test tab in the browser and load the given url.
  * @param {String} url The url to be loaded in the new tab
  * @param {Object} options Object with various optional fields:
  *   - {Boolean} background If true, open the tab in background
  *   - {ChromeWindow} window Firefox top level window we should use to open the tab
- *   - {String} preferredRemoteType
  * @return a promise that resolves to the tab object when the url is loaded
  */
 var addTab = Task.async(function* (url, options = { background: false, window: window }) {
   info("Adding a new tab with URL: " + url);
 
   let { background } = options;
   let { gBrowser } = options.window ? options.window : window;
 
-  let tab = gBrowser.addTab(url,
-    preferredRemoteType: options.preferredRemoteType});
+  let tab = gBrowser.addTab(url);
   if (!background) {
     gBrowser.selectedTab = tab;
   }
   yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
 
   info("Tab added and finished loading");
 
   return tab;
--- a/devtools/client/webconsole/test/head.js
+++ b/devtools/client/webconsole/test/head.js
@@ -42,27 +42,46 @@ var WCUL10n = new WebConsoleUtils.L10n(W
 
 const DOCS_GA_PARAMS = "?utm_source=mozilla" +
                        "&utm_medium=firefox-console-errors" +
                        "&utm_campaign=default";
 
 flags.testing = true;
 
 function loadTab(url, preferredRemoteType) {
-  return addTab(url, { preferredRemoteType }).then( tab => {
-    return { tab, browser: tab.linkedBrowser };
-  });
+  let deferred = promise.defer();
+
+  let tab = gBrowser.selectedTab = gBrowser.addTab(url, { preferredRemoteType });
+  let browser = gBrowser.getBrowserForTab(tab);
+
+  browser.addEventListener("load", function onLoad() {
+    browser.removeEventListener("load", onLoad, true);
+    deferred.resolve({tab: tab, browser: browser});
+  }, true);
+
+  return deferred.promise;
 }
 
 function loadBrowser(browser) {
   return BrowserTestUtils.browserLoaded(browser);
 }
 
 function closeTab(tab) {
-  return removeTab(tab);
+  let deferred = promise.defer();
+
+  let container = gBrowser.tabContainer;
+
+  container.addEventListener("TabClose", function onTabClose() {
+    container.removeEventListener("TabClose", onTabClose, true);
+    deferred.resolve(null);
+  }, true);
+
+  gBrowser.removeTab(tab);
+
+  return deferred.promise;
 }
 
 /**
  * Load the page and return the associated HUD.
  *
  * @param string uri
  *   The URI of the page to load.
  * @param string consoleType [optional]