summaryrefslogtreecommitdiffstats
path: root/comm/mail/base/test/browser/browser_toolsMenu.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 /comm/mail/base/test/browser/browser_toolsMenu.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 'comm/mail/base/test/browser/browser_toolsMenu.js')
-rw-r--r--comm/mail/base/test/browser/browser_toolsMenu.js109
1 files changed, 109 insertions, 0 deletions
diff --git a/comm/mail/base/test/browser/browser_toolsMenu.js b/comm/mail/base/test/browser/browser_toolsMenu.js
new file mode 100644
index 0000000000..8dbf5911c8
--- /dev/null
+++ b/comm/mail/base/test/browser/browser_toolsMenu.js
@@ -0,0 +1,109 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const { MessageGenerator } = ChromeUtils.import(
+ "resource://testing-common/mailnews/MessageGenerator.jsm"
+);
+
+/** @type MenuData */
+const toolsMenuData = {
+ tasksMenuMail: { hidden: true },
+ addressBook: {},
+ menu_openSavedFilesWnd: {},
+ addonsManager: {},
+ activityManager: {},
+ imAccountsStatus: { disabled: true },
+ imStatusAvailable: {},
+ imStatusUnavailable: {},
+ imStatusOffline: {},
+ imStatusShowAccounts: {},
+ joinChatMenuItem: { disabled: true },
+ filtersCmd: {},
+ applyFilters: { disabled: ["mail3PaneTab", "contentTab"] },
+ applyFiltersToSelection: { disabled: ["mail3PaneTab", "contentTab"] },
+ runJunkControls: { disabled: true },
+ deleteJunk: { disabled: true },
+ menu_import: {},
+ menu_export: {},
+ manageKeysOpenPGP: {},
+ devtoolsMenu: {},
+ devtoolsToolbox: {},
+ addonDebugging: {},
+ javascriptConsole: {},
+ sanitizeHistory: {},
+};
+if (AppConstants.platform == "win") {
+ toolsMenuData.menu_preferences = {};
+ toolsMenuData.menu_accountmgr = {};
+}
+let helper = new MenuTestHelper("tasksMenu", toolsMenuData);
+
+let tabmail = document.getElementById("tabmail");
+let rootFolder, testFolder, testMessages;
+
+add_setup(async function () {
+ document.getElementById("toolbar-menubar").removeAttribute("autohide");
+
+ let generator = new MessageGenerator();
+
+ MailServices.accounts.createLocalMailAccount();
+ let account = MailServices.accounts.accounts[0];
+ account.addIdentity(MailServices.accounts.createIdentity());
+ rootFolder = account.incomingServer.rootFolder;
+
+ rootFolder.createSubfolder("tools menu", null);
+ testFolder = rootFolder
+ .getChildNamed("tools menu")
+ .QueryInterface(Ci.nsIMsgLocalMailFolder);
+ testFolder.addMessageBatch(
+ generator.makeMessages({ count: 5 }).map(message => message.toMboxString())
+ );
+ testMessages = [...testFolder.messages];
+
+ window.OpenMessageInNewTab(testMessages[0], { background: true });
+ await BrowserTestUtils.waitForEvent(
+ tabmail.tabInfo[1].chromeBrowser,
+ "MsgLoaded"
+ );
+
+ window.openTab("contentTab", {
+ url: "https://example.com/",
+ background: true,
+ });
+
+ registerCleanupFunction(() => {
+ tabmail.closeOtherTabs(0);
+ MailServices.accounts.removeAccount(account, false);
+ });
+});
+
+add_task(async function test3PaneTab() {
+ tabmail.currentAbout3Pane.displayFolder(rootFolder);
+ await helper.testAllItems("mail3PaneTab");
+
+ tabmail.currentAbout3Pane.displayFolder(testFolder);
+ await helper.testItems({
+ applyFilters: {},
+ runJunkControls: {},
+ deleteJunk: {},
+ });
+
+ tabmail.currentAbout3Pane.threadTree.selectedIndex = 1;
+ await helper.testItems({
+ applyFilters: {},
+ applyFiltersToSelection: {},
+ runJunkControls: {},
+ deleteJunk: {},
+ });
+});
+
+add_task(async function testMessageTab() {
+ tabmail.switchToTab(1);
+ await helper.testAllItems("mailMessageTab");
+});
+
+add_task(async function testContentTab() {
+ tabmail.switchToTab(2);
+ await helper.testAllItems("contentTab");
+});