From aca8a9ec23672b034bf402bbb782e65ee98d8f8e Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Sat, 8 Jul 2017 10:49:55 +0200 Subject: [PATCH] Backed out changeset b72700473956 (bug 1374672) on request from whimboo for failing xpcshell's testing/marionette/test_navigate.js. r=backout --- testing/marionette/driver.js | 8 ++++---- testing/marionette/listener.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index 22db4479f58b..5b5d527a3608 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -1629,11 +1629,11 @@ GeckoDriver.prototype.switchToFrame = function* (cmd, resp) { if (win.document.readyState == "complete") { return; } else if (win.document.readyState == "interactive") { - let documentURI = win.document.documentURI; - if (documentURI.startsWith("about:certerror")) { + let baseURI = win.document.baseURI; + if (baseURI.startsWith("about:certerror")) { throw new InsecureCertificateError(); - } else if (otherErrorsExpr.exec(documentURI)) { - throw new UnknownError("Reached error page: " + documentURI); + } else if (otherErrorsExpr.exec(win.document.baseURI)) { + throw new UnknownError("Error loading page"); } } diff --git a/testing/marionette/listener.js b/testing/marionette/listener.js index 95c62680cfad..29c723372e42 100644 --- a/testing/marionette/listener.js +++ b/testing/marionette/listener.js @@ -222,7 +222,7 @@ var loadListener = { * Callback for registered DOM events. */ handleEvent(event) { - let location = event.target.documentURI || event.target.location.href; + let location = event.target.baseURI || event.target.location.href; logger.debug(`Received DOM event "${event.type}" for "${location}"`); switch (event.type) { @@ -255,21 +255,21 @@ var loadListener = { break; case "DOMContentLoaded": - if (event.target.documentURI.startsWith("about:certerror")) { + if (event.target.baseURI.startsWith("about:certerror")) { this.stop(); sendError(new InsecureCertificateError(), this.command_id); - } else if (/about:.*(error)\?/.exec(event.target.documentURI)) { + } else if (/about:.*(error)\?/.exec(event.target.baseURI)) { this.stop(); sendError(new UnknownError("Reached error page: " + - event.target.documentURI), this.command_id); + event.target.baseURI), 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.documentURI)) { + /about:blocked\?/.exec(event.target.baseURI)) { this.stop(); sendOk(this.command_id); }