summaryrefslogtreecommitdiffstats
path: root/browser/components/sessionstore/test/browser_history_persist.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 05:22:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 05:22:11 +0000
commit724b36b7051c0d9190cbd8854ba5919904967c11 (patch)
tree8996ac57bf70972bf524e865e0845cd54aab6f6b /browser/components/sessionstore/test/browser_history_persist.js
parentReleasing progress-linux version 115.10.0esr-1~deb12u1progress7u1. (diff)
downloadfirefox-esr-724b36b7051c0d9190cbd8854ba5919904967c11.tar.xz
firefox-esr-724b36b7051c0d9190cbd8854ba5919904967c11.zip
Merging upstream version 115.11.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/sessionstore/test/browser_history_persist.js')
-rw-r--r--browser/components/sessionstore/test/browser_history_persist.js138
1 files changed, 40 insertions, 98 deletions
diff --git a/browser/components/sessionstore/test/browser_history_persist.js b/browser/components/sessionstore/test/browser_history_persist.js
index b45a2b6779..4b098a9edb 100644
--- a/browser/components/sessionstore/test/browser_history_persist.js
+++ b/browser/components/sessionstore/test/browser_history_persist.js
@@ -25,54 +25,27 @@ add_task(async function check_history_not_persisted() {
browser = tab.linkedBrowser;
await promiseTabState(tab, state);
- if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
- await SpecialPowers.spawn(browser, [], function () {
- let sessionHistory =
- docShell.browsingContext.childSessionHistory.legacySHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- });
- } else {
- let sessionHistory = browser.browsingContext.sessionHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- }
+ let sessionHistory = browser.browsingContext.sessionHistory;
+
+ is(sessionHistory.count, 1, "Should be a single history entry");
+ is(
+ sessionHistory.getEntryAtIndex(0).URI.spec,
+ "about:blank",
+ "Should be the right URL"
+ );
// Load a new URL into the tab, it should replace the about:blank history entry
BrowserTestUtils.loadURIString(browser, "about:robots");
await promiseBrowserLoaded(browser, false, "about:robots");
- if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
- await SpecialPowers.spawn(browser, [], function () {
- let sessionHistory =
- docShell.browsingContext.childSessionHistory.legacySHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:robots",
- "Should be the right URL"
- );
- });
- } else {
- let sessionHistory = browser.browsingContext.sessionHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:robots",
- "Should be the right URL"
- );
- }
+
+ sessionHistory = browser.browsingContext.sessionHistory;
+
+ is(sessionHistory.count, 1, "Should be a single history entry");
+ is(
+ sessionHistory.getEntryAtIndex(0).URI.spec,
+ "about:robots",
+ "Should be the right URL"
+ );
// Cleanup.
BrowserTestUtils.removeTab(tab);
@@ -99,64 +72,33 @@ add_task(async function check_history_default_persisted() {
tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
browser = tab.linkedBrowser;
await promiseTabState(tab, state);
- if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
- await SpecialPowers.spawn(browser, [], function () {
- let sessionHistory =
- docShell.browsingContext.childSessionHistory.legacySHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- });
- } else {
- let sessionHistory = browser.browsingContext.sessionHistory;
-
- is(sessionHistory.count, 1, "Should be a single history entry");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- }
+
+ let sessionHistory = browser.browsingContext.sessionHistory;
+
+ is(sessionHistory.count, 1, "Should be a single history entry");
+ is(
+ sessionHistory.getEntryAtIndex(0).URI.spec,
+ "about:blank",
+ "Should be the right URL"
+ );
// Load a new URL into the tab, it should replace the about:blank history entry
BrowserTestUtils.loadURIString(browser, "about:robots");
await promiseBrowserLoaded(browser, false, "about:robots");
- if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
- await SpecialPowers.spawn(browser, [], function () {
- let sessionHistory =
- docShell.browsingContext.childSessionHistory.legacySHistory;
-
- is(sessionHistory.count, 2, "Should be two history entries");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- is(
- sessionHistory.getEntryAtIndex(1).URI.spec,
- "about:robots",
- "Should be the right URL"
- );
- });
- } else {
- let sessionHistory = browser.browsingContext.sessionHistory;
-
- is(sessionHistory.count, 2, "Should be two history entries");
- is(
- sessionHistory.getEntryAtIndex(0).URI.spec,
- "about:blank",
- "Should be the right URL"
- );
- is(
- sessionHistory.getEntryAtIndex(1).URI.spec,
- "about:robots",
- "Should be the right URL"
- );
- }
+
+ sessionHistory = browser.browsingContext.sessionHistory;
+
+ is(sessionHistory.count, 2, "Should be two history entries");
+ is(
+ sessionHistory.getEntryAtIndex(0).URI.spec,
+ "about:blank",
+ "Should be the right URL"
+ );
+ is(
+ sessionHistory.getEntryAtIndex(1).URI.spec,
+ "about:robots",
+ "Should be the right URL"
+ );
// Cleanup.
BrowserTestUtils.removeTab(tab);