gecko-dev/testing/marionette/test_navigate.js
Henrik Skupin 3dd4e99bb1 Bug 1374672 - Don't wait for page load events for identical hash parameters. r=automatedtester
If the target URL has the exact same hash parameter as the current URL no
page load will happen. As such Marionette should not wait for the appropriate
events.

MozReview-Commit-ID: LNbGJQgChya

--HG--
extra : rebase_source : a775f090c9c4e558803af80078c3eb3bf79fa583
2017-07-07 17:34:27 +02:00

27 lines
1010 B
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const {utils: Cu} = Components;
Cu.importGlobalProperties(["URL"]);
Cu.import("chrome://marionette/content/navigate.js");
add_test(function test_isLoadEventExpected() {
Assert.throws(() => navigate.isLoadEventExpected(undefined),
/Expected at least one URL/);
equal(true, navigate.isLoadEventExpected("http://a/"));
equal(true, navigate.isLoadEventExpected("http://a/", "http://a/"));
equal(true, navigate.isLoadEventExpected("http://a/", "http://a/#"));
equal(true, navigate.isLoadEventExpected("http://a/#", "http://a/"));
equal(true, navigate.isLoadEventExpected("http://a/#a", "http://a/#A"));
equal(false, navigate.isLoadEventExpected("http://a/#a", "http://a/#a"));
equal(false, navigate.isLoadEventExpected("http://a/", "javascript:whatever"));
run_next_test();
});