Bug 1262710 - Don't use CPOW in devtools/server/test/browser tests when adding a tab; r=ochameau draft
authorPatrick Brosset <pbrosset@mozilla.com>
Wed, 08 Jun 2016 09:47:02 +0200
changeset 376545 1366bc929067f6c7bbd5f944f973101bf3af9d7c
parent 376544 57cd2f03c74d21f2581db654b8b2baafe91d3e26
child 523180 e3a6dff97835cf5a0632a32d9dbfcc4501502834
push id20607
push userpbrosset@mozilla.com
push dateWed, 08 Jun 2016 07:51:34 +0000
reviewersochameau
bugs1262710
milestone50.0a1
Bug 1262710 - Don't use CPOW in devtools/server/test/browser tests when adding a tab; r=ochameau MozReview-Commit-ID: DFJvufMBTjn
devtools/server/tests/browser/head.js
--- a/devtools/server/tests/browser/head.js
+++ b/devtools/server/tests/browser/head.js
@@ -26,29 +26,21 @@ waitForExplicitFinish();
  * 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
  * @return a promise that resolves to the new browser that the document
  *         is loaded in. Note that we cannot return the document
  *         directly, since this would be a CPOW in the e10s case,
  *         and Promises cannot be resolved with CPOWs (see bug 1233497).
  */
 var addTab = Task.async(function* (url) {
-  info("Adding a new tab with URL: '" + url + "'");
-  let tab = gBrowser.selectedTab = gBrowser.addTab();
-  let loaded = once(gBrowser.selectedBrowser, "load", true);
-
-  content.location = url;
-  yield loaded;
+  info(`Adding a new tab with URL: ${url}`);
+  let tab = gBrowser.selectedTab = gBrowser.addTab(url);
+  yield once(gBrowser.selectedBrowser, "load", true);
 
-  info("URL '" + url + "' loading complete");
-
-  yield new Promise(resolve => {
-    let isBlank = url == "about:blank";
-    waitForFocus(resolve, content, isBlank);
-  });
+  info(`Tab added and URL ${url} loaded`);
 
   return tab.linkedBrowser;
 });
 
 function* initAnimationsFrontForUrl(url) {
   const {AnimationsFront} = require("devtools/shared/fronts/animation");
   const {InspectorFront} = require("devtools/shared/fronts/inspector");