summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/tests/browser/browser_remoteness_switch.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /browser/components/urlbar/tests/browser/browser_remoteness_switch.js
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/urlbar/tests/browser/browser_remoteness_switch.js')
-rw-r--r--browser/components/urlbar/tests/browser/browser_remoteness_switch.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/browser/components/urlbar/tests/browser/browser_remoteness_switch.js b/browser/components/urlbar/tests/browser/browser_remoteness_switch.js
new file mode 100644
index 0000000000..364eeff1b2
--- /dev/null
+++ b/browser/components/urlbar/tests/browser/browser_remoteness_switch.js
@@ -0,0 +1,56 @@
+"use strict";
+
+/**
+ * Verify that when loading and going back/forward through history between URLs
+ * loaded in the content process, and URLs loaded in the parent process, we
+ * don't set the URL for the tab to about:blank inbetween the loads.
+ */
+add_task(async function () {
+ await SpecialPowers.pushPrefEnv({
+ set: [["browser.navigation.requireUserInteraction", false]],
+ });
+ let url = "http://www.example.com/foo.html";
+ await BrowserTestUtils.withNewTab(
+ { gBrowser, url },
+ async function (browser) {
+ let wpl = {
+ onLocationChange(unused, unused2, location) {
+ if (location.schemeIs("about")) {
+ is(
+ location.spec,
+ "about:config",
+ "Only about: location change should be for about:preferences"
+ );
+ } else {
+ is(
+ location.spec,
+ url,
+ "Only non-about: location change should be for the http URL we're dealing with."
+ );
+ }
+ },
+ };
+ gBrowser.addProgressListener(wpl);
+
+ let didLoad = BrowserTestUtils.browserLoaded(
+ browser,
+ null,
+ function (loadedURL) {
+ return loadedURL == "about:config";
+ }
+ );
+ BrowserTestUtils.loadURIString(browser, "about:config");
+ await didLoad;
+
+ gBrowser.goBack();
+ await BrowserTestUtils.browserLoaded(browser, null, function (loadedURL) {
+ return url == loadedURL;
+ });
+ gBrowser.goForward();
+ await BrowserTestUtils.browserLoaded(browser, null, function (loadedURL) {
+ return loadedURL == "about:config";
+ });
+ gBrowser.removeProgressListener(wpl);
+ }
+ );
+});