mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00

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
27 lines
1010 B
JavaScript
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();
|
|
});
|