diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:21:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:21:19 +0000 |
commit | 520a92573ce79e3628762e4ce06e284d50c2e548 (patch) | |
tree | dd7bece82fdce266f06a6a2a6043264255631ee7 /browser/components/sessionstore/test/browser_docshell_uuid_consistency.js | |
parent | Adding debian version 115.10.0esr-1~deb12u1. (diff) | |
download | firefox-esr-520a92573ce79e3628762e4ce06e284d50c2e548.tar.xz firefox-esr-520a92573ce79e3628762e4ce06e284d50c2e548.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_docshell_uuid_consistency.js')
-rw-r--r-- | browser/components/sessionstore/test/browser_docshell_uuid_consistency.js | 94 |
1 files changed, 23 insertions, 71 deletions
diff --git a/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js b/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js index 2414e04276..42e7678a92 100644 --- a/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js +++ b/browser/components/sessionstore/test/browser_docshell_uuid_consistency.js @@ -4,38 +4,18 @@ add_task(async function duplicateTab() { let tab = BrowserTestUtils.addTab(gBrowser, TEST_URL); await BrowserTestUtils.browserLoaded(tab.linkedBrowser); - if (!Services.appinfo.sessionHistoryInParent) { - await SpecialPowers.spawn(tab.linkedBrowser, [], function () { - let docshell = content.window.docShell.QueryInterface( - Ci.nsIWebNavigation - ); - let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0); - is(shEntry.docshellID.toString(), docshell.historyID.toString()); - }); - } else { - let historyID = tab.linkedBrowser.browsingContext.historyID; - let shEntry = - tab.linkedBrowser.browsingContext.sessionHistory.getEntryAtIndex(0); - is(shEntry.docshellID.toString(), historyID.toString()); - } + let historyID = tab.linkedBrowser.browsingContext.historyID; + let shEntry = + tab.linkedBrowser.browsingContext.sessionHistory.getEntryAtIndex(0); + is(shEntry.docshellID.toString(), historyID.toString()); let tab2 = gBrowser.duplicateTab(tab); await BrowserTestUtils.browserLoaded(tab2.linkedBrowser); - if (!Services.appinfo.sessionHistoryInParent) { - await SpecialPowers.spawn(tab2.linkedBrowser, [], function () { - let docshell = content.window.docShell.QueryInterface( - Ci.nsIWebNavigation - ); - let shEntry = docshell.sessionHistory.legacySHistory.getEntryAtIndex(0); - is(shEntry.docshellID.toString(), docshell.historyID.toString()); - }); - } else { - let historyID = tab2.linkedBrowser.browsingContext.historyID; - let shEntry = - tab2.linkedBrowser.browsingContext.sessionHistory.getEntryAtIndex(0); - is(shEntry.docshellID.toString(), historyID.toString()); - } + historyID = tab2.linkedBrowser.browsingContext.historyID; + shEntry = + tab2.linkedBrowser.browsingContext.sessionHistory.getEntryAtIndex(0); + is(shEntry.docshellID.toString(), historyID.toString()); BrowserTestUtils.removeTab(tab); BrowserTestUtils.removeTab(tab2); @@ -47,24 +27,10 @@ add_task(async function contentToChromeNavigate() { let tab = BrowserTestUtils.addTab(gBrowser, TEST_URL); await BrowserTestUtils.browserLoaded(tab.linkedBrowser); - if (!Services.appinfo.sessionHistoryInParent) { - await SpecialPowers.spawn(tab.linkedBrowser, [], function () { - let docshell = content.window.docShell.QueryInterface( - Ci.nsIWebNavigation - ); - let sh = docshell.sessionHistory; - is(sh.count, 1); - is( - sh.legacySHistory.getEntryAtIndex(0).docshellID.toString(), - docshell.historyID.toString() - ); - }); - } else { - let historyID = tab.linkedBrowser.browsingContext.historyID; - let sh = tab.linkedBrowser.browsingContext.sessionHistory; - is(sh.count, 1); - is(sh.getEntryAtIndex(0).docshellID.toString(), historyID.toString()); - } + let historyID = tab.linkedBrowser.browsingContext.historyID; + let sh = tab.linkedBrowser.browsingContext.sessionHistory; + is(sh.count, 1); + is(sh.getEntryAtIndex(0).docshellID.toString(), historyID.toString()); // Force the browser to navigate to the chrome process. BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:config"); @@ -74,31 +40,17 @@ add_task(async function contentToChromeNavigate() { let docShell = tab.linkedBrowser.frameLoader.docShell; // 'cause we're in the chrome process, we can just directly poke at the shistory. - if (!Services.appinfo.sessionHistoryInParent) { - let sh = docShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory; - - is(sh.count, 2); - is( - sh.legacySHistory.getEntryAtIndex(0).docshellID.toString(), - docShell.historyID.toString() - ); - is( - sh.legacySHistory.getEntryAtIndex(1).docshellID.toString(), - docShell.historyID.toString() - ); - } else { - let sh = docShell.browsingContext.sessionHistory; - - is(sh.count, 2); - is( - sh.getEntryAtIndex(0).docshellID.toString(), - docShell.historyID.toString() - ); - is( - sh.getEntryAtIndex(1).docshellID.toString(), - docShell.historyID.toString() - ); - } + sh = docShell.browsingContext.sessionHistory; + + is(sh.count, 2); + is( + sh.getEntryAtIndex(0).docshellID.toString(), + docShell.historyID.toString() + ); + is( + sh.getEntryAtIndex(1).docshellID.toString(), + docShell.historyID.toString() + ); BrowserTestUtils.removeTab(tab); }); |