Bug 1374672 - Use documentURI instead of baseURI. r=automatedtester
authorHenrik Skupin <mail@hskupin.info>
Fri, 07 Jul 2017 15:36:08 +0200
changeset 368143 555bd3e550b570f313468101f281da1c4c342211
parent 368142 da503e89be28dc0cce28c4f6b0e983ffff4d53b9
child 368144 f6817b119e1c847e83c5fac110b555ac5c53418f
push id32158
push usercbook@mozilla.com
push dateTue, 11 Jul 2017 10:48:59 +0000
treeherdermozilla-central@5e2692f8a367 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1374672
milestone56.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 1374672 - Use documentURI instead of baseURI. r=automatedtester baseURI isn't actually we have to check for to get the current documents URI. Therefore documentURI exists. MozReview-Commit-ID: CDhOZ8lU2qJ
testing/marionette/driver.js
testing/marionette/listener.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1624,21 +1624,21 @@ GeckoDriver.prototype.switchToFrame = fu
 
   let curWindow = this.getCurrentWindow();
 
   let checkLoad = function() {
     let win = this.getCurrentWindow();
     if (win.document.readyState == "complete") {
       return;
     } else if (win.document.readyState == "interactive") {
-      let baseURI = win.document.baseURI;
-      if (baseURI.startsWith("about:certerror")) {
+      let documentURI = win.document.documentURI;
+      if (documentURI.startsWith("about:certerror")) {
         throw new InsecureCertificateError();
-      } else if (otherErrorsExpr.exec(win.document.baseURI)) {
-        throw new UnknownError("Error loading page");
+      } else if (otherErrorsExpr.exec(documentURI)) {
+        throw new UnknownError("Reached error page: " + documentURI);
       }
     }
 
     checkTimer.initWithCallback(
         checkLoad.bind(this), 100, Ci.nsITimer.TYPE_ONE_SHOT);
   };
 
   if (this.context == Context.CHROME) {
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -217,17 +217,17 @@ var loadListener = {
       Services.obs.removeObserver(this, "outer-window-destroyed");
     } catch (e) {}
   },
 
   /**
    * Callback for registered DOM events.
    */
   handleEvent(event) {
-    let location = event.target.baseURI || event.target.location.href;
+    let location = event.target.documentURI || event.target.location.href;
     logger.debug(`Received DOM event "${event.type}" for "${location}"`);
 
     switch (event.type) {
       case "beforeunload":
         this.seenBeforeUnload = true;
         break;
 
       case "unload":
@@ -250,31 +250,31 @@ var loadListener = {
       case "hashchange":
         if (event.target === curContainer.frame) {
           this.stop();
           sendOk(this.command_id);
         }
         break;
 
       case "DOMContentLoaded":
-        if (event.target.baseURI.startsWith("about:certerror")) {
+        if (event.target.documentURI.startsWith("about:certerror")) {
           this.stop();
           sendError(new InsecureCertificateError(), this.command_id);
 
-        } else if (/about:.*(error)\?/.exec(event.target.baseURI)) {
+        } else if (/about:.*(error)\?/.exec(event.target.documentURI)) {
           this.stop();
           sendError(new UnknownError("Reached error page: " +
-              event.target.baseURI), this.command_id);
+              event.target.documentURI), this.command_id);
 
         // Return early with a page load strategy of eager, and also
         // special-case about:blocked pages which should be treated as
         // non-error pages but do not raise a pageshow event.
         } else if ((capabilities.get("pageLoadStrategy") ===
             session.PageLoadStrategy.Eager) ||
-            /about:blocked\?/.exec(event.target.baseURI)) {
+            /about:blocked\?/.exec(event.target.documentURI)) {
           this.stop();
           sendOk(this.command_id);
         }
         break;
 
       case "pageshow":
         if (event.target === curContainer.frame.document) {
           this.stop();