mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-02 09:18:36 +02:00
38 lines
1 KiB
JavaScript
38 lines
1 KiB
JavaScript
"use strict";
|
|
|
|
const TEST_URI =
|
|
getRootDirectory(gTestPath).replace(
|
|
"chrome://mochitests/content",
|
|
"https://example.com"
|
|
) + "dummy_page.html";
|
|
const TEST_URI_2 =
|
|
getRootDirectory(gTestPath).replace(
|
|
"chrome://mochitests/content",
|
|
"https://example.com"
|
|
) + "file_replace_state_during_navigation.html";
|
|
|
|
add_setup(async function () {
|
|
await SpecialPowers.pushPrefEnv({
|
|
set: [["browser.navigation.requireUserInteraction", true]],
|
|
});
|
|
});
|
|
|
|
add_task(async () => {
|
|
await BrowserTestUtils.withNewTab(TEST_URI, async browser => {
|
|
// Add user interaction to the first page.
|
|
await BrowserTestUtils.synthesizeMouseAtCenter("body", {}, browser);
|
|
|
|
// Follow link to the next page.
|
|
await followLink(TEST_URI_2);
|
|
|
|
// Navigate, causing a hashchange event to fire and call history.replaceState
|
|
await BrowserTestUtils.synthesizeMouseAtCenter("#link", {}, browser);
|
|
|
|
await assertMenulist([
|
|
TEST_URI_2 + "#1",
|
|
TEST_URI_2 + "#inject",
|
|
TEST_URI_2,
|
|
TEST_URI,
|
|
]);
|
|
});
|
|
});
|