Bug 481143 - Update the default sorting order to descending for new users. r=babolivier,leftmostcat

Differential Revision: https://phabricator.services.mozilla.com/D187826

--HG--
extra : amend_source : a1a82f34ea5a8929ad63d04196e2c9acc3104c12
This commit is contained in:
Alessandro Castellani 2023-09-26 09:03:53 +03:00
Родитель 5da82e895f
Коммит 1d16db7669
28 изменённых файлов: 250 добавлений и 195 удалений

Просмотреть файл

@ -8,6 +8,7 @@ prefs =
mail.winsearch.firstRunDone=true
mailnews.start_page.override_url=about:blank
mailnews.start_page.url=about:blank
mailnews.default_sort_order=1
subsuite = thunderbird
support-files = files/**

Просмотреть файл

@ -49,7 +49,7 @@ add_task(async function test_update() {
await browser.mailTabs.update({ displayedFolder: folders[0] });
let expected = {
sortType: "date",
sortOrder: "ascending",
sortOrder: "descending",
viewType: "groupedByThread",
layout: "standard",
folderPaneVisible: true,
@ -63,21 +63,21 @@ add_task(async function test_update() {
await window.sendMessage("checkRealSort", expected);
await window.sendMessage("checkRealView", expected);
expected.sortOrder = "descending";
expected.sortOrder = "ascending";
for (let value of ["date", "subject", "author"]) {
await browser.mailTabs.update({
sortType: value,
sortOrder: "descending",
sortOrder: "ascending",
});
expected.sortType = value;
await window.sendMessage("checkRealSort", expected);
await window.sendMessage("checkRealView", expected);
}
expected.sortOrder = "ascending";
expected.sortOrder = "descending";
for (let value of ["author", "subject", "date"]) {
await browser.mailTabs.update({
sortType: value,
sortOrder: "ascending",
sortOrder: "descending",
});
expected.sortType = value;
await window.sendMessage("checkRealSort", expected);
@ -730,8 +730,8 @@ add_task(async function test_setSelectedMessages() {
// Change the selection in the foreground tab.
await browser.mailTabs.setSelectedMessages(foregroundTab, [
messages1[6].id,
messages1[7].id,
messages1.at(-7).id,
messages1.at(-8).id,
]);
// Check the current real state.
await window.sendMessage("checkRealLayout", {
@ -743,14 +743,14 @@ add_task(async function test_setSelectedMessages() {
let { messages: readMessagesA } =
await browser.mailTabs.getSelectedMessages(foregroundTab);
window.assertDeepEqual(
[messages1[6].id, messages1[7].id],
[messages1.at(-7).id, messages1.at(-8).id],
readMessagesA.map(m => m.id)
);
// Change the selection in the background tab.
await browser.mailTabs.setSelectedMessages(backgroundTab, [
messages2[0].id,
messages2[3].id,
messages2.at(-1).id,
messages2.at(-4).id,
]);
// Real state should be the same, since we're updating a background tab.
await window.sendMessage("checkRealLayout", {
@ -762,14 +762,14 @@ add_task(async function test_setSelectedMessages() {
let { messages: readMessagesB } =
await browser.mailTabs.getSelectedMessages(foregroundTab);
window.assertDeepEqual(
[messages1[6].id, messages1[7].id],
[messages1.at(-7).id, messages1.at(-8).id],
readMessagesB.map(m => m.id)
);
// Check API return value of the inactive background tab.
let { messages: readMessagesC } =
await browser.mailTabs.getSelectedMessages(backgroundTab);
window.assertDeepEqual(
[messages2[0].id, messages2[3].id],
[messages2.at(-1).id, messages2.at(-4).id],
readMessagesC.map(m => m.id)
);
// Switch to the background tab.
@ -778,7 +778,7 @@ add_task(async function test_setSelectedMessages() {
let { messages: readMessagesD } =
await browser.mailTabs.getSelectedMessages(backgroundTab);
window.assertDeepEqual(
[messages2[0].id, messages2[3].id],
[messages2.at(-1).id, messages2.at(-4).id],
readMessagesD.map(m => m.id)
);
// Check real state, should now match the active background tab.
@ -791,7 +791,7 @@ add_task(async function test_setSelectedMessages() {
let { messages: readMessagesE } =
await browser.mailTabs.getSelectedMessages(foregroundTab);
window.assertDeepEqual(
[messages1[6].id, messages1[7].id],
[messages1.at(-7).id, messages1.at(-8).id],
readMessagesE.map(m => m.id)
);
// Switch back to the foreground tab.
@ -799,14 +799,14 @@ add_task(async function test_setSelectedMessages() {
// Change the selection in the foreground tab.
await browser.mailTabs.setSelectedMessages(foregroundTab, [
messages2[2].id,
messages2[4].id,
messages2.at(-3).id,
messages2.at(-5).id,
]);
// Check API return value of the foreground tab.
let { messages: readMessagesF } =
await browser.mailTabs.getSelectedMessages(foregroundTab);
window.assertDeepEqual(
[messages2[2].id, messages2[4].id],
[messages2.at(-3).id, messages2.at(-5).id],
readMessagesF.map(m => m.id)
);
// Check real state.
@ -819,7 +819,7 @@ add_task(async function test_setSelectedMessages() {
let { messages: readMessagesG } =
await browser.mailTabs.getSelectedMessages(backgroundTab);
window.assertDeepEqual(
[messages2[0].id, messages2[3].id],
[messages2.at(-1).id, messages2.at(-4).id],
readMessagesG.map(m => m.id)
);
@ -840,10 +840,12 @@ add_task(async function test_setSelectedMessages() {
// Should throw if messages belong to different folders.
await browser.test.assertRejects(
browser.mailTabs.setSelectedMessages(foregroundTab, [
messages2[2].id,
messages1[4].id,
messages2.at(-3).id,
messages1.at(-5).id,
]),
`Message ${messages2[2].id} and message ${messages1[4].id} are not in the same folder, cannot select them both.`,
`Message ${messages2.at(-3).id} and message ${
messages1.at(-5).id
} are not in the same folder, cannot select them both.`,
"browser.mailTabs.setSelectedMessages() should reject, if the requested message do not belong to the same folder."
);

Просмотреть файл

@ -123,7 +123,7 @@ add_task(async function test_MV3_event_pages() {
// Select multiple messages.
{
let messages = [...subFolders.test1.messages].slice(0, 5);
const messages = [...subFolders.test1.messages].slice(0, 5);
tabmail.currentAbout3Pane.threadTree.selectedIndices = messages.map(m =>
tabmail.currentAbout3Pane.gDBView.findIndexOfMsgHdr(m, false)
);
@ -138,7 +138,7 @@ add_task(async function test_MV3_event_pages() {
"Tiny Wedding In a Fortnight",
"Red Document Needs Attention",
],
displayInfo[1].messages.map(e => e.subject),
displayInfo[1].messages.reverse().map(e => e.subject),
"The primed onSelectedMessagesChanged event should return the correct values"
);
Assert.deepEqual(

Просмотреть файл

@ -373,7 +373,7 @@ async function subtest_message_panes(
// Tests using a message with one attachment.
add_task(async function test_message_panes() {
gMessage = [...gFolders[0].messages][0];
about3Pane.threadTree.selectedIndex = 0;
about3Pane.threadTree.selectedIndex = 1;
await promiseMessageLoaded(messagePane, gMessage);
await subtest_message_panes(

Просмотреть файл

@ -373,7 +373,7 @@ async function subtest_message_panes(
// Tests using a message with two attachment.
add_task(async function test_message_panes() {
gMessage = [...gFolders[0].messages][1];
about3Pane.threadTree.selectedIndex = 1;
about3Pane.threadTree.selectedIndex = 0;
await promiseMessageLoaded(messagePane, gMessage);
await subtest_message_panes(

Просмотреть файл

@ -7,6 +7,9 @@ var gMessages;
var gFolder;
add_setup(() => {
// Use an ascending order because this test relies on message arrays matching.
Services.prefs.setIntPref("mailnews.default_sort_order", 1);
gAccount = createAccount();
let rootFolder = gAccount.incomingServer.rootFolder;
rootFolder.createSubfolder("test0", null);
@ -23,6 +26,10 @@ add_setup(() => {
gFolder = subFolders.test0;
gMessages = [...subFolders.test0.messages];
registerCleanupFunction(() => {
Services.prefs.clearUserPref("mailnews.default_sort_order");
});
});
add_task(async function testGetDisplayedMessage() {

Просмотреть файл

@ -78,23 +78,38 @@ add_task(async function testInsertRemoveCSS() {
await extension.startup();
await extension.awaitMessage();
await checkMessageBody({ backgroundColor: "rgba(0, 0, 0, 0)" }, messages[0]);
await checkMessageBody(
{ backgroundColor: "rgba(0, 0, 0, 0)" },
messages.at(-1)
);
extension.sendMessage();
await extension.awaitMessage();
await checkMessageBody({ backgroundColor: "rgb(0, 255, 0)" }, messages[0]);
await checkMessageBody(
{ backgroundColor: "rgb(0, 255, 0)" },
messages.at(-1)
);
extension.sendMessage();
await extension.awaitMessage();
await checkMessageBody({ backgroundColor: "rgba(0, 0, 0, 0)" }, messages[0]);
await checkMessageBody(
{ backgroundColor: "rgba(0, 0, 0, 0)" },
messages.at(-1)
);
extension.sendMessage();
await extension.awaitMessage();
await checkMessageBody({ backgroundColor: "rgb(0, 128, 0)" }, messages[0]);
await checkMessageBody(
{ backgroundColor: "rgb(0, 128, 0)" },
messages.at(-1)
);
extension.sendMessage();
await extension.awaitFinish("finished");
await checkMessageBody({ backgroundColor: "rgba(0, 0, 0, 0)" }, messages[0]);
await checkMessageBody(
{ backgroundColor: "rgba(0, 0, 0, 0)" },
messages.at(-1)
);
await extension.unload();
});
@ -151,7 +166,7 @@ add_task(async function testInsertRemoveCSSNoPermissions() {
backgroundColor: "rgba(0, 0, 0, 0)",
textContent: "",
},
messages[1]
messages.at(-2)
);
await extension.unload();
@ -192,11 +207,11 @@ add_task(async function testExecuteScript() {
await extension.startup();
await extension.awaitMessage();
await checkMessageBody({ textContent: "" }, messages[2]);
await checkMessageBody({ textContent: "" }, messages.at(-3));
extension.sendMessage();
await extension.awaitMessage();
await checkMessageBody({ foo: "bar" }, messages[2]);
await checkMessageBody({ foo: "bar" }, messages.at(-3));
extension.sendMessage();
await extension.awaitFinish("finished");
@ -205,7 +220,7 @@ add_task(async function testExecuteScript() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[2]
messages.at(-3)
);
await extension.unload();
@ -261,7 +276,7 @@ add_task(async function testExecuteScriptNoPermissions() {
await extension.startup();
await extension.awaitFinish("finished");
await checkMessageBody({ foo: null, textContent: "" }, messages[3]);
await checkMessageBody({ foo: null, textContent: "" }, messages.at(-4));
await extension.unload();
});
@ -296,13 +311,13 @@ add_task(async function testExecuteScriptAlias() {
await extension.startup();
await extension.awaitMessage();
await checkMessageBody({ textContent: "" }, messages[4]);
await checkMessageBody({ textContent: "" }, messages.at(-5));
extension.sendMessage();
await extension.awaitFinish("finished");
await checkMessageBody(
{ textContent: "message_display_scripts@mochitest" },
messages[4]
messages.at(-5)
);
await extension.unload();
@ -387,7 +402,7 @@ add_task(async function testRegister() {
backgroundColor: "rgba(0, 0, 0, 0)",
textContent: "",
},
messages[5]
messages.at(-6)
);
// Load a new message and check it is modified.
@ -402,7 +417,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[6]
messages.at(-7)
);
// Check runtime messaging.
let testDonePromise = extension.awaitMessage("RuntimeMessageTestDone");
@ -411,7 +426,7 @@ add_task(async function testRegister() {
// Open the message in a new tab.
loadPromise = extension.awaitMessage("ScriptLoaded");
let messageTab = await openMessageInTab(messages[6]);
let messageTab = await openMessageInTab(messages.at(-7));
let messageTabId = await loadPromise;
Assert.equal(tabmail.tabInfo.length, 2);
@ -422,7 +437,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[6],
messages.at(-7),
messageTab.browser
);
// Check runtime messaging.
@ -455,7 +470,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[6],
messages.at(-7),
messageTab.browser
);
// Check runtime messaging.
@ -465,7 +480,7 @@ add_task(async function testRegister() {
// Open the message in a new window.
loadPromise = extension.awaitMessage("ScriptLoaded");
let newWindow = await openMessageInWindow(messages[7]);
let newWindow = await openMessageInWindow(messages.at(-8));
let newWindowMessagePane = newWindow.getBrowser();
let windowTabId = await loadPromise;
@ -476,7 +491,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[7],
messages.at(-8),
newWindowMessagePane
);
// Check runtime messaging.
@ -497,7 +512,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[6],
messages.at(-7),
messageTab.browser
);
@ -511,7 +526,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[6]
messages.at(-7)
);
// Check the CSS is unloaded from the message in a window.
@ -522,7 +537,7 @@ add_task(async function testRegister() {
foo: "bar",
textContent: "Hey look, the script ran!",
},
messages[7],
messages.at(-8),
newWindowMessagePane
);
@ -571,12 +586,12 @@ async function subtestContentScriptManifest(message, ...permissions) {
add_task(async function testContentScriptManifestNoPermission() {
about3Pane.threadTree.selectedIndex = 7;
await awaitBrowserLoaded(messagePane);
await subtestContentScriptManifest(messages[7]);
await subtestContentScriptManifest(messages.at(-8));
});
add_task(async function testContentScriptManifest() {
about3Pane.threadTree.selectedIndex = 8;
await awaitBrowserLoaded(messagePane);
await subtestContentScriptManifest(messages[8], "messagesModify");
await subtestContentScriptManifest(messages.at(-9), "messagesModify");
});
/** Tests registered content scripts do not affect message display. */
@ -623,13 +638,13 @@ async function subtestContentScriptRegister(message, ...permissions) {
add_task(async function testContentScriptRegisterNoPermission() {
about3Pane.threadTree.selectedIndex = 9;
await awaitBrowserLoaded(messagePane);
await subtestContentScriptRegister(messages[9], "<all_urls>");
await subtestContentScriptRegister(messages.at(-10), "<all_urls>");
});
add_task(async function testContentScriptRegister() {
about3Pane.threadTree.selectedIndex = 10;
await awaitBrowserLoaded(messagePane);
await subtestContentScriptRegister(
messages[10],
messages.at(-11),
"<all_urls>",
"messagesModify"
);

Просмотреть файл

@ -14,26 +14,26 @@ add_setup(async () => {
// Modify the messages so the filters can be checked against them.
messages = [...subFolders[0].messages];
messages[0].markRead(true);
messages[2].markRead(true);
messages[4].markRead(true);
messages[6].markRead(true);
messages[8].markRead(true);
messages[1].markFlagged(true);
messages[6].markFlagged(true);
messages[0].setStringProperty("keywords", "$label1");
messages[1].setStringProperty("keywords", "$label2");
messages[3].setStringProperty("keywords", "$label1 $label2");
messages[5].setStringProperty("keywords", "$label2");
messages[6].setStringProperty("keywords", "$label1");
messages[7].setStringProperty("keywords", "$label2 $label3");
messages[8].setStringProperty("keywords", "$label3");
messages[9].setStringProperty("keywords", "$label1 $label2 $label3");
messages[9].markHasAttachments(true);
messages.at(-1).markRead(true);
messages.at(-3).markRead(true);
messages.at(-5).markRead(true);
messages.at(-7).markRead(true);
messages.at(-9).markRead(true);
messages.at(-2).markFlagged(true);
messages.at(-7).markFlagged(true);
messages.at(-1).setStringProperty("keywords", "$label1");
messages.at(-2).setStringProperty("keywords", "$label2");
messages.at(-4).setStringProperty("keywords", "$label1 $label2");
messages.at(-6).setStringProperty("keywords", "$label2");
messages.at(-7).setStringProperty("keywords", "$label1");
messages.at(-8).setStringProperty("keywords", "$label2 $label3");
messages.at(-9).setStringProperty("keywords", "$label3");
messages.at(0).setStringProperty("keywords", "$label1 $label2 $label3");
messages.at(0).markHasAttachments(true);
// Add an author to the address book.
let author = messages[7].author.replace(/["<>]/g, "").split(" ");
let author = messages.at(-8).author.replace(/["<>]/g, "").split(" ");
let card = Cc["@mozilla.org/addressbook/cardproperty;1"].createInstance(
Ci.nsIAbCard
);
@ -54,53 +54,53 @@ add_setup(async () => {
add_task(async () => {
async function background() {
browser.mailTabs.setQuickFilter({ unread: true });
await window.sendMessage("checkVisible", 1, 3, 5, 7, 9);
await window.sendMessage("checkVisible", 8, 6, 4, 2, 0);
browser.mailTabs.setQuickFilter({ flagged: true });
await window.sendMessage("checkVisible", 1, 6);
await window.sendMessage("checkVisible", 8, 3);
browser.mailTabs.setQuickFilter({ flagged: true, unread: true });
await window.sendMessage("checkVisible", 1);
await window.sendMessage("checkVisible", 8);
browser.mailTabs.setQuickFilter({ tags: true });
await window.sendMessage("checkVisible", 0, 1, 3, 5, 6, 7, 8, 9);
await window.sendMessage("checkVisible", 9, 8, 6, 4, 3, 2, 1, 0);
browser.mailTabs.setQuickFilter({
tags: { mode: "any", tags: { $label1: true } },
});
await window.sendMessage("checkVisible", 0, 3, 6, 9);
await window.sendMessage("checkVisible", 9, 6, 3, 0);
browser.mailTabs.setQuickFilter({
tags: { mode: "any", tags: { $label2: true } },
});
await window.sendMessage("checkVisible", 1, 3, 5, 7, 9);
await window.sendMessage("checkVisible", 8, 6, 4, 2, 0);
browser.mailTabs.setQuickFilter({
tags: { mode: "any", tags: { $label1: true, $label2: true } },
});
await window.sendMessage("checkVisible", 0, 1, 3, 5, 6, 7, 9);
await window.sendMessage("checkVisible", 9, 8, 6, 4, 3, 2, 0);
browser.mailTabs.setQuickFilter({
tags: { mode: "all", tags: { $label1: true, $label2: true } },
});
await window.sendMessage("checkVisible", 3, 9);
await window.sendMessage("checkVisible", 6, 0);
browser.mailTabs.setQuickFilter({
tags: { mode: "all", tags: { $label1: true, $label2: false } },
});
await window.sendMessage("checkVisible", 0, 6);
await window.sendMessage("checkVisible", 9, 3);
browser.mailTabs.setQuickFilter({ attachment: true });
await window.sendMessage("checkVisible", 9);
await window.sendMessage("checkVisible", 0);
browser.mailTabs.setQuickFilter({ attachment: false });
await window.sendMessage("checkVisible", 0, 1, 2, 3, 4, 5, 6, 7, 8);
await window.sendMessage("checkVisible", 9, 8, 7, 6, 5, 4, 3, 2, 1);
browser.mailTabs.setQuickFilter({ contact: true });
await window.sendMessage("checkVisible", 7);
await window.sendMessage("checkVisible", 2);
browser.mailTabs.setQuickFilter({ contact: false });
await window.sendMessage("checkVisible", 0, 1, 2, 3, 4, 5, 6, 8, 9);
await window.sendMessage("checkVisible", 9, 8, 7, 6, 5, 4, 3, 1, 0);
browser.test.notifyPass("quickFilter");
}

Просмотреть файл

@ -63,7 +63,7 @@ var MailMigrator = {
_migrateUI() {
// The code for this was ported from
// mozilla/browser/components/nsBrowserGlue.js
const UI_VERSION = 40;
const UI_VERSION = 41;
const MESSENGER_DOCURL = "chrome://messenger/content/messenger.xhtml";
const MESSENGERCOMPOSE_DOCURL =
"chrome://messenger/content/messengercompose/messengercompose.xhtml";
@ -711,6 +711,19 @@ var MailMigrator = {
}
}
if (currentUIVersion < 41) {
// Maintain the default ascending order for existing profiles if the
// user never changed it.
if (!Services.prefs.prefHasUserValue("mailnews.default_sort_order")) {
Services.prefs.setIntPref("mailnews.default_sort_order", 1);
}
if (
!Services.prefs.prefHasUserValue("mailnews.default_news_sort_order")
) {
Services.prefs.setIntPref("mailnews.default_news_sort_order", 1);
}
}
// Migration tasks that may take a long time are not run immediately, but
// added to the MigrationTasks object then run at the end.
//

Просмотреть файл

@ -6,6 +6,7 @@ prefs =
mailnews.start_page.override_url=about:blank
mailnews.start_page.url=about:blank
datareporting.policy.dataSubmissionPolicyBypassNotification=true
mailnews.default_sort_order=1
subsuite = thunderbird
support-files = data/**

Просмотреть файл

@ -309,7 +309,7 @@ add_task(function test_open_attachment() {
add_task(async function test_forward_raw_attachment() {
await be_in_folder(folder);
select_click_row(1);
select_click_row(-2);
let cwc = open_compose_with_forward();
check_attachment_size(cwc, 0, rawAttachment.length);
@ -320,7 +320,7 @@ add_task(async function test_forward_raw_attachment() {
add_task(async function test_forward_b64_attachment() {
await be_in_folder(folder);
select_click_row(2);
select_click_row(-3);
let cwc = open_compose_with_forward();
check_attachment_size(cwc, 0, b64Size);
@ -331,7 +331,7 @@ add_task(async function test_forward_b64_attachment() {
add_task(async function test_forward_message_as_attachment() {
await be_in_folder(folder);
let curMessage = select_click_row(0);
let curMessage = select_click_row(-1);
let cwc = open_compose_with_forward_as_attachments();
check_attachment_size(cwc, 0, curMessage.messageSize);
@ -342,7 +342,7 @@ add_task(async function test_forward_message_as_attachment() {
add_task(async function test_forward_message_with_attachments_as_attachment() {
await be_in_folder(folder);
let curMessage = select_click_row(1);
let curMessage = select_click_row(-2);
let cwc = open_compose_with_forward_as_attachments();
check_attachment_size(cwc, 0, curMessage.messageSize);

Просмотреть файл

@ -112,7 +112,7 @@ add_task(async function test_wrong_reply_charset() {
// Make the folder unthreaded for easier message selection.
make_display_unthreaded();
let msg = select_click_row(0);
let msg = select_click_row(-1);
assert_selected_and_displayed(mc, msg);
Assert.equal(getMsgHeaders(msg).get("").charset, "invalid-charset");
@ -124,12 +124,12 @@ add_task(async function test_wrong_reply_charset() {
);
close_compose_window(rwc);
let draftMsg = select_click_row(1);
let draftMsg = select_click_row(-2);
Assert.equal(getMsgHeaders(draftMsg).get("").charset, "UTF-8");
press_delete(mc); // Delete message
// Edit the original message. Charset should be UTF-8 now.
msg = select_click_row(0);
msg = select_click_row(-1);
// Wait for the notification with the Edit button.
wait_for_notification_to_show(
@ -154,7 +154,7 @@ add_task(async function test_wrong_reply_charset() {
rwc = wait_for_compose_window();
await save_compose_message(rwc.window);
close_compose_window(rwc);
msg = select_click_row(0);
msg = select_click_row(-1);
await TestUtils.waitForCondition(
() => getMsgHeaders(msg).get("").charset == "UTF-8",
"The charset matches"
@ -174,7 +174,7 @@ add_task(async function test_no_mojibake() {
});
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(0);
let msg = select_click_row(-1);
assert_selected_and_displayed(mc, msg);
await TestUtils.waitForCondition(
() => getMsgHeaders(msg).get("").charset == "utf-7",
@ -190,7 +190,7 @@ add_task(async function test_no_mojibake() {
);
close_compose_window(rwc);
let draftMsg = select_click_row(1);
let draftMsg = select_click_row(-2);
Assert.equal(getMsgHeaders(draftMsg).get("").charset.toUpperCase(), "UTF-8");
let text = getMsgHeaders(draftMsg, true).get("");
// Delete message first before throwing so subsequent tests are not affected.
@ -200,7 +200,7 @@ add_task(async function test_no_mojibake() {
}
// Edit the original message. Charset should be UTF-8 now.
msg = select_click_row(0);
msg = select_click_row(-1);
// Wait for the notification with the Edit button.
wait_for_notification_to_show(
@ -224,7 +224,7 @@ add_task(async function test_no_mojibake() {
rwc = wait_for_compose_window();
await save_compose_message(rwc.window);
close_compose_window(rwc);
msg = select_click_row(0);
msg = select_click_row(-1);
Assert.equal(getMsgHeaders(msg).get("").charset.toUpperCase(), "UTF-8");
Assert.equal(getMsgHeaders(msg, true).get("").trim(), nonASCII);
press_delete(mc); // Delete message

Просмотреть файл

@ -28,7 +28,6 @@ var {
);
var folder;
var i = 0;
var myEmail = "me@example.com";
var myEmail2 = "otherme@example.com";
@ -237,7 +236,7 @@ add_task(async function testReplyToMungedReplyToList() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -272,7 +271,7 @@ add_task(async function testToCcReply() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -308,7 +307,7 @@ add_task(async function testToCcReplyAll() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -370,7 +369,7 @@ add_task(async function testToCcReplyAllInternational() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -425,7 +424,7 @@ add_task(async function testToCcReplyWhenReplyToSet() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -466,7 +465,7 @@ add_task(async function testToCcReplyAllWhenReplyToSet() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -509,7 +508,7 @@ add_task(async function testReplyToList() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -549,7 +548,7 @@ add_task(async function testReplySenderForListPost() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -588,7 +587,7 @@ add_task(async function testReplyToAllForListPost() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -634,7 +633,7 @@ add_task(async function testReplyToListWhenReplyToSet() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -681,7 +680,7 @@ add_task(async function testMailReplyTo() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -725,7 +724,7 @@ add_task(async function testMailFollowupTo() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -766,7 +765,7 @@ add_task(async function testReplyToSelfReply() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -813,7 +812,7 @@ add_task(async function testReplyToSelfReplyAll() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -868,7 +867,7 @@ add_task(async function testReplyToSelfNotOriginalSourceMsgReplyAll() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity2);
@ -940,7 +939,7 @@ add_task(async function testReplyToOtherIdentity() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity2);
@ -975,7 +974,7 @@ add_task(async function testReplyToSelfWithBccs() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -1011,7 +1010,7 @@ add_task(async function testReplyToOtherIdentityWithBccs() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -1043,7 +1042,7 @@ add_task(async function testNewsgroupsReplyAll() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -1088,7 +1087,7 @@ add_task(async function testNewsgroupsReplyAllFollowupTo() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);
@ -1131,7 +1130,7 @@ add_task(async function testToFromWithReplyTo() {
await add_message_to_folder([folder], msg0);
await be_in_folder(folder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
ensureNoAutoCc(identity);

Просмотреть файл

@ -32,8 +32,6 @@ var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var i = 0;
var id1Domain = "example.com";
var id2Domain = "example.net";
var myIdentityEmail1 = "me@example.com";
@ -88,7 +86,7 @@ async function create_replyMsg(aTo, aEnvelopeTo) {
await add_message_to_folder([gFolder], msg0);
await be_in_folder(gFolder);
let msg = select_click_row(i++);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
}

Просмотреть файл

@ -258,7 +258,9 @@ async function assertSentMessage(composeWindow, expectMessage, msg) {
// Open the "sent" message.
await be_in_folder(outboxFolder);
// Should be the last message in the tree.
select_click_row(-1);
select_click_row(0);
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
await new Promise(resolve => setTimeout(resolve, 500));
// Test that the sent content type is either text/plain, text/html or
// multipart/alternative.

Просмотреть файл

@ -50,8 +50,8 @@ function testSetViewSingle() {
);
Assert.equal(
info.sortOrder,
Ci.nsMsgViewSortOrder.ascending,
"sortOrder should start ascending"
Ci.nsMsgViewSortOrder.descending,
"sortOrder should start descending"
);
let threadCol = window.getElementById("threadCol");
@ -70,8 +70,8 @@ function testSetViewSingle() {
EventUtils.synthesizeMouseAtCenter(subjectCol, { clickCount: 1 }, window);
TestUtils.waitForCondition(
() => info.sortOrder == Ci.nsMsgViewSortOrder.descending,
"should change sortOrder to sort descending"
() => info.sortOrder == Ci.nsMsgViewSortOrder.ascending,
"should change sortOrder to sort ascending"
);
}
@ -141,8 +141,8 @@ add_task(async function test_apply_to_folder_no_children() {
);
Assert.equal(
child1Info.sortOrder,
Ci.nsMsgViewSortOrder.ascending,
"sortOrder for child1 should start ascending"
Ci.nsMsgViewSortOrder.descending,
"sortOrder for child1 should start descending"
);
// Apply to the one dude
@ -198,8 +198,8 @@ add_task(async function test_apply_to_folder_and_children() {
);
Assert.equal(
child1Info.sortOrder,
Ci.nsMsgViewSortOrder.ascending,
"sortOrder for child1 should start ascending"
Ci.nsMsgViewSortOrder.descending,
"sortOrder for child1 should start descending"
);
// Apply to folder and children.

Просмотреть файл

@ -50,6 +50,9 @@ var folder,
requestLongerTimeout(AppConstants.MOZ_CODE_COVERAGE ? 4 : 2);
add_setup(async function () {
// Use an ascending order because this test relies on message arrays matching.
Services.prefs.setIntPref("mailnews.default_sort_order", 1);
folder = await create_folder("DeletionA");
lastMessageFolder = await create_folder("DeletionB");
oneBeforeFolder = await create_folder("DeletionC");
@ -87,6 +90,10 @@ add_setup(async function () {
[multipleDeletionFolder4],
[{ count: 10 }]
);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("mailnews.default_sort_order");
});
});
var tabFolder, tabMessage, tabMessageBackground, curMessage, nextMessage;

Просмотреть файл

@ -18,8 +18,6 @@ var {
create_folder,
create_message,
get_about_3pane,
mc,
select_click_row,
} = ChromeUtils.import(
"resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
);
@ -196,6 +194,9 @@ var contacts = [
];
add_setup(async function () {
// Use an ascending order because this test relies on message arrays matching.
Services.prefs.setIntPref("mailnews.default_sort_order", 1);
folder = await create_folder("DisplayNameA");
for (let message of messages) {
@ -212,6 +213,10 @@ add_setup(async function () {
}
await be_in_folder(folder);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("mailnews.default_sort_order");
});
});
async function check_display_name(index, columnName, expectedName) {

Просмотреть файл

@ -61,7 +61,7 @@ async function _help_test_message_size(index, unit) {
}
add_task(async function test_byte_message_size() {
await _help_test_message_size(0, 1);
await _help_test_message_size(2, 1);
});
add_task(async function test_kb_message_size() {
@ -69,7 +69,7 @@ add_task(async function test_kb_message_size() {
});
add_task(async function test_mb_message_size() {
await _help_test_message_size(2, 2);
await _help_test_message_size(0, 2);
Assert.report(
false,

Просмотреть файл

@ -33,6 +33,9 @@ var folder;
var thread1, thread2, thread3;
add_setup(async function () {
// Use an ascending order to simplify the test.
Services.prefs.setIntPref("mailnews.default_sort_order", 1);
document.getElementById("toolbar-menubar").removeAttribute("autohide");
folder = await create_folder("WatchIgnoreThreadTest");
thread1 = create_thread(3);
@ -45,6 +48,7 @@ add_setup(async function () {
expand_all_threads();
registerCleanupFunction(() => {
Services.prefs.clearUserPref("mailnews.default_sort_order");
document.getElementById("toolbar-menubar").autohide = true;
});
});

Просмотреть файл

@ -152,7 +152,7 @@ add_task(async function test_add_tag_with_really_long_label() {
await ensure_table_view();
// Select the first message, which will display it.
let curMessage = select_click_row(0);
let curMessage = select_click_row(-1);
assert_selected_and_displayed(mc, curMessage);
@ -444,7 +444,7 @@ add_task(async function enter_msg_hdr_toolbar() {
add_task(function test_more_button_with_many_recipients() {
// Start on the interesting message.
let curMessage = select_click_row(0);
let curMessage = select_click_row(-1);
// Make sure it loads.
wait_for_message_display_completion(mc);
@ -465,7 +465,7 @@ add_task(function test_more_button_with_many_recipients() {
);
// Switch to the boring message, to force the more button to collapse.
curMessage = select_click_row(1);
curMessage = select_click_row(-2);
// Make sure it loads.
wait_for_message_display_completion(mc);
@ -510,7 +510,7 @@ add_task(async function test_clicking_ab_button_opens_inline_contact_editor() {
let msg = create_message();
await add_message_to_folder([folder], msg);
// Open the latest message.
select_click_row(-1);
select_click_row(0);
wait_for_message_display_completion(mc);
// Ensure that the inline contact editing panel is not open
@ -560,7 +560,7 @@ add_task(async function test_msg_id_context_menu() {
await be_in_folder(folder);
// Open the latest message.
select_click_row(-1);
select_click_row(0);
// Right click to show the context menu.
EventUtils.synthesizeMouseAtCenter(
@ -616,7 +616,7 @@ add_task(
await be_in_folder(folder);
// Open the latest message.
select_click_row(-1);
select_click_row(0);
// Ensure that the inline contact editing panel is not open
let contactPanel = aboutMessage.document.getElementById("editContactPanel");
@ -772,7 +772,7 @@ add_task(async function test_that_msg_without_date_clears_previous_headers() {
// Not the first anymore. The timestamp is that of "NOW".
// Select and open the LAST message.
let curMessage = select_click_row(-1);
let curMessage = select_click_row(0);
// Make sure it loads.
wait_for_message_display_completion(mc);
@ -888,16 +888,16 @@ add_task(async function test_view_more_button() {
// Select and open the injected message.
// It is at the second last message in the display list.
let curMessage = select_click_row(-2);
let curMessage = select_click_row(1);
// FIXME: Switch between a couple of messages to allow the UI to properly
// refresh and fetch the proper recipients row width in order to avoid an
// unexpected recipients wrapping. This happens because the width calculation
// happens before the message header layout is fully generated.
let prevMessage = select_click_row(-3);
let prevMessage = select_click_row(2);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, prevMessage);
curMessage = select_click_row(-2);
curMessage = select_click_row(1);
// Make sure it loads.
wait_for_message_display_completion(mc);
@ -930,11 +930,11 @@ add_task(async function test_view_more_button_focus() {
{ focusMore: false, useKeyboard: false },
]) {
// Reload the message.
let prevMessage = select_click_row(-1);
let prevMessage = select_click_row(0);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, prevMessage);
let curMessage = select_click_row(-2);
let curMessage = select_click_row(1);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);
@ -1057,7 +1057,7 @@ add_task(async function test_show_all_header_mode() {
// Select and open the added message.
// It is at the second last position in the display list.
let curMessage = select_click_row(-2);
let curMessage = select_click_row(1);
// Make sure it loads.
wait_for_message_display_completion(mc);
@ -1082,7 +1082,7 @@ async function help_test_starred_messages() {
await be_in_folder(folder);
// Select the last message, which will display it.
let curMessage = select_click_row(-1);
let curMessage = select_click_row(0);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);
@ -1112,7 +1112,7 @@ async function help_test_starred_messages() {
Assert.ok(starButton.classList.contains("flagged"), "The message is starred");
// Select the first message.
curMessage = select_click_row(0);
curMessage = select_click_row(-1);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);
@ -1123,7 +1123,7 @@ async function help_test_starred_messages() {
);
// Select again the last message.
curMessage = select_click_row(-1);
curMessage = select_click_row(0);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);
@ -1179,7 +1179,7 @@ add_task(async function test_starred_message_unified_mode() {
add_task(async function test_folder_db_listener() {
await be_in_folder(folderMore);
// Select the last message, which will display it.
let curMessage = select_click_row(-1);
let curMessage = select_click_row(0);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);
@ -1210,7 +1210,7 @@ add_task(async function test_folder_db_listener() {
await be_in_folder(folder);
// Select the last message, which will display it.
curMessage = select_click_row(-1);
curMessage = select_click_row(0);
wait_for_message_display_completion(mc);
assert_selected_and_displayed(mc, curMessage);

Просмотреть файл

@ -151,10 +151,10 @@ add_task(async function test_ignore_phishing_warning_from_message() {
let aboutMessage = get_about_message();
await be_in_folder(folder);
select_click_row(0);
select_click_row(-1);
await assert_ignore_works(mc);
select_click_row(1);
select_click_row(-2);
// msg 1 is normal -> no phishing warning
assert_notification_displayed(
aboutMessage,
@ -162,7 +162,7 @@ add_task(async function test_ignore_phishing_warning_from_message() {
kNotificationValue,
false
);
select_click_row(0);
select_click_row(-1);
// msg 0 is a potential phishing attempt, but we ignored it so that should
// be remembered
assert_notification_displayed(
@ -224,7 +224,7 @@ add_task(async function test_ignore_phishing_warning_from_eml_attachment() {
*/
add_task(async function test_no_phishing_warning_for_ip_sameish_text() {
await be_in_folder(folder);
select_click_row(2); // Mail with Public IP address.
select_click_row(-3); // Mail with Public IP address.
click_link_if_available();
assert_notification_displayed(
get_about_message(),
@ -242,7 +242,7 @@ add_task(async function test_no_phishing_warning_for_ip_sameish_text() {
add_task(async function test_no_phishing_warning_for_subdomain() {
let aboutMessage = get_about_message();
await be_in_folder(folder);
select_click_row(3);
select_click_row(-4);
click_link_if_available();
assert_notification_displayed(
aboutMessage,
@ -251,7 +251,7 @@ add_task(async function test_no_phishing_warning_for_subdomain() {
false
); // not shown
select_click_row(4);
select_click_row(-5);
click_link_if_available();
assert_notification_displayed(
aboutMessage,
@ -267,7 +267,7 @@ add_task(async function test_no_phishing_warning_for_subdomain() {
*/
add_task(async function test_phishing_warning_for_local_domain() {
await be_in_folder(folder);
select_click_row(5);
select_click_row(-6);
let dialogAppeared = false;
@ -285,7 +285,7 @@ add_task(async function test_phishing_warning_for_local_domain() {
*/
add_task(async function test_phishing_warning_for_action_form() {
await be_in_folder(folder);
select_click_row(6);
select_click_row(0);
assert_notification_displayed(
get_about_message(),
kBoxId,

Просмотреть файл

@ -149,7 +149,7 @@ function checkReply(replyWin, expectedFromEmail) {
add_task(async function test_reply_no_matching_identity() {
await be_in_folder(testFolder);
let msg = select_click_row(0);
let msg = select_click_row(-1);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();
@ -161,7 +161,7 @@ add_task(async function test_reply_no_matching_identity() {
add_task(async function test_reply_matching_only_deliveredto() {
await be_in_folder(testFolder);
let msg = select_click_row(1);
let msg = select_click_row(-2);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();
@ -173,7 +173,7 @@ add_task(async function test_reply_matching_only_deliveredto() {
add_task(async function test_reply_matching_subaddress() {
await be_in_folder(testFolder);
let msg = select_click_row(2);
let msg = select_click_row(-3);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();
@ -186,7 +186,7 @@ add_task(async function test_reply_matching_subaddress() {
add_task(async function test_reply_to_matching_second_id() {
await be_in_folder(testFolder);
let msg = select_click_row(3);
let msg = select_click_row(-4);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();
@ -198,7 +198,7 @@ add_task(async function test_reply_to_matching_second_id() {
add_task(async function test_deliveredto_to_matching_only_parlty() {
await be_in_folder(testFolder);
let msg = select_click_row(4);
let msg = select_click_row(-5);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();
@ -214,7 +214,7 @@ add_task(async function test_deliveredto_to_matching_only_parlty() {
add_task(async function test_reply_to_self_second_id() {
await be_in_folder(testFolder);
let msg = select_click_row(5);
let msg = select_click_row(0);
assert_selected_and_displayed(mc, msg);
let replyWin = open_compose_with_reply();

Просмотреть файл

@ -133,8 +133,8 @@ function assert_mdn_text_contains(text, shouldContain) {
* and Return-Receipt-To isn't set.
*/
add_task(function test_no_mdn_for_normal_msgs() {
gotoMsg(0); // TODO this shouldn't be needed but the selection goes to 0 on focus.
gotoMsg(1); // This message doesn't request a return receipt.
gotoMsg(-1); // TODO this shouldn't be needed but the selection goes to 0 on focus.
gotoMsg(-2); // This message doesn't request a return receipt.
assert_mdn_shown(false);
});
@ -142,7 +142,7 @@ add_task(function test_no_mdn_for_normal_msgs() {
* Test that return receipts are shown when Disposition-Notification-To is set.
*/
add_task(function test_basic_mdn_shown() {
gotoMsg(0); // This message requests a return receipt.
gotoMsg(-1); // This message requests a return receipt.
assert_mdn_shown(true);
assert_mdn_text_contains("ake@example.com", false); // only name should show
});
@ -151,7 +151,7 @@ add_task(function test_basic_mdn_shown() {
* Test that return receipts are shown when Return-Receipt-To is set.
*/
add_task(function test_basic_mdn_shown_nonrfc() {
gotoMsg(4); // This message requests a return receipt.
gotoMsg(-5); // This message requests a return receipt.
assert_mdn_shown(true);
assert_mdn_text_contains("ake@example.com", false); // only name should show
});
@ -161,7 +161,7 @@ add_task(function test_basic_mdn_shown_nonrfc() {
* The RFC compliant version.
*/
add_task(function test_mdn_when_from_and_disposition_to_differs() {
gotoMsg(2); // Should display a notification with warning.
gotoMsg(-3); // Should display a notification with warning.
assert_mdn_shown(true);
assert_mdn_text_contains("other@example.com", true); // address should show
});
@ -171,7 +171,7 @@ add_task(function test_mdn_when_from_and_disposition_to_differs() {
* The RFC non-compliant version.
*/
add_task(function test_mdn_when_from_and_disposition_to_differs_nonrfc() {
gotoMsg(5); // Should display a notification with warning.
gotoMsg(-6); // Should display a notification with warning.
assert_mdn_shown(true);
assert_mdn_text_contains("other@example.com", true); // address should show
});
@ -181,7 +181,7 @@ add_task(function test_mdn_when_from_and_disposition_to_differs_nonrfc() {
* addresses.
*/
add_task(function test_mdn_when_disposition_to_multi() {
gotoMsg(3);
gotoMsg(-4);
// Should display a notification with warning listing all the addresses.
assert_mdn_shown(true);
assert_mdn_text_contains("ex1@example.com", true);
@ -193,7 +193,7 @@ add_task(function test_mdn_when_disposition_to_multi() {
* addresses. Non-RFC compliant version.
*/
add_task(function test_mdn_when_disposition_to_multi_nonrfc() {
gotoMsg(6);
gotoMsg(0);
// Should display a notification with warning listing all the addresses.
assert_mdn_shown(true);
assert_mdn_text_contains("ex1@example.com", true);

Просмотреть файл

@ -140,55 +140,55 @@ async function help_test_display_name(message, field, expectedValue) {
add_task(async function test_single_identity() {
ensure_no_card_exists(myEmail);
ensure_single_identity();
await help_test_display_name(0, "to", headertoFieldMe);
await help_test_display_name(-1, "to", headertoFieldMe);
await help_test_display_name(3, "to", `Customized <${myEmail}>`);
await help_test_display_name(0, "to", `Customized <${myEmail}>`);
});
add_task(async function test_single_identity_in_abook() {
ensure_card_exists(myEmail, "President Frankenstein", true);
ensure_single_identity();
await help_test_display_name(0, "to", "President Frankenstein");
await help_test_display_name(-1, "to", "President Frankenstein");
});
add_task(async function test_single_identity_in_abook_no_pdn() {
ensure_card_exists(myEmail, "President Frankenstein");
ensure_single_identity();
await help_test_display_name(0, "to", headertoFieldMe);
await help_test_display_name(-1, "to", headertoFieldMe);
});
add_task(async function test_multiple_identities() {
ensure_no_card_exists(myEmail);
ensure_multiple_identities();
await help_test_display_name(0, "to", myEmail);
await help_test_display_name(-1, "to", myEmail);
await help_test_display_name(3, "to", `Customized <${myEmail}>`);
await help_test_display_name(0, "to", `Customized <${myEmail}>`);
});
add_task(async function test_multiple_identities_in_abook() {
ensure_card_exists(myEmail, "President Frankenstein", true);
ensure_multiple_identities();
await help_test_display_name(0, "to", "President Frankenstein");
await help_test_display_name(-1, "to", "President Frankenstein");
});
add_task(async function test_multiple_identities_in_abook_no_pdn() {
ensure_card_exists(myEmail, "President Frankenstein");
ensure_multiple_identities();
await help_test_display_name(0, "to", myEmail);
await help_test_display_name(-1, "to", myEmail);
await help_test_display_name(3, "to", `Customized <${myEmail}>`);
await help_test_display_name(0, "to", `Customized <${myEmail}>`);
});
add_task(async function test_no_header_name() {
ensure_no_card_exists(friendEmail);
ensure_single_identity();
await help_test_display_name(1, "from", friendEmail);
await help_test_display_name(-2, "from", friendEmail);
});
add_task(async function test_no_header_name_in_abook() {
ensure_card_exists(friendEmail, "My Buddy", true);
ensure_single_identity();
await help_test_display_name(1, "from", "My Buddy");
await help_test_display_name(-2, "from", "My Buddy");
});
add_task(async function test_no_header_name_in_abook_no_pdn() {
@ -196,14 +196,14 @@ add_task(async function test_no_header_name_in_abook_no_pdn() {
ensure_single_identity();
// With address book entry but display name not preferred, we display name and
// e-mail address or only the e-mail address if no name exists.
await help_test_display_name(1, "from", "carl@sagan.invalid");
await help_test_display_name(-2, "from", "carl@sagan.invalid");
});
add_task(async function test_header_name() {
ensure_no_card_exists(friendEmail);
ensure_single_identity();
await help_test_display_name(
2,
-3,
"from",
friendName + " <" + friendEmail + ">"
);
@ -212,7 +212,7 @@ add_task(async function test_header_name() {
add_task(async function test_header_name_in_abook() {
ensure_card_exists(friendEmail, "My Buddy", true);
ensure_single_identity();
await help_test_display_name(2, "from", "My Buddy");
await help_test_display_name(-3, "from", "My Buddy");
});
add_task(async function test_header_name_in_abook_no_pdn() {
@ -220,5 +220,5 @@ add_task(async function test_header_name_in_abook_no_pdn() {
ensure_single_identity();
// With address book entry but display name not preferred, we display name and
// e-mail address.
await help_test_display_name(2, "from", "Carl Sagan <carl@sagan.invalid>");
await help_test_display_name(-3, "from", "Carl Sagan <carl@sagan.invalid>");
});

Просмотреть файл

@ -148,7 +148,7 @@ add_task(async function testSmimeOpenPgpSelection() {
await copyListener.promise;
// Select the second row, which should contain the S/MIME message.
select_click_row(1);
select_click_row(-2);
let aboutMessage = get_about_message();
Assert.equal(
@ -167,7 +167,7 @@ add_task(async function testSmimeOpenPgpSelection() {
"openpgpprocessed"
);
// Select the first row, which should contain the OpenPGP message.
select_click_row(0);
select_click_row(-1);
await openpgpprocessed;
Assert.equal(
@ -189,7 +189,7 @@ add_task(async function testSmimeOpenPgpSelection() {
// Delete the two generated messages.
press_delete();
select_click_row(0);
select_click_row(-1);
press_delete();
});
@ -219,7 +219,7 @@ add_task(async function testBrokenMSExchangeEncryption() {
await copyListener.promise;
// Select the first row, which should contain the OpenPGP message.
select_click_row(0);
select_click_row(-1);
// Assert the "corrupted by MS-Exchange" notification is visible.
let aboutMessage = get_about_message();
@ -288,7 +288,7 @@ add_task(async function testMessageSecurityShortcut() {
await copyListener.promise;
// Select the first row, which should contain the S/MIME message.
select_click_row(0);
select_click_row(-1);
let aboutMessage = get_about_message();
Assert.equal(
@ -315,7 +315,7 @@ add_task(async function testMessageSecurityShortcut() {
await popupshown;
// Select the row again since the focus moved to the popup panel.
select_click_row(0);
select_click_row(-1);
// Delete the message.
press_delete();
});

Просмотреть файл

@ -6,6 +6,7 @@ prefs =
mailnews.start_page.override_url=about:blank
mailnews.start_page.url=about:blank
datareporting.policy.dataSubmissionPolicyBypassNotification=true
mailnews.default_sort_order=1
subsuite = thunderbird
[browser_closing.js]

Просмотреть файл

@ -93,10 +93,10 @@ pref("mailnews.headers.extraAddonHeaders", "");
// as defined in nsIMsgDBView.idl (byDate = 18, byId = 21 etc.)
// for Mail/RSS/... (nsMsgDatabase)
pref("mailnews.default_sort_order", 1);
pref("mailnews.default_sort_order", 2);
pref("mailnews.default_sort_type", 18);
// for News (nsNewsDatabase)
pref("mailnews.default_news_sort_order", 1);
pref("mailnews.default_news_sort_order", 2);
pref("mailnews.default_news_sort_type", 21);
// hidden pref for whether "sort by date" and "sort by received date" in