summaryrefslogtreecommitdiffstats
path: root/browser/components/sessionstore/test/browser_firefoxView_restore.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/sessionstore/test/browser_firefoxView_restore.js
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.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/sessionstore/test/browser_firefoxView_restore.js')
-rw-r--r--browser/components/sessionstore/test/browser_firefoxView_restore.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/browser/components/sessionstore/test/browser_firefoxView_restore.js b/browser/components/sessionstore/test/browser_firefoxView_restore.js
new file mode 100644
index 0000000000..9af181e0f5
--- /dev/null
+++ b/browser/components/sessionstore/test/browser_firefoxView_restore.js
@@ -0,0 +1,39 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const CLOSED_URI = "https://www.example.com/";
+
+add_task(async function test_TODO() {
+ let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, CLOSED_URI);
+
+ Assert.equal(gBrowser.tabs[0].linkedBrowser.currentURI.filePath, "blank");
+
+ Assert.equal(gBrowser.tabs[1].linkedBrowser.currentURI.spec, CLOSED_URI);
+
+ Assert.ok(gBrowser.selectedTab == tab);
+
+ let state = ss.getCurrentState(true);
+
+ // SessionStore uses one-based indexes
+ Assert.equal(state.windows[0].selected, 2);
+
+ await EventUtils.synthesizeMouseAtCenter(
+ window.document.getElementById("firefox-view-button"),
+ { type: "mousedown" },
+ window
+ );
+ Assert.ok(window.FirefoxViewHandler.tab.selected);
+
+ Assert.equal(gBrowser.tabs[2], window.FirefoxViewHandler.tab);
+
+ state = ss.getCurrentState(true);
+
+ // The FxView tab doesn't get recorded in the session state, but if it's the last selected tab when a window is closed
+ // we want to point to the first tab in the tab strip upon restore
+ Assert.equal(state.windows[0].selected, 1);
+
+ gBrowser.removeTab(window.FirefoxViewHandler.tab);
+ gBrowser.removeTab(tab);
+});