diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/security/test/referrer-policy/browser_session_history.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/security/test/referrer-policy/browser_session_history.js')
-rw-r--r-- | dom/security/test/referrer-policy/browser_session_history.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/dom/security/test/referrer-policy/browser_session_history.js b/dom/security/test/referrer-policy/browser_session_history.js new file mode 100644 index 0000000000..b480ce4ff0 --- /dev/null +++ b/dom/security/test/referrer-policy/browser_session_history.js @@ -0,0 +1,57 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_FILE = + "https://example.com/browser/dom/security/test/referrer-policy/file_session_history.sjs"; + +add_task(async function test_browser_navigation() { + await BrowserTestUtils.withNewTab(TEST_FILE, async browser => { + let loadPromise = BrowserTestUtils.browserLoaded(browser); + await SpecialPowers.spawn(browser, [], () => { + ok(content.document.getElementById("ok"), "Initial page should load"); + + info("Clicking on link to check referrer"); + content.document.getElementById("check_referrer").click(); + }); + await loadPromise; + + await SpecialPowers.spawn(browser, [], () => { + ok( + content.document.getElementById("ok"), + "Page should load when checking referrer" + ); + + info("Clicking on fragment link"); + content.document.getElementById("fragment").click(); + }); + + info("Reloading tab"); + loadPromise = BrowserTestUtils.browserLoaded(browser); + await BrowserTestUtils.reloadTab(gBrowser.selectedTab); + await loadPromise; + + await SpecialPowers.spawn(browser, [], () => { + ok( + content.document.getElementById("ok"), + "Page should load when checking referrer after fragment navigation and reload" + ); + + info("Clicking on push_state button"); + content.document.getElementById("push_state").click(); + }); + + info("Reloading tab"); + loadPromise = BrowserTestUtils.browserLoaded(browser); + await BrowserTestUtils.reloadTab(gBrowser.selectedTab); + await loadPromise; + + await SpecialPowers.spawn(browser, [], () => { + ok( + content.document.getElementById("ok"), + "Page should load when checking referrer after history.pushState and reload" + ); + }); + }); +}); |