diff options
Diffstat (limited to 'browser/components/sessionstore/test/browser_687710_2.js')
-rw-r--r-- | browser/components/sessionstore/test/browser_687710_2.js | 66 |
1 files changed, 18 insertions, 48 deletions
diff --git a/browser/components/sessionstore/test/browser_687710_2.js b/browser/components/sessionstore/test/browser_687710_2.js index 81d3c55379..190b5a718a 100644 --- a/browser/components/sessionstore/test/browser_687710_2.js +++ b/browser/components/sessionstore/test/browser_687710_2.js @@ -38,61 +38,31 @@ var state = { add_task(async function test() { let tab = BrowserTestUtils.addTab(gBrowser, "about:blank"); await promiseTabState(tab, state); - if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) { - await SpecialPowers.spawn(tab.linkedBrowser, [], function () { - function compareEntries(i, j, history) { - let e1 = history.getEntryAtIndex(i); - let e2 = history.getEntryAtIndex(j); - ok(e1.sharesDocumentWith(e2), `${i} should share doc with ${j}`); - is(e1.childCount, e2.childCount, `Child count mismatch (${i}, ${j})`); + function compareEntries(i, j, history) { + let e1 = history.getEntryAtIndex(i); + let e2 = history.getEntryAtIndex(j); - for (let c = 0; c < e1.childCount; c++) { - let c1 = e1.GetChildAt(c); - let c2 = e2.GetChildAt(c); + ok(e1.sharesDocumentWith(e2), `${i} should share doc with ${j}`); + is(e1.childCount, e2.childCount, `Child count mismatch (${i}, ${j})`); - ok( - c1.sharesDocumentWith(c2), - `Cousins should share documents. (${i}, ${j}, ${c})` - ); - } - } + for (let c = 0; c < e1.childCount; c++) { + let c1 = e1.GetChildAt(c); + let c2 = e2.GetChildAt(c); - let history = docShell.browsingContext.childSessionHistory.legacySHistory; - - is(history.count, 2, "history.count"); - for (let i = 0; i < history.count; i++) { - for (let j = 0; j < history.count; j++) { - compareEntries(i, j, history); - } - } - }); - } else { - function compareEntries(i, j, history) { - let e1 = history.getEntryAtIndex(i); - let e2 = history.getEntryAtIndex(j); - - ok(e1.sharesDocumentWith(e2), `${i} should share doc with ${j}`); - is(e1.childCount, e2.childCount, `Child count mismatch (${i}, ${j})`); - - for (let c = 0; c < e1.childCount; c++) { - let c1 = e1.GetChildAt(c); - let c2 = e2.GetChildAt(c); - - ok( - c1.sharesDocumentWith(c2), - `Cousins should share documents. (${i}, ${j}, ${c})` - ); - } + ok( + c1.sharesDocumentWith(c2), + `Cousins should share documents. (${i}, ${j}, ${c})` + ); } + } - let history = tab.linkedBrowser.browsingContext.sessionHistory; + let history = tab.linkedBrowser.browsingContext.sessionHistory; - is(history.count, 2, "history.count"); - for (let i = 0; i < history.count; i++) { - for (let j = 0; j < history.count; j++) { - compareEntries(i, j, history); - } + is(history.count, 2, "history.count"); + for (let i = 0; i < history.count; i++) { + for (let j = 0; j < history.count; j++) { + compareEntries(i, j, history); } } |