Bug 1510695 - Fix URL comparisons in reftestWait r=jgraham
☠☠ backed out by 3994da3447c3 ☠ ☠
authorGeoffrey Sneddon <me@gsnedders.com>
Thu, 10 Jan 2019 17:22:52 +0000
changeset 453341 aa26fbe413c4039675a4d45bb83c73e8d4e9af5d
parent 453340 bd2cb6b0a391056bd88a2e0d00577a80a3fef4fa
child 453342 daf05866f9ddcd5a362b4d436477f3e01abd4234
push id111085
push userdvarga@mozilla.com
push dateFri, 11 Jan 2019 04:23:32 +0000
treeherdermozilla-inbound@9cc1cf173fce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1510695
milestone66.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 1510695 - Fix URL comparisons in reftestWait r=jgraham Depends on D13281 Differential Revision: https://phabricator.services.mozilla.com/D13282
testing/marionette/harness/marionette_harness/tests/unit/test_reftest.py
testing/marionette/listener.js
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_reftest.py
+++ b/testing/marionette/harness/marionette_harness/tests/unit/test_reftest.py
@@ -40,8 +40,21 @@ class TestReftest(MarionetteTestCase):
                                             "expected": "PASS",
                                             "timeout": 10 * 1000})
         self.marionette._send_message("reftest:teardown", {})
         expected = {u'value': {u'extra': {},
                                u'message': u'Testing about:blank == about:blank\n',
                                u'stack': None,
                                u'status': u'PASS'}}
         self.assertEqual(expected, rv)
+
+    def test_url_comparison(self):
+        test_page = self.fixtures.where_is("test.html")
+        test_page_2 = self.fixtures.where_is("foo/../test.html")
+
+        self.marionette._send_message("reftest:setup", {"screenshot": "unexpected"})
+        rv = self.marionette._send_message("reftest:run",
+                                           {"test": test_page,
+                                            "references": [[test_page_2, [], "=="]],
+                                            "expected": "PASS",
+                                            "timeout": 10 * 1000})
+        self.marionette._send_message("reftest:teardown", {})
+        self.assertEqual(u"PASS", rv[u"value"][u"status"])
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -1615,16 +1615,18 @@ function flushRendering() {
 async function reftestWait(url, remote) {
   let win = curContainer.frame;
   let document = curContainer.frame.document;
 
   let windowUtils = content.windowUtils;
 
   let reftestWait = false;
 
+  url = new URL(url).href;
+
   if (document.location.href !== url || document.readyState != "complete") {
     logger.debug(truncate`Waiting for page load of ${url}`);
     await new Promise(resolve => {
       let maybeResolve = event => {
         if (event.target === curContainer.frame.document &&
             event.target.location.href === url) {
           win = curContainer.frame;
           document = curContainer.frame.document;