Bug 1093660 - Fix intermittent browser_e10s_switchbrowser.js failures by not using a CPOW to log the loaded URI r=Gijs
authorTim Taubert <ttaubert@mozilla.com>
Wed, 11 Mar 2015 16:48:56 +0100
changeset 233376 fa2cd844dcc912a8f1463704d841a3f655cb713e
parent 233375 3aea1d4e06c5717a24c6130bf53843e6d0919452
child 233377 d8c4f1ecfe14378732421a2266493be0a7cf4968
push id56829
push userryanvm@gmail.com
push dateThu, 12 Mar 2015 22:35:09 +0000
treeherdermozilla-inbound@42afc7ef5ccb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1093660
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1093660 - Fix intermittent browser_e10s_switchbrowser.js failures by not using a CPOW to log the loaded URI r=Gijs
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);