Bug 1093660 - Fix intermittent browser_e10s_switchbrowser.js failures by not using a CPOW to log the loaded URI. r=Gijs, a=test-only
authorTim Taubert <ttaubert@mozilla.com>
Wed, 11 Mar 2015 16:48:56 +0100
changeset 257649 cf3737de127744a7440a4f7eca60b71291b95ef1
parent 257648 d2f5b54a9de0f9bcba04a5847e442c6ee15ed203
child 257650 b941fc78a871736b4aa53d90ebe92bfd87f01747
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1093660
milestone38.0a2
Bug 1093660 - Fix intermittent browser_e10s_switchbrowser.js failures by not using a CPOW to log the loaded URI. r=Gijs, a=test-only
browser/base/content/test/general/head.js
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -404,34 +404,37 @@ function waitForDocLoadAndStopIt(aExpect
     let mm = aBrowser.messageManager;
     mm.loadFrameScript("data:,(" + content_script.toString() + ")();", true);
     mm.addMessageListener("Test:WaitForDocLoadAndStopIt", complete);
     info("waitForDocLoadAndStopIt: Waiting for URL: " + aExpectedURL);
   });
 }
 
 /**
- * Waits for the next load to complete in the current browser.
+ * Waits for the next load to complete in any browser or the given browser.
+ * If a <tabbrowser> is given it waits for a load in any of its browsers.
  *
  * @return promise
  */
 function waitForDocLoadComplete(aBrowser=gBrowser) {
   return new Promise(resolve => {
     let listener = {
       onStateChange: function (webProgress, req, flags, status) {
         let docStop = Ci.nsIWebProgressListener.STATE_IS_NETWORK |
                       Ci.nsIWebProgressListener.STATE_STOP;
         info("Saw state " + flags.toString(16) + " and status " + status.toString(16));
 
         // When a load needs to be retargetted to a new process it is cancelled
         // with NS_BINDING_ABORTED so ignore that case
         if ((flags & docStop) == docStop && status != Cr.NS_BINDING_ABORTED) {
           aBrowser.removeProgressListener(this);
           waitForDocLoadComplete.listeners.delete(this);
-          info("Browser loaded " + aBrowser.contentWindow.location);
+
+          let chan = req.QueryInterface(Ci.nsIChannel);
+          info("Browser loaded " + chan.originalURI.spec);
           resolve();
         }
       },
       QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                              Ci.nsISupportsWeakReference])
     };
     aBrowser.addProgressListener(listener);
     waitForDocLoadComplete.listeners.add(listener);