Bug 1262710 - Don't use CPOW in devtools/server/test/browser tests when adding a tab. r=ochameau, a=test-only
authorPatrick Brosset <pbrosset@mozilla.com>
Wed, 08 Jun 2016 09:47:02 +0200
changeset 341694 25bbebc01ba094f66d10183629a85bd85c897016
parent 341693 2325d1666f95509124ae589da37b42d5a5522126
child 341695 cc3c9a349ba128aa6664ca987595f9fa3415e293
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, test-only
bugs1262710
milestone49.0a2
Bug 1262710 - Don't use CPOW in devtools/server/test/browser tests when adding a tab. r=ochameau, a=test-only 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");