Bug 1550674 - Turn on ESLint in mail/test/mozmill; r=aceman
--HG-- rename : mail/test/mozmill/shared-modules/test-quick-filter-bar-helper.js => mail/test/mozmill/shared-modules/test-quick-filter-bar-helpers.js rename : mail/test/mozmill/shared-modules/test-subscribe-window-helper.js => mail/test/mozmill/shared-modules/test-subscribe-window-helpers.js
This commit is contained in:
Родитель
d781777a8f
Коммит
c389444716
|
@ -78,7 +78,6 @@ mail/branding/thunderbird/thunderbird-branding.js
|
|||
mail/components/enterprisepolicies/schemas/schema.jsm
|
||||
mail/components/im/all-im.js
|
||||
mail/locales/en-US/all-l10n.js
|
||||
mail/test/mozmill/**
|
||||
|
||||
# calendar/ exclusions
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
globals: {
|
||||
__file__: true,
|
||||
collector: true,
|
||||
elementslib: true,
|
||||
mozmill: true,
|
||||
},
|
||||
rules: {
|
||||
"func-names": "off",
|
||||
},
|
||||
};
|
|
@ -4,11 +4,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-ab-whitelist";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-ab-whitelist";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers", "keyboard-helpers" ];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"account-manager-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
|
||||
var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
|
||||
|
@ -113,7 +121,7 @@ function subtest_check_whitelist_load_cleared(amc) {
|
|||
// out.
|
||||
throw Error("The whitelist preference for this server wasn't properly "
|
||||
+ "cleared.");
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
for (let i = 0; i < list.getRowCount(); i++) {
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-actions";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-actions";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
|
||||
|
||||
var imapAccount, nntpAccount, originalAccountCount;
|
||||
|
||||
|
@ -69,8 +71,7 @@ function teardownModule(module) {
|
|||
* should be enabled, false otherwise
|
||||
*/
|
||||
function subtest_check_account_actions(amc, aAccountKey, aIsSetAsDefaultEnabled,
|
||||
aIsRemoveEnabled, aIsAddAccountEnabled)
|
||||
{
|
||||
aIsRemoveEnabled, aIsAddAccountEnabled) {
|
||||
let accountRow = get_account_tree_row(aAccountKey, null, amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-deletion";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-deletion";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
|
||||
|
||||
var gPopAccount, gImapAccount, gNntpAccount, gOriginalAccountCount;
|
||||
|
||||
|
@ -72,8 +74,7 @@ function test_account_data_deletion() {
|
|||
*
|
||||
* @param amc The account options controller.
|
||||
*/
|
||||
function subtest_account_data_deletion1(amc)
|
||||
{
|
||||
function subtest_account_data_deletion1(amc) {
|
||||
let accountDir = gPopAccount.incomingServer.localPath;
|
||||
assert_true(accountDir.isDirectory());
|
||||
|
||||
|
@ -92,8 +93,7 @@ function subtest_account_data_deletion1(amc)
|
|||
*
|
||||
* @param amc The account options controller.
|
||||
*/
|
||||
function subtest_account_data_deletion2(amc)
|
||||
{
|
||||
function subtest_account_data_deletion2(amc) {
|
||||
let accountDir = gImapAccount.incomingServer.localPath;
|
||||
assert_true(accountDir.isDirectory());
|
||||
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-port-setting";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-port-setting";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers", "keyboard-helpers" ];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"account-manager-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
|
@ -17,7 +25,7 @@ var PORT_NUMBERS_TO_TEST =
|
|||
"110", // The original port number. We don't input this though.
|
||||
"456", // Random port number.
|
||||
"995", // The SSL port number.
|
||||
"110" // Back to the original.
|
||||
"110", // Back to the original.
|
||||
];
|
||||
|
||||
var gTestNumber;
|
||||
|
|
|
@ -12,11 +12,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-settings-infrastructure";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-settings-infrastructure";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
|
@ -85,8 +87,7 @@ function test_account_dot_IDs() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_account_dot_IDs(amc)
|
||||
{
|
||||
function subtest_check_account_dot_IDs(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -166,8 +167,7 @@ function test_account_locked_prefs() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_locked_prefs_addressing(amc)
|
||||
{
|
||||
function subtest_check_locked_prefs_addressing(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-addressing.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -234,8 +234,7 @@ function subtest_check_locked_prefs_addressing(amc)
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_locked_prefs_server(amc)
|
||||
{
|
||||
function subtest_check_locked_prefs_server(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -327,8 +326,7 @@ function test_replyTo_leak() {
|
|||
/**
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_replyTo_leak(amc)
|
||||
{
|
||||
function subtest_check_replyTo_leak(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -370,8 +368,7 @@ function test_account_onchange_handler() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_onchange_handler(amc)
|
||||
{
|
||||
function subtest_check_onchange_handler(amc) {
|
||||
let accountRow = get_account_tree_row(gImapAccount.key, "am-offline.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-tree";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-tree";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
|
||||
|
||||
var gPopAccount, gOriginalAccountCount;
|
||||
|
||||
|
@ -67,8 +69,7 @@ function test_account_open_state() {
|
|||
* @param amc The account options controller.
|
||||
* @param aWishedState The open state in which the account row should be found (bool).
|
||||
*/
|
||||
function subtest_check_account_open_state(amc, aWishedState)
|
||||
{
|
||||
function subtest_check_account_open_state(amc, aWishedState) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -106,8 +107,7 @@ function test_default_account_highlight() {
|
|||
*
|
||||
* @param amc The account options controller.
|
||||
*/
|
||||
function subtest_check_default_account_highlight(amc)
|
||||
{
|
||||
function subtest_check_default_account_highlight(amc) {
|
||||
// Select the default account.
|
||||
let accountRow = get_account_tree_row(MailServices.accounts.defaultAccount.key, null, amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
@ -151,8 +151,7 @@ function test_selection_after_account_deletion() {
|
|||
*
|
||||
* @param amc The account options controller.
|
||||
*/
|
||||
function subtest_check_selection_after_account_deletion(amc)
|
||||
{
|
||||
function subtest_check_selection_after_account_deletion(amc) {
|
||||
let accountList = [];
|
||||
let accountTreeNode = amc.e("account-tree-children");
|
||||
// Build the list of accounts in the account tree (order is important).
|
||||
|
|
|
@ -9,11 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-account-values";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-account-values";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers", "keyboard-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"account-manager-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
|
@ -67,8 +75,7 @@ function test_default_CC_address() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_default_CC_address(amc)
|
||||
{
|
||||
function subtest_check_default_CC_address(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-copies.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -184,8 +191,7 @@ function test_account_name() {
|
|||
* @param aNewUsername the username value to set
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_account_name(aAccount, aNewHostname, aNewUsername, amc)
|
||||
{
|
||||
function subtest_check_account_name(aAccount, aNewHostname, aNewUsername, amc) {
|
||||
let accountRow = get_account_tree_row(aAccount.key, "am-server.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -236,11 +242,7 @@ function test_invalid_junk_target() {
|
|||
});
|
||||
|
||||
// The pref has no default so its non-existence means it was cleared.
|
||||
try {
|
||||
moveOnSpam = branch.getBoolPref("moveOnSpam");
|
||||
} catch (e) {
|
||||
moveOnSpam = false;
|
||||
}
|
||||
moveOnSpam = branch.getBoolPref("moveOnSpam", false);
|
||||
assert_false(moveOnSpam);
|
||||
// The targets should point to the same pop account now.
|
||||
let targetAccount = branch.getCharPref("spamActionTargetAccount");
|
||||
|
@ -254,8 +256,7 @@ function test_invalid_junk_target() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_invalid_junk_target(amc)
|
||||
{
|
||||
function subtest_check_invalid_junk_target(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-junk.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -290,8 +291,7 @@ function test_invalid_hostname() {
|
|||
* @param aExitSettings Attempt to close the Account settings dialog.
|
||||
* @param aOriginalHostname Original hostname of this server.
|
||||
*/
|
||||
function subtest_check_invalid_hostname(amc, aExitSettings, aOriginalHostname)
|
||||
{
|
||||
function subtest_check_invalid_hostname(amc, aExitSettings, aOriginalHostname) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, "am-server.xul", amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
@ -348,8 +348,7 @@ function test_trailing_spaces() {
|
|||
*
|
||||
* @param amc the account options controller
|
||||
*/
|
||||
function subtest_check_trailing_spaces(amc)
|
||||
{
|
||||
function subtest_check_trailing_spaces(amc) {
|
||||
let accountRow = get_account_tree_row(gPopAccount.key, null, amc);
|
||||
click_account_tree_row(amc, accountRow);
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-archive-options";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-archive-options";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "account-manager-helpers"];
|
||||
|
||||
var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
|
||||
var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
|
||||
|
@ -173,4 +175,4 @@ function test_disable_archive() {
|
|||
}
|
||||
// Disable test on Windows since for some yet unknown reason clicking the checkbox
|
||||
// doesn't have the desired result. See bug 1461173 for details.
|
||||
test_disable_archive.EXCLUDED_PLATFORMS = ['winnt'];
|
||||
test_disable_archive.EXCLUDED_PLATFORMS = ["winnt"];
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-mail-account-setup-wizard";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-mail-account-setup-wizard";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"account-manager-helpers", "keyboard-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"account-manager-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
@ -58,7 +66,7 @@ function test_mail_account_setup() {
|
|||
// Force .com MIME-Type to text/xml
|
||||
collector.httpd.registerContentType("com", "text/xml");
|
||||
|
||||
open_mail_account_setup_wizard(function (awc) {
|
||||
open_mail_account_setup_wizard(function(awc) {
|
||||
// Input user's account information
|
||||
awc.click(awc.eid("realname"));
|
||||
if (awc.e("realname").value) {
|
||||
|
@ -99,21 +107,21 @@ function subtest_verify_account(amc) {
|
|||
|
||||
let config = {
|
||||
"incoming server username": {
|
||||
actual: incoming.username, expected: user.email.split("@")[0]
|
||||
actual: incoming.username, expected: user.email.split("@")[0],
|
||||
},
|
||||
"outgoing server username": {
|
||||
actual: outgoing.username, expected: user.email
|
||||
actual: outgoing.username, expected: user.email,
|
||||
},
|
||||
"incoming server hostname": {
|
||||
// Note: N in the hostName is uppercase
|
||||
actual: incoming.hostName, expected: user.incomingHost
|
||||
actual: incoming.hostName, expected: user.incomingHost,
|
||||
},
|
||||
"outgoing server hostname": {
|
||||
// And this is lowercase
|
||||
actual: outgoing.hostname, expected: user.outgoingHost
|
||||
actual: outgoing.hostname, expected: user.outgoingHost,
|
||||
},
|
||||
"user real name": { actual: identity.fullName, expected: user.name },
|
||||
"user email address": { actual: identity.email, expected: user.email }
|
||||
"user email address": { actual: identity.email, expected: user.email },
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -144,7 +152,7 @@ function test_bad_password_uses_old_settings() {
|
|||
collector.httpd.registerContentType("com", "text/xml");
|
||||
|
||||
mc.sleep(0);
|
||||
open_mail_account_setup_wizard(function (awc) {
|
||||
open_mail_account_setup_wizard(function(awc) {
|
||||
try {
|
||||
// Input user's account information
|
||||
awc.click(awc.eid("realname"));
|
||||
|
@ -161,14 +169,12 @@ function test_bad_password_uses_old_settings() {
|
|||
// Load the autoconfig file from http://localhost:433**/autoconfig/example.com
|
||||
awc.e("next_button").click();
|
||||
|
||||
let config = null;
|
||||
|
||||
awc.waitFor(function() { return this.disabled == false && this.hidden == false; },
|
||||
awc.waitFor(function() { return !this.disabled && !this.hidden; },
|
||||
"Timeout waiting for create button to be visible and active",
|
||||
8000, 600, awc.e("create_button"));
|
||||
awc.e("create_button").click();
|
||||
|
||||
awc.waitFor(function() { return this.disabled == false; },
|
||||
awc.waitFor(function() { return !this.disabled; },
|
||||
"Timeout waiting for create button to be visible and active",
|
||||
8000, 600, awc.e("create_button"));
|
||||
awc.e("create_button").click();
|
||||
|
@ -206,7 +212,7 @@ function remember_password_test(aPrefValue) {
|
|||
|
||||
// without this, it breaks the test, don't know why
|
||||
mc.sleep(0);
|
||||
open_mail_account_setup_wizard(function (awc) {
|
||||
open_mail_account_setup_wizard(function(awc) {
|
||||
try {
|
||||
let password = new elementslib.ID(awc.window.document, "password");
|
||||
let rememberPassword =
|
||||
|
@ -219,8 +225,7 @@ function remember_password_test(aPrefValue) {
|
|||
awc.assertProperty(rememberPassword, "disabled", !aPrefValue);
|
||||
if (aPrefValue) {
|
||||
awc.assertChecked(rememberPassword);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
awc.assertNotChecked(rememberPassword);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-retest-config";
|
||||
/* import-globals-from ../shared-modules/test-account-manager-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-retest-config";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"keyboard-helpers", "account-manager-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"keyboard-helpers",
|
||||
"account-manager-helpers",
|
||||
];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -16,7 +24,7 @@ var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
var user = {
|
||||
name: "test",
|
||||
email: "test@momo.invalid",
|
||||
altEmail: "test2@momo.invalid"
|
||||
altEmail: "test2@momo.invalid",
|
||||
};
|
||||
|
||||
function setupModule(module) {
|
||||
|
@ -39,7 +47,7 @@ function test_re_test_config() {
|
|||
// Opening multiple windows in the same run seems to require letting the stack
|
||||
// unwind before opening the next one, so do that here.
|
||||
mc.sleep(0);
|
||||
open_mail_account_setup_wizard(function (awc) {
|
||||
open_mail_account_setup_wizard(function(awc) {
|
||||
// Input user's account information
|
||||
awc.click(awc.eid("realname"));
|
||||
if (awc.e("realname").value) {
|
||||
|
@ -54,7 +62,7 @@ function test_re_test_config() {
|
|||
awc.e("next_button").click();
|
||||
|
||||
// Wait for 'edit' button to be enabled
|
||||
awc.waitFor(function() { return this.disabled == false && this.hidden == false; },
|
||||
awc.waitFor(function() { return !this.disabled && !this.hidden; },
|
||||
"Timeout waiting for edit button to be enabled",
|
||||
8000, 600, awc.e("create_button"));
|
||||
|
||||
|
@ -63,7 +71,7 @@ function test_re_test_config() {
|
|||
// Click "re-test" button
|
||||
awc.e("half-manual-test_button").click();
|
||||
|
||||
awc.waitFor(function () { return this.disabled == false; },
|
||||
awc.waitFor(function() { return !this.disabled; },
|
||||
"Timeout waiting for re-test button to be enabled",
|
||||
20000, 600, awc.e("half-manual-test_button"));
|
||||
|
||||
|
@ -76,7 +84,7 @@ function test_re_test_config() {
|
|||
|
||||
// Wait for the "continue" button to be back, which means we're back to the
|
||||
// original state.
|
||||
awc.waitFor(function() { return this.hidden == false; },
|
||||
awc.waitFor(function() { return !this.hidden; },
|
||||
"Timeout waiting for continue button to be visible",
|
||||
20000, 600, awc.e("next_button"));
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-address-book-panes";
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-address-book-panes";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
|
||||
|
||||
|
@ -61,7 +63,6 @@ function _help_assert_pane_visibility(paneId, menuitemId, visible) {
|
|||
if ((abController.e(menuitemId).getAttribute("checked") == "true") != visible)
|
||||
throw new Error(menuitemId + " menuitem should be " +
|
||||
(visible ? "checked" : "unchecked"));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,12 +8,21 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-address-book';
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-prompt-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers",
|
||||
'compose-helpers', 'window-helpers',
|
||||
'prompt-helpers'];
|
||||
var MODULE_NAME = "test-address-book";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"address-book-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"prompt-helpers",
|
||||
];
|
||||
|
||||
var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -23,8 +32,7 @@ var abController = null;
|
|||
var addrBook1, addrBook2, addrBook3, addrBook4, ldapBook;
|
||||
var mListA, mListB, mListC, mListD, mListE;
|
||||
|
||||
function setupModule(module)
|
||||
{
|
||||
function setupModule(module) {
|
||||
for (let lib of MODULE_REQUIRES) {
|
||||
collector.getModule(lib).installInto(module);
|
||||
}
|
||||
|
@ -88,15 +96,13 @@ function setupModule(module)
|
|||
* LDAP Book
|
||||
* Collected Address Book
|
||||
**/
|
||||
function test_order_of_address_books()
|
||||
{
|
||||
function test_order_of_address_books() {
|
||||
const EXPECTED_AB_ORDER = ["All Address Books",
|
||||
"Personal Address Book", "AB 1", "AB 2",
|
||||
"AB 3", "AB 4", "LDAP Book",
|
||||
"Collected Addresses"];
|
||||
|
||||
for (let i = 0; i < EXPECTED_AB_ORDER.length; i++)
|
||||
{
|
||||
for (let i = 0; i < EXPECTED_AB_ORDER.length; i++) {
|
||||
let abName = get_name_of_address_book_element_at(i);
|
||||
assert_equals(abName, EXPECTED_AB_ORDER[i],
|
||||
"The address books are out of order.");
|
||||
|
@ -107,13 +113,12 @@ function test_order_of_address_books()
|
|||
* in the tree persist state when closing and re-opening the
|
||||
* address book manager
|
||||
*/
|
||||
function test_persist_collapsed_and_expanded_states()
|
||||
{
|
||||
function test_persist_collapsed_and_expanded_states() {
|
||||
// Set the state of address books 1 and 3 to expanded
|
||||
set_address_books_expanded([addrBook1, addrBook3]);
|
||||
|
||||
// Set address book 2 to be collapsed
|
||||
set_address_book_collapsed(addrBook2);
|
||||
set_address_books_collapsed(addrBook2);
|
||||
|
||||
// Now close and re-open the address book
|
||||
close_address_book_window(abController);
|
||||
|
@ -126,7 +131,7 @@ function test_persist_collapsed_and_expanded_states()
|
|||
// Now set the state of address books 1 and 3 to collapsed
|
||||
// and make sure 2 is expanded
|
||||
set_address_books_collapsed([addrBook1, addrBook3]);
|
||||
set_address_book_expanded(addrBook2);
|
||||
set_address_books_expanded(addrBook2);
|
||||
|
||||
// Now close and re-open the address book
|
||||
close_address_book_window(abController);
|
||||
|
@ -140,8 +145,7 @@ function test_persist_collapsed_and_expanded_states()
|
|||
/* Test that if we try to delete a contact, that we are given
|
||||
* a confirm prompt.
|
||||
*/
|
||||
function test_deleting_contact_causes_confirm_prompt()
|
||||
{
|
||||
function test_deleting_contact_causes_confirm_prompt() {
|
||||
// Register the Mock Prompt Service
|
||||
gMockPromptService.register();
|
||||
|
||||
|
@ -150,7 +154,7 @@ function test_deleting_contact_causes_confirm_prompt()
|
|||
let toDelete = [contact1];
|
||||
|
||||
let bundle = Services.strings
|
||||
.createBundle("chrome://messenger/locale/addressbook/addressBook.properties")
|
||||
.createBundle("chrome://messenger/locale/addressbook/addressBook.properties");
|
||||
let confirmSingle = bundle.GetStringFromName("confirmDeleteThisContact");
|
||||
confirmSingle = confirmSingle.replace("#1", "Sammy Jenkis");
|
||||
|
||||
|
@ -165,7 +169,7 @@ function test_deleting_contact_causes_confirm_prompt()
|
|||
gMockPromptService.returnValue = false;
|
||||
|
||||
// Now attempt to delete the contact
|
||||
select_contact(toDelete);
|
||||
select_contacts(toDelete);
|
||||
abController.keypress(null, "VK_DELETE", {});
|
||||
|
||||
let promptState = gMockPromptService.promptState;
|
||||
|
@ -182,7 +186,7 @@ function test_deleting_contact_causes_confirm_prompt()
|
|||
// Now we'll return true on confirm so that
|
||||
// the contact is deleted.
|
||||
gMockPromptService.returnValue = true;
|
||||
select_contact(toDelete);
|
||||
select_contacts(toDelete);
|
||||
abController.keypress(null, "VK_DELETE", {});
|
||||
|
||||
promptState = gMockPromptService.promptState;
|
||||
|
@ -201,8 +205,7 @@ function test_deleting_contact_causes_confirm_prompt()
|
|||
/* Test that if we try to delete multiple contacts, that we are give
|
||||
* a confirm prompt.
|
||||
*/
|
||||
function test_deleting_contacts_causes_confirm_prompt()
|
||||
{
|
||||
function test_deleting_contacts_causes_confirm_prompt() {
|
||||
// Register the Mock Prompt Service
|
||||
gMockPromptService.register();
|
||||
|
||||
|
@ -214,7 +217,7 @@ function test_deleting_contacts_causes_confirm_prompt()
|
|||
let toDelete = [contact2, contact3, contact4];
|
||||
|
||||
let bundle = Services.strings
|
||||
.createBundle("chrome://messenger/locale/addressbook/addressBook.properties")
|
||||
.createBundle("chrome://messenger/locale/addressbook/addressBook.properties");
|
||||
let confirmMultiple = bundle.GetStringFromName("confirmDelete2orMoreContacts");
|
||||
confirmMultiple = confirmMultiple.replace(/.*;/, "").replace("#1", "3");
|
||||
|
||||
|
@ -274,7 +277,6 @@ function test_deleting_mailing_lists() {
|
|||
// address books
|
||||
let newList = create_mailing_list("Delete Me!");
|
||||
let addedList = addrBook1.addMailList(newList);
|
||||
let mlURI = addedList.URI;
|
||||
|
||||
// Make sure it got added.
|
||||
assert_true(addrBook1.hasDirectory(addedList));
|
||||
|
@ -316,23 +318,20 @@ function test_deleting_mailing_lists() {
|
|||
* mailing list in the tree, and clicking "Write"
|
||||
*/
|
||||
function test_writing_to_mailing_list() {
|
||||
|
||||
// Create a new mailing list, and add it to one of our
|
||||
// address books
|
||||
let newList = create_mailing_list("Some Mailing List");
|
||||
let addedList = addrBook1.addMailList(newList);
|
||||
let mlURI = addedList.URI;
|
||||
|
||||
// Create some contacts that we'll try to contact
|
||||
let contacts = [create_contact("test2@example.com", "Leonard Shelby", true),
|
||||
create_contact("test3@example.com", "John Edward Gammell",
|
||||
true),
|
||||
create_contact("test4@example.com", "Natalie", true),];
|
||||
create_contact("test3@example.com", "John Edward Gammell", true),
|
||||
create_contact("test4@example.com", "Natalie", true)];
|
||||
|
||||
load_contacts_into_mailing_list(addedList, contacts);
|
||||
|
||||
// Ensure that addrBook1 is expanded
|
||||
set_address_book_expanded(addrBook1);
|
||||
set_address_books_expanded(addrBook1);
|
||||
|
||||
// Now select the mailing list in the tree...
|
||||
select_address_book(addedList);
|
||||
|
|
|
@ -9,17 +9,18 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-update-mailing-list';
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['address-book-helpers',
|
||||
'folder-display-helpers',];
|
||||
var MODULE_NAME = "test-update-mailing-list";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["address-book-helpers", "folder-display-helpers"];
|
||||
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
||||
function setupModule(module) {
|
||||
collector.getModule('folder-display-helpers').installInto(module);
|
||||
collector.getModule('address-book-helpers').installInto(module);
|
||||
collector.getModule("folder-display-helpers").installInto(module);
|
||||
collector.getModule("address-book-helpers").installInto(module);
|
||||
}
|
||||
|
||||
function test_contact_in_mailing_list_updated() {
|
||||
|
@ -43,7 +44,7 @@ function test_contact_in_mailing_list_updated() {
|
|||
// Open the address book, select our contact...
|
||||
let abw = open_address_book_window(mc);
|
||||
select_address_book(ab);
|
||||
select_contact(contact);
|
||||
select_contacts(contact);
|
||||
|
||||
// Change the primary email address of the contact...
|
||||
edit_selected_contact(abw, function(ecw) {
|
||||
|
|
|
@ -8,15 +8,23 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-attachment-events';
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-observer-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-prompt-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers',
|
||||
'compose-helpers',
|
||||
'window-helpers',
|
||||
'attachment-helpers',
|
||||
'observer-helpers',
|
||||
'prompt-helpers'];
|
||||
var MODULE_NAME = "test-attachment-events";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"attachment-helpers",
|
||||
"observer-helpers",
|
||||
"prompt-helpers",
|
||||
];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
|
||||
|
@ -48,14 +56,14 @@ function test_attachments_added_on_single() {
|
|||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Open up the compose window
|
||||
let cw = open_compose_new_mail(mc);
|
||||
cw.e("attachmentBucket").addEventListener(kAttachmentsAdded, listener);
|
||||
|
||||
// Attach a single file
|
||||
add_attachment(cw, "http://www.example.com/1", 0, false);
|
||||
add_attachments(cw, "http://www.example.com/1", 0, false);
|
||||
|
||||
// Make sure we only saw the event once
|
||||
assert_equals(1, eventCount);
|
||||
|
@ -68,7 +76,7 @@ function test_attachments_added_on_single() {
|
|||
|
||||
// Make sure that we can get that event again if we
|
||||
// attach more files.
|
||||
add_attachment(cw, "http://www.example.com/2", 0, false);
|
||||
add_attachments(cw, "http://www.example.com/2", 0, false);
|
||||
assert_equals(2, eventCount);
|
||||
subjects = lastEvent.detail;
|
||||
assert_true(subjects instanceof Ci.nsIMutableArray);
|
||||
|
@ -77,7 +85,7 @@ function test_attachments_added_on_single() {
|
|||
|
||||
// And check that we don't receive the event if we try to attach a file
|
||||
// that's already attached.
|
||||
add_attachment(cw, "http://www.example.com/2", null, false);
|
||||
add_attachments(cw, "http://www.example.com/2", null, false);
|
||||
assert_equals(2, eventCount);
|
||||
|
||||
cw.e("attachmentBucket").removeEventListener(kAttachmentsAdded, listener);
|
||||
|
@ -95,7 +103,7 @@ function test_attachments_added_on_multiple() {
|
|||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Prepare the attachments - we store the names in attachmentNames to
|
||||
// make sure that we observed the right event subjects later on.
|
||||
|
@ -166,20 +174,19 @@ function test_attachments_removed_on_single() {
|
|||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Open up the compose window, attach a file...
|
||||
let cw = open_compose_new_mail(mc);
|
||||
cw.e("attachmentBucket").addEventListener(kAttachmentsRemoved, listener);
|
||||
|
||||
add_attachment(cw, "http://www.example.com/1");
|
||||
add_attachments(cw, "http://www.example.com/1");
|
||||
|
||||
// Now select that attachment and delete it
|
||||
let removedAttachmentItem = select_attachments(cw, 0);
|
||||
select_attachments(cw, 0);
|
||||
// We need to hold a reference to removedAttachment here because
|
||||
// the delete routine nulls it out from the attachmentitem.
|
||||
let removedAttachment = removedAttachmentItem[0].attachment;
|
||||
cw.window.goDoCommand("cmd_delete");
|
||||
// Make sure we saw the event
|
||||
assert_equals(1, eventCount);
|
||||
|
@ -193,9 +200,8 @@ function test_attachments_removed_on_single() {
|
|||
|
||||
// Ok, let's attach it again, and remove it again to ensure that
|
||||
// we still see the event.
|
||||
add_attachment(cw, "http://www.example.com/2");
|
||||
removedAttachmentItem = select_attachments(cw, 0);
|
||||
removedAttachment = removedAttachmentItem[0].attachment;
|
||||
add_attachments(cw, "http://www.example.com/2");
|
||||
select_attachments(cw, 0);
|
||||
cw.window.goDoCommand("cmd_delete");
|
||||
|
||||
assert_equals(2, eventCount);
|
||||
|
@ -220,7 +226,7 @@ function test_attachments_removed_on_multiple() {
|
|||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Open up the compose window and attach some files...
|
||||
let cw = open_compose_new_mail(mc);
|
||||
|
@ -271,11 +277,9 @@ function test_attachments_removed_on_multiple() {
|
|||
function test_no_attachments_removed_on_none() {
|
||||
// Prepare to listen for attachments-removed
|
||||
let eventCount = 0;
|
||||
let lastEvent;
|
||||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Open the compose window and add some attachments.
|
||||
let cw = open_compose_new_mail(mc);
|
||||
|
@ -312,7 +316,7 @@ function test_attachment_renamed() {
|
|||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Renaming a file brings up a Prompt, so we'll mock the Prompt Service
|
||||
gMockPromptService.reset();
|
||||
|
@ -392,11 +396,9 @@ function test_attachment_renamed() {
|
|||
function test_no_attachment_renamed_on_blank() {
|
||||
// Prepare to listen for attachment-renamed
|
||||
let eventCount = 0;
|
||||
let lastEvent;
|
||||
let listener = function(event) {
|
||||
eventCount++;
|
||||
lastEvent = event;
|
||||
}
|
||||
};
|
||||
|
||||
// Register the Mock Prompt Service to return the empty string when
|
||||
// prompted.
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
* 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/. */
|
||||
|
||||
// make SOLO_TEST=attachment/test-attachment-in-plain-msg.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-attachment-in-plain-msg";
|
||||
/* import-globals-from ../shared-modules/test-dom-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-attachment-in-plain-msg";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"dom-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "dom-helpers"];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-attachment-menus";
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-attachment-menus";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"attachment-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "attachment-helpers"];
|
||||
|
||||
var folder;
|
||||
var messenger;
|
||||
|
@ -296,25 +298,22 @@ function check_toolbar_menu_states_single(expected) {
|
|||
assert_shown("attachmentSaveAllSingle", true);
|
||||
assert_shown("attachmentSaveAllMultiple", false);
|
||||
|
||||
if (expected.save == false) {
|
||||
if (expected.save === false) {
|
||||
assert_enabled("attachmentSaveAllSingle", false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
assert_enabled("attachmentSaveAllSingle", true);
|
||||
mc.click(mc.aid("attachmentSaveAllSingle",
|
||||
{"class": "toolbarbutton-menubutton-dropmarker"}));
|
||||
wait_for_popup_to_open(mc.e("attachmentSaveAllSingleMenu"));
|
||||
|
||||
try {
|
||||
assert_enabled("button-openAttachment", expected.open);
|
||||
assert_enabled("button-saveAttachment", expected.save);
|
||||
assert_enabled("button-openAttachment", expected.open);
|
||||
assert_enabled("button-saveAttachment", expected.save);
|
||||
assert_enabled("button-detachAttachment", expected.detach);
|
||||
assert_enabled("button-deleteAttachment", expected.delete_);
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
close_popup(mc, mc.eid("attachmentSaveAllSingleMenu"));
|
||||
}
|
||||
}
|
||||
|
@ -329,25 +328,22 @@ function check_toolbar_menu_states_multiple(expected) {
|
|||
assert_shown("attachmentSaveAllSingle", false);
|
||||
assert_shown("attachmentSaveAllMultiple", true);
|
||||
|
||||
if (expected.save == false) {
|
||||
if (expected.save === false) {
|
||||
assert_enabled("attachmentSaveAllMultiple", false);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
assert_enabled("attachmentSaveAllMultiple", true);
|
||||
mc.click(mc.aid("attachmentSaveAllMultiple",
|
||||
{"class": "toolbarbutton-menubutton-dropmarker"}));
|
||||
wait_for_popup_to_open(mc.e("attachmentSaveAllMultipleMenu"));
|
||||
|
||||
try {
|
||||
assert_enabled("button-openAllAttachments", expected.open);
|
||||
assert_enabled("button-saveAllAttachments", expected.save);
|
||||
assert_enabled("button-openAllAttachments", expected.open);
|
||||
assert_enabled("button-saveAllAttachments", expected.save);
|
||||
assert_enabled("button-detachAllAttachments", expected.detach);
|
||||
assert_enabled("button-deleteAllAttachments", expected.delete_);
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
close_popup(mc, mc.eid("attachmentSaveAllMultipleMenu"));
|
||||
}
|
||||
}
|
||||
|
@ -377,21 +373,19 @@ function check_menu_states_single(index, expected) {
|
|||
wait_for_popup_to_open(mc.e("attachmentItemContext"));
|
||||
|
||||
try {
|
||||
assert_shown("context-openAttachment", true);
|
||||
assert_shown("context-saveAttachment", true);
|
||||
assert_shown("context-menu-separator", true);
|
||||
assert_shown("context-openAttachment", true);
|
||||
assert_shown("context-saveAttachment", true);
|
||||
assert_shown("context-menu-separator", true);
|
||||
assert_shown("context-detachAttachment", true);
|
||||
assert_shown("context-deleteAttachment", true);
|
||||
|
||||
assert_enabled("context-openAttachment", expected.open);
|
||||
assert_enabled("context-saveAttachment", expected.save);
|
||||
assert_enabled("context-openAttachment", expected.open);
|
||||
assert_enabled("context-saveAttachment", expected.save);
|
||||
assert_enabled("context-detachAttachment", expected.detach);
|
||||
assert_enabled("context-deleteAttachment", expected.delete_);
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
menu.close();
|
||||
}
|
||||
}
|
||||
|
@ -409,28 +403,26 @@ function check_menu_states_all(expected) {
|
|||
wait_for_popup_to_open(mc.e("attachmentListContext"));
|
||||
|
||||
try {
|
||||
assert_shown("context-openAllAttachments", true);
|
||||
assert_shown("context-saveAllAttachments", true);
|
||||
assert_shown("context-menu-separator-all", true);
|
||||
assert_shown("context-openAllAttachments", true);
|
||||
assert_shown("context-saveAllAttachments", true);
|
||||
assert_shown("context-menu-separator-all", true);
|
||||
assert_shown("context-detachAllAttachments", true);
|
||||
assert_shown("context-deleteAllAttachments", true);
|
||||
|
||||
assert_enabled("context-openAllAttachments", expected.open);
|
||||
assert_enabled("context-saveAllAttachments", expected.save);
|
||||
assert_enabled("context-openAllAttachments", expected.open);
|
||||
assert_enabled("context-saveAllAttachments", expected.save);
|
||||
assert_enabled("context-detachAllAttachments", expected.detach);
|
||||
assert_enabled("context-deleteAllAttachments", expected.delete_);
|
||||
}
|
||||
catch(e) {
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
close_popup(mc, mc.eid("attachmentListContext"));
|
||||
}
|
||||
}
|
||||
|
||||
function help_test_attachment_menus(index) {
|
||||
be_in_folder(folder);
|
||||
let curMessage = select_click_row(index);
|
||||
select_click_row(index);
|
||||
let expectedStates = messages[index].menuStates;
|
||||
|
||||
mc.window.toggleAttachmentList(true);
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-attachment-size';
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
|
||||
'attachment-helpers'];
|
||||
var MODULE_NAME = "test-attachment-size";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "attachment-helpers"];
|
||||
|
||||
var folder;
|
||||
var messenger;
|
||||
|
@ -26,70 +28,70 @@ var textAttachment =
|
|||
var binaryAttachment = textAttachment;
|
||||
|
||||
var imageAttachment =
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS' +
|
||||
'FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA' +
|
||||
'A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe' +
|
||||
'SNQAAlmAY+71EgFoAAAAASUVORK5CYII=';
|
||||
"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS" +
|
||||
"FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA" +
|
||||
"A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe" +
|
||||
"SNQAAlmAY+71EgFoAAAAASUVORK5CYII=";
|
||||
var imageSize = 188;
|
||||
|
||||
var vcardAttachment =
|
||||
'YmVnaW46dmNhcmQNCmZuOkppbSBCb2INCm46Qm9iO0ppbQ0KZW1haWw7aW50ZXJuZXQ6Zm9v' +
|
||||
'QGJhci5jb20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K';
|
||||
"YmVnaW46dmNhcmQNCmZuOkppbSBCb2INCm46Qm9iO0ppbQ0KZW1haWw7aW50ZXJuZXQ6Zm9v" +
|
||||
"QGJhci5jb20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K";
|
||||
|
||||
var detachedName = './attachment.txt';
|
||||
var missingName = './nonexistent.txt';
|
||||
var deletedName = 'deleted.txt';
|
||||
var detachedName = "./attachment.txt";
|
||||
var missingName = "./nonexistent.txt";
|
||||
var deletedName = "deleted.txt";
|
||||
|
||||
// create some messages that have various types of attachments
|
||||
var messages = [
|
||||
{ name: 'text_attachment',
|
||||
{ name: "text_attachment",
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
attachmentSizes: [textAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length, exact: true },
|
||||
},
|
||||
{ name: 'binary_attachment',
|
||||
{ name: "binary_attachment",
|
||||
attachments: [{ body: binaryAttachment,
|
||||
contentType: 'application/x-ubik',
|
||||
filename: 'ubik',
|
||||
format: '' }],
|
||||
contentType: "application/x-ubik",
|
||||
filename: "ubik",
|
||||
format: "" }],
|
||||
attachmentSizes: [binaryAttachment.length],
|
||||
attachmentTotalSize: { size: binaryAttachment.length, exact: true },
|
||||
},
|
||||
{ name: 'image_attachment',
|
||||
{ name: "image_attachment",
|
||||
attachments: [{ body: imageAttachment,
|
||||
contentType: 'image/png',
|
||||
filename: 'lines.png',
|
||||
encoding: 'base64',
|
||||
format: '' }],
|
||||
contentType: "image/png",
|
||||
filename: "lines.png",
|
||||
encoding: "base64",
|
||||
format: "" }],
|
||||
attachmentSizes: [imageSize],
|
||||
attachmentTotalSize: { size: imageSize, exact: true },
|
||||
},
|
||||
{ name: 'detached_attachment',
|
||||
{ name: "detached_attachment",
|
||||
bodyPart: null,
|
||||
// Sizes filled in on message creation.
|
||||
attachmentSizes: [null],
|
||||
attachmentTotalSize: { size: 0, exact: true },
|
||||
},
|
||||
{ name: 'detached_attachment_with_missing_file',
|
||||
{ name: "detached_attachment_with_missing_file",
|
||||
bodyPart: null,
|
||||
attachmentSizes: [-1],
|
||||
attachmentTotalSize: { size: 0, exact: false },
|
||||
},
|
||||
{ name: 'deleted_attachment',
|
||||
{ name: "deleted_attachment",
|
||||
bodyPart: null,
|
||||
attachmentSizes: [-1],
|
||||
attachmentTotalSize: { size: 0, exact: true },
|
||||
},
|
||||
{ name: 'multiple_attachments',
|
||||
{ name: "multiple_attachments",
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' },
|
||||
filename: "ubik.txt",
|
||||
format: "" },
|
||||
{ body: binaryAttachment,
|
||||
contentType: 'application/x-ubik',
|
||||
filename: 'ubik',
|
||||
format: '' }],
|
||||
contentType: "application/x-ubik",
|
||||
filename: "ubik",
|
||||
format: "" }],
|
||||
attachmentSizes: [textAttachment.length, binaryAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length +
|
||||
binaryAttachment.length,
|
||||
|
@ -97,46 +99,46 @@ var messages = [
|
|||
},
|
||||
// vCards should be ignored in the attachment list; make sure we do so
|
||||
// properly.
|
||||
{ name: 'multiple_attachments_one_vcard',
|
||||
{ name: "multiple_attachments_one_vcard",
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' },
|
||||
filename: "ubik.txt",
|
||||
format: "" },
|
||||
{ body: vcardAttachment,
|
||||
contentType: 'text/x-vcard',
|
||||
filename: 'ubik.vcf',
|
||||
encoding: 'base64',
|
||||
format: '' }],
|
||||
contentType: "text/x-vcard",
|
||||
filename: "ubik.vcf",
|
||||
encoding: "base64",
|
||||
format: "" }],
|
||||
attachmentSizes: [textAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length,
|
||||
exact: true },
|
||||
},
|
||||
{ name: 'multiple_attachments_one_detached',
|
||||
{ name: "multiple_attachments_one_detached",
|
||||
bodyPart: null,
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
attachmentSizes: [null, textAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length, exact: true },
|
||||
},
|
||||
{ name: 'multiple_attachments_one_detached_with_missing_file',
|
||||
{ name: "multiple_attachments_one_detached_with_missing_file",
|
||||
bodyPart: null,
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
attachmentSizes: [-1, textAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length, exact: false },
|
||||
},
|
||||
{ name: 'multiple_attachments_one_deleted',
|
||||
{ name: "multiple_attachments_one_deleted",
|
||||
bodyPart: null,
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
attachmentSizes: [-1, textAttachment.length],
|
||||
attachmentTotalSize: { size: textAttachment.length, exact: true },
|
||||
},
|
||||
// this is an attached message that itself has an attachment
|
||||
{
|
||||
name: 'attached_message_with_attachment',
|
||||
name: "attached_message_with_attachment",
|
||||
bodyPart: null,
|
||||
attachmentSizes: [-1, textAttachment.length],
|
||||
attachmentTotalSize: { size: 0, exact: true },
|
||||
|
@ -148,7 +150,7 @@ function setupModule(module) {
|
|||
collector.getModule(lib).installInto(module);
|
||||
}
|
||||
|
||||
messenger = Cc['@mozilla.org/messenger;1'].createInstance(Ci.nsIMessenger);
|
||||
messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
|
||||
|
||||
/* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
|
||||
* counts the trailing newline for an attachment MIME part. Most of the time,
|
||||
|
@ -157,33 +159,33 @@ function setupModule(module) {
|
|||
* holds. However, on Windows, if the attachment is not encoded (that is, is
|
||||
* inline text), libmime will return N + 2 bytes.
|
||||
*/
|
||||
epsilon = ('@mozilla.org/windows-registry-key;1' in Cc) ? 4 : 2;
|
||||
epsilon = ("@mozilla.org/windows-registry-key;1" in Cc) ? 4 : 2;
|
||||
|
||||
// set up our detached/deleted attachments
|
||||
var thisFilePath = os.getFileForPath(__file__);
|
||||
|
||||
var detachedFile = os.getFileForPath(os.abspath(detachedName, thisFilePath));
|
||||
var detached = create_body_part(
|
||||
'Here is a file',
|
||||
[create_detached_attachment(detachedFile, 'text/plain')]
|
||||
"Here is a file",
|
||||
[create_detached_attachment(detachedFile, "text/plain")]
|
||||
);
|
||||
|
||||
var missingFile = os.getFileForPath(os.abspath(missingName, thisFilePath));
|
||||
var missing = create_body_part(
|
||||
'Here is a file (but you deleted the external file, you silly oaf!)',
|
||||
[create_detached_attachment(missingFile, 'text/plain')]
|
||||
"Here is a file (but you deleted the external file, you silly oaf!)",
|
||||
[create_detached_attachment(missingFile, "text/plain")]
|
||||
);
|
||||
|
||||
var deleted = create_body_part(
|
||||
'Here is a file that you deleted',
|
||||
[create_deleted_attachment(deletedName, 'text/plain')]
|
||||
"Here is a file that you deleted",
|
||||
[create_deleted_attachment(deletedName, "text/plain")]
|
||||
);
|
||||
|
||||
var attachedMessage = msgGen.makeMessage({
|
||||
body: { body: textAttachment },
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
});
|
||||
|
||||
/* Much like the above comment, libmime counts bytes differently on Windows,
|
||||
|
@ -197,25 +199,25 @@ function setupModule(module) {
|
|||
attachedMessageLength = attachedMessage.toMessageString()
|
||||
.replace(/\r\n/g, "\n").length;
|
||||
|
||||
folder = create_folder('AttachmentSizeA');
|
||||
folder = create_folder("AttachmentSizeA");
|
||||
for (let i = 0; i < messages.length; i++) {
|
||||
// First, add any missing info to the message object.
|
||||
switch(messages[i].name) {
|
||||
case 'detached_attachment':
|
||||
case 'multiple_attachments_one_detached':
|
||||
switch (messages[i].name) {
|
||||
case "detached_attachment":
|
||||
case "multiple_attachments_one_detached":
|
||||
messages[i].bodyPart = detached;
|
||||
messages[i].attachmentSizes[0] = detachedFile.fileSize;
|
||||
messages[i].attachmentTotalSize.size += detachedFile.fileSize;
|
||||
break;
|
||||
case 'detached_attachment_with_missing_file':
|
||||
case 'multiple_attachments_one_detached_with_missing_file':
|
||||
case "detached_attachment_with_missing_file":
|
||||
case "multiple_attachments_one_detached_with_missing_file":
|
||||
messages[i].bodyPart = missing;
|
||||
break;
|
||||
case 'deleted_attachment':
|
||||
case 'multiple_attachments_one_deleted':
|
||||
case "deleted_attachment":
|
||||
case "multiple_attachments_one_deleted":
|
||||
messages[i].bodyPart = deleted;
|
||||
break;
|
||||
case 'attached_message_with_attachment':
|
||||
case "attached_message_with_attachment":
|
||||
messages[i].bodyPart = new SyntheticPartMultiMixed([
|
||||
new SyntheticPartLeaf("I am text!", { contentType: "text/plain" }),
|
||||
attachedMessage,
|
||||
|
@ -235,21 +237,21 @@ function setupModule(module) {
|
|||
* @param expectedSize the expected size of the attachment, in bytes
|
||||
*/
|
||||
function check_attachment_size(index, expectedSize) {
|
||||
let list = mc.e('attachmentList');
|
||||
let list = mc.e("attachmentList");
|
||||
let node = list.querySelectorAll("richlistitem.attachmentItem")[index];
|
||||
|
||||
// First, let's check that the attachment size is correct
|
||||
let size = node.attachment.size;
|
||||
if (Math.abs(size - expectedSize) > epsilon)
|
||||
throw new Error('Reported attachment size ('+size+') not within epsilon ' +
|
||||
'of actual attachment size ('+expectedSize+')');
|
||||
throw new Error("Reported attachment size (" + size + ") not within epsilon " +
|
||||
"of actual attachment size (" + expectedSize + ")");
|
||||
|
||||
// Next, make sure that the formatted size in the label is correct
|
||||
let formattedSize = node.getAttribute('size');
|
||||
let formattedSize = node.getAttribute("size");
|
||||
let expectedFormattedSize = messenger.formatFileSize(size);
|
||||
if (formattedSize != expectedFormattedSize)
|
||||
throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
|
||||
'match expected value ('+expectedFormattedSize+')');
|
||||
throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
|
||||
"match expected value (" + expectedFormattedSize + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,18 +259,18 @@ function check_attachment_size(index, expectedSize) {
|
|||
* @param index the attachment's index, starting at 0
|
||||
*/
|
||||
function check_no_attachment_size(index) {
|
||||
let list = mc.e('attachmentList');
|
||||
let list = mc.e("attachmentList");
|
||||
let node = list.querySelectorAll("richlistitem.attachmentItem")[index];
|
||||
|
||||
if (node.attachment.size != -1)
|
||||
throw new Error('attachmentSize attribute of deleted attachment should ' +
|
||||
'be -1!');
|
||||
throw new Error("attachmentSize attribute of deleted attachment should " +
|
||||
"be -1!");
|
||||
|
||||
// If there's no size, the size attribute is the zero-width space.
|
||||
let nodeSize = node.getAttribute('size');
|
||||
mc.window.console.log("check_no_attachment_size: node.size->"+nodeSize+"<-");
|
||||
if (nodeSize != '\u200b' && nodeSize != '')
|
||||
throw new Error('Attachment size should not be displayed!');
|
||||
let nodeSize = node.getAttribute("size");
|
||||
mc.window.console.log("check_no_attachment_size: node.size->" + nodeSize + "<-");
|
||||
if (nodeSize != "\u200b" && nodeSize != "")
|
||||
throw new Error("Attachment size should not be displayed!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -278,12 +280,12 @@ function check_no_attachment_size(index) {
|
|||
* @param exact true if the size of all attachments is known, false otherwise
|
||||
*/
|
||||
function check_total_attachment_size(count, expectedSize, exact) {
|
||||
let list = mc.e('attachmentList');
|
||||
let list = mc.e("attachmentList");
|
||||
let nodes = list.querySelectorAll("richlistitem.attachmentItem");
|
||||
let sizeNode = mc.e('attachmentSize');
|
||||
let sizeNode = mc.e("attachmentSize");
|
||||
|
||||
if (nodes.length != count)
|
||||
throw new Error('Saw '+nodes.length+' attachments, but expected '+count);
|
||||
throw new Error("Saw " + nodes.length + " attachments, but expected " + count);
|
||||
|
||||
let lastPartID;
|
||||
let size = 0;
|
||||
|
@ -297,26 +299,26 @@ function check_total_attachment_size(count, expectedSize, exact) {
|
|||
}
|
||||
}
|
||||
|
||||
if (Math.abs(size - expectedSize) > epsilon*count)
|
||||
throw new Error('Reported attachment size ('+size+') not within epsilon ' +
|
||||
'of actual attachment size ('+expectedSize+')');
|
||||
if (Math.abs(size - expectedSize) > epsilon * count)
|
||||
throw new Error("Reported attachment size (" + size + ") not within epsilon " +
|
||||
"of actual attachment size (" + expectedSize + ")");
|
||||
|
||||
// Next, make sure that the formatted size in the label is correct
|
||||
let formattedSize = sizeNode.getAttribute('value');
|
||||
let formattedSize = sizeNode.getAttribute("value");
|
||||
let expectedFormattedSize = messenger.formatFileSize(size);
|
||||
let messengerBundle = mc.window.document.getElementById('bundle_messenger');
|
||||
let messengerBundle = mc.window.document.getElementById("bundle_messenger");
|
||||
|
||||
if (!exact) {
|
||||
if (size == 0)
|
||||
expectedFormattedSize = messengerBundle.getString(
|
||||
'attachmentSizeUnknown');
|
||||
"attachmentSizeUnknown");
|
||||
else
|
||||
expectedFormattedSize = messengerBundle.getFormattedString(
|
||||
'attachmentSizeAtLeast', [expectedFormattedSize]);
|
||||
"attachmentSizeAtLeast", [expectedFormattedSize]);
|
||||
}
|
||||
if (formattedSize != expectedFormattedSize)
|
||||
throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
|
||||
'match expected value ('+expectedFormattedSize+')');
|
||||
throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
|
||||
"match expected value (" + expectedFormattedSize + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -326,7 +328,7 @@ function check_total_attachment_size(count, expectedSize, exact) {
|
|||
*/
|
||||
function help_test_attachment_size(index) {
|
||||
be_in_folder(folder);
|
||||
let curMessage = select_click_row(index);
|
||||
select_click_row(index);
|
||||
let expectedSizes = messages[index].attachmentSizes;
|
||||
|
||||
mc.window.toggleAttachmentList(true);
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-attachment';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'window-helpers'];
|
||||
var MODULE_NAME = "test-attachment";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
var EventUtils = ChromeUtils.import("chrome://mozmill/content/stdlib/EventUtils.jsm");
|
||||
|
@ -32,12 +34,12 @@ var textAttachment =
|
|||
|
||||
var binaryAttachment = textAttachment;
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
let composeHelper = collector.getModule('compose-helpers');
|
||||
let composeHelper = collector.getModule("compose-helpers");
|
||||
composeHelper.installInto(module);
|
||||
|
||||
folder = create_folder("AttachmentA");
|
||||
|
@ -45,8 +47,8 @@ var setupModule = function (module) {
|
|||
var attachedMessage = msgGen.makeMessage({
|
||||
body: { body: "I'm an attached email!" },
|
||||
attachments: [{ body: textAttachment,
|
||||
filename: 'inner attachment.txt',
|
||||
format: '' }],
|
||||
filename: "inner attachment.txt",
|
||||
format: "" }],
|
||||
});
|
||||
|
||||
// create some messages that have various types of attachments
|
||||
|
@ -55,33 +57,33 @@ var setupModule = function (module) {
|
|||
{},
|
||||
// text attachment
|
||||
{ attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }],
|
||||
filename: "ubik.txt",
|
||||
format: "" }],
|
||||
},
|
||||
// binary attachment; filename has 9 "1"s, which should be just within the
|
||||
// limit for showing the original name
|
||||
{ attachments: [{ body: binaryAttachment,
|
||||
contentType: 'application/octet-stream',
|
||||
filename: 'ubik-111111111.xxyyzz',
|
||||
format: '' }],
|
||||
contentType: "application/octet-stream",
|
||||
filename: "ubik-111111111.xxyyzz",
|
||||
format: "" }],
|
||||
},
|
||||
// multiple attachments
|
||||
{ attachments: [{ body: textAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' },
|
||||
filename: "ubik.txt",
|
||||
format: "" },
|
||||
{ body: binaryAttachment,
|
||||
contentType: 'application/octet-stream',
|
||||
filename: 'ubik.xxyyzz',
|
||||
format: '' }],
|
||||
contentType: "application/octet-stream",
|
||||
filename: "ubik.xxyyzz",
|
||||
format: "" }],
|
||||
},
|
||||
// attachment with a long name; the attachment bar should crop this
|
||||
{ attachments: [{ body: textAttachment,
|
||||
filename: 'this-is-a-file-with-an-extremely-long-name-' +
|
||||
'that-seems-to-go-on-forever-seriously-you-' +
|
||||
'would-not-believe-how-long-this-name-is-it-' +
|
||||
'surely-exceeds-the-maximum-filename-length-' +
|
||||
'for-most-filesystems.txt',
|
||||
format: '' }],
|
||||
filename: "this-is-a-file-with-an-extremely-long-name-" +
|
||||
"that-seems-to-go-on-forever-seriously-you-" +
|
||||
"would-not-believe-how-long-this-name-is-it-" +
|
||||
"surely-exceeds-the-maximum-filename-length-" +
|
||||
"for-most-filesystems.txt",
|
||||
format: "" }],
|
||||
},
|
||||
// a message with a text attachment and an email attachment, which in turn
|
||||
// has its own text attachment
|
||||
|
@ -89,44 +91,44 @@ var setupModule = function (module) {
|
|||
bodyPart: new SyntheticPartMultiMixed([
|
||||
new SyntheticPartLeaf("I'm a message!"),
|
||||
new SyntheticPartLeaf(textAttachment,
|
||||
{ filename: 'outer attachment.txt',
|
||||
contentType: 'text/plain',
|
||||
format: '' }),
|
||||
{ filename: "outer attachment.txt",
|
||||
contentType: "text/plain",
|
||||
format: "" }),
|
||||
attachedMessage,
|
||||
]),
|
||||
},
|
||||
// evilly-named attachment; spaces should be collapsed and trimmed on the
|
||||
// ends
|
||||
{ attachments: [{ body: textAttachment,
|
||||
contentType: 'application/octet-stream',
|
||||
filename: ' ubik .txt .evil ',
|
||||
sanitizedFilename: 'ubik .txt .evil',
|
||||
format: '' }],
|
||||
contentType: "application/octet-stream",
|
||||
filename: " ubik .txt .evil ",
|
||||
sanitizedFilename: "ubik .txt .evil",
|
||||
format: "" }],
|
||||
},
|
||||
// another evilly-named attachment; filename has 10 "_"s, which should be
|
||||
// just enough to trigger the sanitizer
|
||||
{ attachments: [{ body: textAttachment,
|
||||
contentType: 'application/octet-stream',
|
||||
filename: 'ubik.txt__________.evil',
|
||||
sanitizedFilename: 'ubik.txt_…_.evil',
|
||||
format: '' }],
|
||||
contentType: "application/octet-stream",
|
||||
filename: "ubik.txt__________.evil",
|
||||
sanitizedFilename: "ubik.txt_…_.evil",
|
||||
format: "" }],
|
||||
},
|
||||
];
|
||||
|
||||
// Add another evilly-named attachment for Windows tests, to ensure that
|
||||
// trailing periods are stripped.
|
||||
if ('@mozilla.org/windows-registry-key;1' in Cc) {
|
||||
if ("@mozilla.org/windows-registry-key;1" in Cc) {
|
||||
messages.push({ attachments: [{ body: textAttachment,
|
||||
contentType: 'application/octet-stream',
|
||||
filename: 'ubik.evil. . . . . . . . . ....',
|
||||
sanitizedFilename: 'ubik.evil',
|
||||
format: '' }],
|
||||
contentType: "application/octet-stream",
|
||||
filename: "ubik.evil. . . . . . . . . ....",
|
||||
sanitizedFilename: "ubik.evil",
|
||||
format: "" }],
|
||||
});
|
||||
}
|
||||
|
||||
for (let i = 0; i < messages.length; i++)
|
||||
add_message_to_folder(folder, create_message(messages[i]));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the pref to ensure that the attachments pane starts out (un)expanded
|
||||
|
@ -156,7 +158,7 @@ function test_attachment_view_expanded() {
|
|||
assert_selected_and_displayed(i);
|
||||
|
||||
if (mc.e("attachmentView").collapsed)
|
||||
throw new Error("Attachment pane collapsed (on message #"+i+
|
||||
throw new Error("Attachment pane collapsed (on message #" + i +
|
||||
" when it shouldn't be!");
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +280,7 @@ function test_attachment_right_click_single() {
|
|||
"attachment-toolbar-context-menu");
|
||||
}
|
||||
// Re-enable this test once Bug 617311 is fixed.
|
||||
test_attachment_right_click_single.EXCLUDED_PLATFORMS = ['linux'];
|
||||
test_attachment_right_click_single.EXCLUDED_PLATFORMS = ["linux"];
|
||||
|
||||
function test_attachment_right_click_multiple() {
|
||||
be_in_folder(folder);
|
||||
|
@ -298,7 +300,7 @@ function test_attachment_right_click_multiple() {
|
|||
"attachment-toolbar-context-menu");
|
||||
}
|
||||
// Re-enable this test once Bug 617311 is fixed.
|
||||
test_attachment_right_click_multiple.EXCLUDED_PLATFORMS = ['linux'];
|
||||
test_attachment_right_click_multiple.EXCLUDED_PLATFORMS = ["linux"];
|
||||
|
||||
/**
|
||||
* Test that clicking on various elements in the attachment bar toggles the
|
||||
|
@ -312,12 +314,12 @@ function subtest_attachment_list_toggle(elementId) {
|
|||
|
||||
mc.click(element);
|
||||
assert_true(!attachmentList.collapsed, "Attachment list should be expanded " +
|
||||
"after clicking "+elementId+"!");
|
||||
"after clicking " + elementId + "!");
|
||||
assert_attachment_list_focused();
|
||||
|
||||
mc.click(element);
|
||||
assert_true(attachmentList.collapsed, "Attachment list should be collapsed " +
|
||||
"after clicking "+elementId+" again!");
|
||||
"after clicking " + elementId + " again!");
|
||||
assert_message_pane_focused();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-attachment-item";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-attachment-item";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers",
|
||||
];
|
||||
|
||||
var kAttachmentItemContextID = "msgComposeAttachmentItemContext";
|
||||
|
||||
|
@ -66,15 +72,12 @@ function test_upload_cancel_repeat() {
|
|||
};
|
||||
|
||||
const kAttempts = 3;
|
||||
let cmd = cw.e("cmd_cancelUpload");
|
||||
let menu = cw.getMenu("#" + kAttachmentItemContextID);
|
||||
|
||||
for (let i = 0; i < kAttempts; i++) {
|
||||
promise = null;
|
||||
started = false;
|
||||
|
||||
// Select the attachment, and choose to convert it to a Filelink
|
||||
let attachmentitem = select_attachments(cw, 0)[0];
|
||||
select_attachments(cw, 0)[0];
|
||||
cw.window.convertSelectedToCloudAttachment(provider);
|
||||
cw.waitFor(() => started);
|
||||
|
||||
|
@ -145,11 +148,10 @@ function assert_can_cancel_upload(aController, aProvider, aPromise, aTargetFile)
|
|||
aTargetFile);
|
||||
|
||||
// Select that attachmentitem in the bucket
|
||||
let attachmentitem = select_attachments(aController, index)[0];
|
||||
select_attachments(aController, index)[0];
|
||||
|
||||
// Bring up the context menu, and click cancel.
|
||||
let cmd = aController.e("cmd_cancelUpload");
|
||||
let menu = aController.getMenu("#" + kAttachmentItemContextID);
|
||||
aController.window.updateAttachmentItems();
|
||||
|
||||
assert_false(cmd.hidden);
|
||||
|
|
|
@ -8,15 +8,23 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-attachment-urls";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-dom-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-attachment-urls";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers",
|
||||
"dom-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers",
|
||||
"dom-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
@ -244,7 +252,7 @@ function subtest_inserts_linebreak_on_empty_compose() {
|
|||
let cw = open_compose_new_mail();
|
||||
add_cloud_attachments(cw, provider);
|
||||
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br = root.previousSibling;
|
||||
assert_equals(br.localName, "br",
|
||||
|
@ -275,7 +283,7 @@ function test_inserts_linebreak_on_empty_compose_with_signature() {
|
|||
// wait_for_attachment_urls ensures that the attachment URL containment
|
||||
// node is an immediate child of the body of the message, so if this
|
||||
// succeeds, then we were not in the signature node.
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br = assert_previous_nodes("br", root, 1);
|
||||
|
||||
|
@ -300,7 +308,7 @@ function test_inserts_linebreak_on_empty_compose_with_signature() {
|
|||
// Now let's try with plaintext mail.
|
||||
cw = open_compose_new_mail();
|
||||
add_cloud_attachments(cw, provider);
|
||||
[root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
[root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
br = assert_previous_nodes("br", root, 1);
|
||||
|
||||
|
@ -336,7 +344,7 @@ function test_removing_filelinks_removes_root_node() {
|
|||
*/
|
||||
function subtest_removing_filelinks_removes_root_node() {
|
||||
let cw = prepare_some_attachments_and_reply([], kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
// Now select the attachments in the attachment bucket, and remove them.
|
||||
select_attachments(cw, 0, 1);
|
||||
|
@ -375,7 +383,7 @@ function subtest_adding_filelinks_to_written_message() {
|
|||
type_in_composer(cw, kLines);
|
||||
add_cloud_attachments(cw, provider);
|
||||
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br = root.previousSibling;
|
||||
assert_equals(br.localName, "br",
|
||||
|
@ -431,7 +439,7 @@ function test_adding_filelinks_to_nonempty_reply_above() {
|
|||
*/
|
||||
function subtest_adding_filelinks_to_reply_above_plaintext(aText, aWithSig) {
|
||||
let cw = prepare_some_attachments_and_reply(aText, kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br;
|
||||
if (aText.length)
|
||||
|
@ -472,7 +480,7 @@ function subtest_adding_filelinks_to_reply_above_plaintext(aText, aWithSig) {
|
|||
*/
|
||||
function subtest_adding_filelinks_to_reply_above(aText) {
|
||||
let cw = prepare_some_attachments_and_reply(aText, kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
// If there's any text written, then there's only a single break between the
|
||||
// end of the text and the reply. Otherwise, there are two breaks.
|
||||
|
@ -531,7 +539,7 @@ function test_adding_filelinks_to_nonempty_reply_below() {
|
|||
*/
|
||||
function subtest_adding_filelinks_to_reply_below(aText, aWithSig) {
|
||||
let cw = prepare_some_attachments_and_reply(aText, kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
// So, we should have the root, followed by a br
|
||||
let br = root.nextSibling;
|
||||
assert_equals(br.localName, "br",
|
||||
|
@ -569,7 +577,7 @@ function subtest_adding_filelinks_to_reply_below(aText, aWithSig) {
|
|||
*/
|
||||
function subtest_adding_filelinks_to_plaintext_reply_below(aText, aWithSig) {
|
||||
let cw = prepare_some_attachments_and_reply(aText, kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br, span;
|
||||
|
||||
|
@ -637,7 +645,7 @@ function test_adding_filelinks_to_forward() {
|
|||
*/
|
||||
function subtest_adding_filelinks_to_forward(aText, aWithSig) {
|
||||
let cw = prepare_some_attachments_and_forward(aText, kFiles);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let br = assert_next_nodes("br", root, 1);
|
||||
let forwardDiv = br.nextSibling;
|
||||
|
@ -648,7 +656,7 @@ function subtest_adding_filelinks_to_forward(aText, aWithSig) {
|
|||
// If there was text typed in, it should be separated from the root by two
|
||||
// br's
|
||||
let br = assert_previous_nodes("br", root, 2);
|
||||
let textNode = assert_previous_text(br.previousSibling, aText);
|
||||
assert_previous_text(br.previousSibling, aText);
|
||||
} else {
|
||||
// Otherwise, there's only 1 br, and that br should be the first element
|
||||
// of the message body.
|
||||
|
@ -685,14 +693,14 @@ function subtest_converting_filelink_updates_urls() {
|
|||
let cw = open_compose_new_mail();
|
||||
add_cloud_attachments(cw, providerA);
|
||||
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [, , urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
// Convert each Filelink to providerB, ensuring that the URLs are replaced.
|
||||
for (let i = 0; i < kFiles.length; ++i) {
|
||||
let url = urls[i];
|
||||
select_attachments(cw, i);
|
||||
cw.window.convertSelectedToCloudAttachment(providerB);
|
||||
[root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
[, , urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
let newUrl = urls[i];
|
||||
|
||||
|
@ -726,7 +734,7 @@ function subtest_converting_filelink_to_normal_removes_url() {
|
|||
let cw = open_compose_new_mail();
|
||||
add_cloud_attachments(cw, provider);
|
||||
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root, list] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
for (let i = 0; i < kFiles.length; ++i) {
|
||||
select_attachments(cw, i);
|
||||
|
@ -767,14 +775,14 @@ function subtest_filelinks_work_after_manual_removal() {
|
|||
let cw = open_compose_new_mail();
|
||||
add_cloud_attachments(cw, provider);
|
||||
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
// Now remove the root node from the document body
|
||||
root.remove();
|
||||
|
||||
gMockFilePicker.returnFiles = collectFiles(["./data/testFile3"], __file__);
|
||||
add_cloud_attachments(cw, provider);
|
||||
[root, list, urls] = wait_for_attachment_urls(cw, 1);
|
||||
[root] = wait_for_attachment_urls(cw, 1);
|
||||
|
||||
close_window(cw);
|
||||
}
|
||||
|
@ -810,14 +818,14 @@ function subtest_insertion_restores_caret_point() {
|
|||
|
||||
// Attach some Filelinks.
|
||||
add_cloud_attachments(cw, provider);
|
||||
let [root, list, urls] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
let [root] = wait_for_attachment_urls(cw, kFiles.length);
|
||||
|
||||
// Type some text.
|
||||
const kTypedIn = "Test";
|
||||
type_in_composer(cw, [kTypedIn]);
|
||||
|
||||
// That text should be inserted just above the root attachment URL node.
|
||||
let textNode = assert_previous_text(root.previousSibling, [kTypedIn]);
|
||||
assert_previous_text(root.previousSibling, [kTypedIn]);
|
||||
|
||||
close_window(cw);
|
||||
}
|
||||
|
|
|
@ -9,14 +9,21 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-manager";
|
||||
/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-pref-window-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-manager";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"pref-window-helpers",
|
||||
"content-tab-helpers",
|
||||
"cloudfile-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"pref-window-helpers",
|
||||
"content-tab-helpers",
|
||||
"cloudfile-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
|
|
@ -8,15 +8,23 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-notifications";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-cloudfile-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-prompt-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cloudfile-notifications";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers",
|
||||
"prompt-helpers",
|
||||
"notificationbox-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"cloudfile-helpers",
|
||||
"attachment-helpers",
|
||||
"prompt-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {cloudFileAccounts} = ChromeUtils.import("resource:///modules/cloudFileAccounts.jsm");
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-address-widgets";
|
||||
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
|
||||
|
||||
var cwc = null; // compose window controller
|
||||
var accountPOP3 = null;
|
||||
|
@ -33,7 +35,7 @@ function setupModule(module) {
|
|||
|
||||
// There may be pre-existing accounts from other tests.
|
||||
originalAccountCount = MailServices.accounts.allServers.length;
|
||||
};
|
||||
}
|
||||
|
||||
function teardownModule(module) {
|
||||
}
|
||||
|
|
|
@ -6,18 +6,23 @@
|
|||
* Tests that the attachment reminder works properly.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-attachment-reminder.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-attachment-reminder";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-attachment-reminder";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"notificationbox-helpers",
|
||||
"keyboard-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"notificationbox-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
@ -417,8 +422,7 @@ function test_manual_automatic_attachment_reminder_interaction() {
|
|||
* @param aValue True if notification should exist.
|
||||
* False otherwise.
|
||||
*/
|
||||
function assert_any_notification(aCwc, aValue)
|
||||
{
|
||||
function assert_any_notification(aCwc, aValue) {
|
||||
let notification = aCwc.e(kBoxId).currentNotification;
|
||||
if ((notification == null) == aValue)
|
||||
throw new Error("Notification in wrong state");
|
||||
|
@ -442,7 +446,7 @@ function test_attachment_vs_filelink_reminder() {
|
|||
let maxSize = Services.prefs.getIntPref(kOfferThreshold, 0) * 1024;
|
||||
let file = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
file.append("panacea.dat");
|
||||
add_attachment(cwc, Services.io.newFileURI(file).spec, maxSize);
|
||||
add_attachments(cwc, Services.io.newFileURI(file).spec, maxSize);
|
||||
|
||||
// The filelink attachment proposal should be up but not the attachment
|
||||
// reminder and it should also not interfere with the sending of the message.
|
||||
|
@ -694,14 +698,14 @@ function click_send_and_handle_send_error(aController, aAlreadySending) {
|
|||
* Click the "Oh, I Did!" button in the attachment reminder dialog.
|
||||
*/
|
||||
function click_oh_i_did(controller) {
|
||||
controller.window.document.documentElement.getButton('extra1').doCommand();
|
||||
controller.window.document.documentElement.getButton("extra1").doCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
* Click the "No, Send Now" button in the attachment reminder dialog.
|
||||
*/
|
||||
function click_no_send_now(controller) {
|
||||
controller.window.document.documentElement.getButton('accept').doCommand();
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -711,7 +715,7 @@ function click_ok_on_send_error(controller) {
|
|||
if (controller.window.document.title != "Send Message Error")
|
||||
throw new Error("Not a send error dialog; title=" +
|
||||
controller.window.document.title);
|
||||
controller.window.document.documentElement.getButton('accept').doCommand();
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -721,5 +725,5 @@ function click_save_message(controller) {
|
|||
if (controller.window.document.title != "Save Message")
|
||||
throw new Error("Not a Save message dialog; title=" +
|
||||
controller.window.document.title);
|
||||
controller.window.document.documentElement.getButton('accept').doCommand();
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
|
|
@ -8,14 +8,16 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-attachment";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
var MODULE_NAME = 'test-attachment';
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'window-helpers'];
|
||||
|
||||
var messenger;
|
||||
var folder;
|
||||
var epsilon;
|
||||
|
@ -32,10 +34,10 @@ var rawAttachment =
|
|||
"only seconds away. Avoid prolonged use.";
|
||||
|
||||
var b64Attachment =
|
||||
'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS' +
|
||||
'FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA' +
|
||||
'A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe' +
|
||||
'SNQAAlmAY+71EgFoAAAAASUVORK5CYII=';
|
||||
"iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwS" +
|
||||
"FlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA" +
|
||||
"A5SURBVCiRY/z//z8DKYCJJNXkaGBgYGD4D8NQ5zUgiTVAxeBqSLaBkVRPM0KtIhrQ3km0jwe" +
|
||||
"SNQAAlmAY+71EgFoAAAAASUVORK5CYII=";
|
||||
var b64Size = 188;
|
||||
|
||||
function setupModule(module) {
|
||||
|
@ -43,12 +45,12 @@ function setupModule(module) {
|
|||
collector.getModule(lib).installInto(module);
|
||||
}
|
||||
|
||||
folder = create_folder('ComposeAttachmentA');
|
||||
folder = create_folder("ComposeAttachmentA");
|
||||
|
||||
messenger = Cc['@mozilla.org/messenger;1']
|
||||
messenger = Cc["@mozilla.org/messenger;1"]
|
||||
.createInstance(Ci.nsIMessenger);
|
||||
|
||||
isWindows = '@mozilla.org/windows-registry-key;1' in Cc;
|
||||
isWindows = "@mozilla.org/windows-registry-key;1" in Cc;
|
||||
|
||||
/* Today's gory details (thanks to Jonathan Protzenko): libmime somehow
|
||||
* counts the trailing newline for an attachment MIME part. Most of the time,
|
||||
|
@ -59,7 +61,7 @@ function setupModule(module) {
|
|||
* forwarded message data here, the bonus byte(s) appear twice.
|
||||
*/
|
||||
epsilon = isWindows ? 4 : 2;
|
||||
filePrefix = isWindows ? 'file:///C:/' : 'file:///';
|
||||
filePrefix = isWindows ? "file:///C:/" : "file:///";
|
||||
|
||||
// create some messages that have various types of attachments
|
||||
let messages = [
|
||||
|
@ -67,17 +69,17 @@ function setupModule(module) {
|
|||
{},
|
||||
// raw attachment
|
||||
{ attachments: [{ body: rawAttachment,
|
||||
filename: 'ubik.txt',
|
||||
format: '' }]},
|
||||
filename: "ubik.txt",
|
||||
format: "" }]},
|
||||
// b64-encoded image attachment
|
||||
{ attachments: [{ body: b64Attachment,
|
||||
contentType: 'image/png',
|
||||
filename: 'lines.png',
|
||||
encoding: 'base64',
|
||||
format: '' }]},
|
||||
contentType: "image/png",
|
||||
filename: "lines.png",
|
||||
encoding: "base64",
|
||||
format: "" }]},
|
||||
];
|
||||
|
||||
for (let i=0; i<messages.length; i++) {
|
||||
for (let i = 0; i < messages.length; i++) {
|
||||
add_message_to_folder(folder, create_message(messages[i]));
|
||||
}
|
||||
}
|
||||
|
@ -89,21 +91,21 @@ function setupModule(module) {
|
|||
* @param expectedSize the expected size of the attachment, in bytes
|
||||
*/
|
||||
function check_attachment_size(controller, index, expectedSize) {
|
||||
let bucket = controller.e('attachmentBucket');
|
||||
let bucket = controller.e("attachmentBucket");
|
||||
let node = bucket.querySelectorAll("richlistitem.attachmentItem")[index];
|
||||
|
||||
// First, let's check that the attachment size is correct
|
||||
let size = node.attachment.size;
|
||||
if (Math.abs(size - expectedSize) > epsilon)
|
||||
throw new Error('Reported attachment size ('+size+') not within epsilon ' +
|
||||
'of actual attachment size ('+expectedSize+')');
|
||||
throw new Error("Reported attachment size (" + size + ") not within epsilon " +
|
||||
"of actual attachment size (" + expectedSize + ")");
|
||||
|
||||
// Next, make sure that the formatted size in the label is correct
|
||||
let formattedSize = node.getAttribute('size');
|
||||
let formattedSize = node.getAttribute("size");
|
||||
let expectedFormattedSize = messenger.formatFileSize(size);
|
||||
if (formattedSize != expectedFormattedSize)
|
||||
throw new Error('Formatted attachment size ('+formattedSize+') does not ' +
|
||||
'match expected value ('+expectedFormattedSize+')');
|
||||
throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
|
||||
"match expected value (" + expectedFormattedSize + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,15 +114,15 @@ function check_attachment_size(controller, index, expectedSize) {
|
|||
* @param index the attachment to examine, as an index into the listbox
|
||||
*/
|
||||
function check_no_attachment_size(controller, index) {
|
||||
let bucket = controller.e('attachmentBucket');
|
||||
let bucket = controller.e("attachmentBucket");
|
||||
let node = bucket.querySelectorAll("richlistitem.attachmentItem")[index];
|
||||
|
||||
if (node.attachment.size != -1)
|
||||
throw new Error('attachment.size attribute should be -1!');
|
||||
throw new Error("attachment.size attribute should be -1!");
|
||||
|
||||
// If there's no size, the size attribute is the zero-width space.
|
||||
if (node.getAttribute('size') != '\u200b')
|
||||
throw new Error('Attachment size should not be displayed!');
|
||||
if (node.getAttribute("size") != "\u200b")
|
||||
throw new Error("Attachment size should not be displayed!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,7 +136,7 @@ function check_total_attachment_size(controller, count) {
|
|||
let sizeNode = controller.e("attachmentBucketSize");
|
||||
|
||||
if (nodes.length != count)
|
||||
throw new Error("Saw "+nodes.length+" attachments, but expected "+count);
|
||||
throw new Error("Saw " + nodes.length + " attachments, but expected " + count);
|
||||
|
||||
let size = 0;
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
|
@ -147,8 +149,8 @@ function check_total_attachment_size(controller, count) {
|
|||
let formattedSize = sizeNode.getAttribute("value");
|
||||
let expectedFormattedSize = messenger.formatFileSize(size);
|
||||
if (formattedSize != expectedFormattedSize)
|
||||
throw new Error("Formatted attachment size ("+formattedSize+") does not " +
|
||||
"match expected value ("+expectedFormattedSize+")");
|
||||
throw new Error("Formatted attachment size (" + formattedSize + ") does not " +
|
||||
"match expected value (" + expectedFormattedSize + ")");
|
||||
}
|
||||
|
||||
function test_file_attachment() {
|
||||
|
@ -157,7 +159,7 @@ function test_file_attachment() {
|
|||
let url = filePrefix + "some/file/here.txt";
|
||||
let size = 1234;
|
||||
|
||||
add_attachment(cwc, url, size);
|
||||
add_attachments(cwc, url, size);
|
||||
check_attachment_size(cwc, 0, size);
|
||||
check_total_attachment_size(cwc, 1);
|
||||
|
||||
|
@ -167,7 +169,7 @@ function test_file_attachment() {
|
|||
function test_webpage_attachment() {
|
||||
let cwc = open_compose_new_mail();
|
||||
|
||||
add_attachment(cwc, "http://www.mozilla.org/");
|
||||
add_attachments(cwc, "http://www.mozilla.org/");
|
||||
check_no_attachment_size(cwc, 0);
|
||||
check_total_attachment_size(cwc, 1);
|
||||
|
||||
|
@ -181,7 +183,7 @@ function test_multiple_attachments() {
|
|||
{name: "bar.txt", size: 5678},
|
||||
{name: "baz.txt", size: 9012}];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
add_attachment(cwc, filePrefix+files[i].name, files[i].size);
|
||||
add_attachments(cwc, filePrefix + files[i].name, files[i].size);
|
||||
check_attachment_size(cwc, i, files[i].size);
|
||||
}
|
||||
|
||||
|
@ -196,19 +198,19 @@ function test_delete_attachments() {
|
|||
{name: "bar.txt", size: 5678},
|
||||
{name: "baz.txt", size: 9012}];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
add_attachment(cwc, filePrefix+files[i].name, files[i].size);
|
||||
add_attachments(cwc, filePrefix + files[i].name, files[i].size);
|
||||
check_attachment_size(cwc, i, files[i].size);
|
||||
}
|
||||
|
||||
delete_attachment(cwc, 0);
|
||||
check_total_attachment_size(cwc, files.length-1);
|
||||
check_total_attachment_size(cwc, files.length - 1);
|
||||
|
||||
close_compose_window(cwc);
|
||||
}
|
||||
|
||||
function subtest_rename_attachment(cwc) {
|
||||
cwc.e("loginTextbox").value = "renamed.txt";
|
||||
cwc.window.document.documentElement.getButton('accept').doCommand();
|
||||
cwc.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
||||
function test_rename_attachment() {
|
||||
|
@ -217,7 +219,7 @@ function test_rename_attachment() {
|
|||
let url = filePrefix + "some/file/here.txt";
|
||||
let size = 1234;
|
||||
|
||||
add_attachment(cwc, url, size);
|
||||
add_attachments(cwc, url, size);
|
||||
|
||||
// Now, rename the attachment.
|
||||
let bucket = cwc.e("attachmentBucket");
|
||||
|
@ -250,7 +252,7 @@ function test_open_attachment() {
|
|||
let url = fileHandler.getURLSpecFromFile(file);
|
||||
let size = file.fileSize;
|
||||
|
||||
add_attachment(cwc, url, size);
|
||||
add_attachments(cwc, url, size);
|
||||
|
||||
// Now, open the attachment.
|
||||
let bucket = cwc.e("attachmentBucket");
|
||||
|
@ -264,7 +266,7 @@ function test_open_attachment() {
|
|||
|
||||
function test_forward_raw_attachment() {
|
||||
be_in_folder(folder);
|
||||
let curMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
|
||||
let cwc = open_compose_with_forward();
|
||||
check_attachment_size(cwc, 0, rawAttachment.length);
|
||||
|
@ -275,7 +277,7 @@ function test_forward_raw_attachment() {
|
|||
|
||||
function test_forward_b64_attachment() {
|
||||
be_in_folder(folder);
|
||||
let curMessage = select_click_row(2);
|
||||
select_click_row(2);
|
||||
|
||||
let cwc = open_compose_with_forward();
|
||||
check_attachment_size(cwc, 0, b64Size);
|
||||
|
@ -334,7 +336,6 @@ function check_attachment_names(aController, aNames) {
|
|||
*/
|
||||
function subtest_reordering_panel_keyboard(aCwc, aActions) {
|
||||
let panel = aCwc.e("reorderAttachmentsPanel");
|
||||
let bucket = aCwc.e("attachmentBucket");
|
||||
|
||||
for (let action of aActions) {
|
||||
aCwc.keypress(new elib.Elem(action.focusEl),
|
||||
|
@ -375,7 +376,7 @@ function subtest_reordering(aCwc, aInitialAttachmentNames,
|
|||
// Create a set of attachments for the test.
|
||||
const size = 1234;
|
||||
for (let name of aInitialAttachmentNames) {
|
||||
add_attachment(aCwc, filePrefix + name, size);
|
||||
add_attachments(aCwc, filePrefix + name, size);
|
||||
}
|
||||
aCwc.sleep(0);
|
||||
assert_equals(aCwc.window.attachmentsCount(), aInitialAttachmentNames.length);
|
||||
|
@ -426,9 +427,9 @@ function test_attachment_reordering() {
|
|||
let editorEl = cwc.window.GetCurrentEditorElement();
|
||||
let bucket = cwc.e("attachmentBucket");
|
||||
let panel = cwc.e("reorderAttachmentsPanel");
|
||||
const openReorderPanelModifiers =
|
||||
(AppConstants.platform == "macosx") ? { controlKey: true }
|
||||
: { altKey: true };
|
||||
// const openReorderPanelModifiers =
|
||||
// (AppConstants.platform == "macosx") ? { controlKey: true }
|
||||
// : { altKey: true };
|
||||
|
||||
// First, some checks if the 'Reorder Attachments' panel
|
||||
// opens and closes correctly.
|
||||
|
@ -437,7 +438,7 @@ function test_attachment_reordering() {
|
|||
const size = 1234;
|
||||
const initialAttachmentNames_0 = ["A1", "A2"];
|
||||
for (let name of initialAttachmentNames_0) {
|
||||
add_attachment(cwc, filePrefix + name, size);
|
||||
add_attachments(cwc, filePrefix + name, size);
|
||||
cwc.sleep(0);
|
||||
}
|
||||
assert_equals(cwc.window.attachmentsCount(), initialAttachmentNames_0.length);
|
||||
|
@ -456,14 +457,14 @@ function test_attachment_reordering() {
|
|||
|
||||
// Show 'Reorder Attachments' panel via keyboard.
|
||||
// key_reorderAttachments, Bug 1427037
|
||||
const openPanelActions = [
|
||||
{ focusEl: editorEl,
|
||||
key: "x",
|
||||
key_modifiers: openReorderPanelModifiers },
|
||||
{ focusEl: bucket,
|
||||
key: "x",
|
||||
key_modifiers: openReorderPanelModifiers }
|
||||
];
|
||||
// const openPanelActions = [
|
||||
// { focusEl: editorEl,
|
||||
// key: "x",
|
||||
// key_modifiers: openReorderPanelModifiers },
|
||||
// { focusEl: bucket,
|
||||
// key: "x",
|
||||
// key_modifiers: openReorderPanelModifiers },
|
||||
// ];
|
||||
|
||||
// XXX this doesn't work on any platform yet, ESC doesn't close the panel.
|
||||
// Execute test of opening 'Reorder Attachments' panel via keyboard.
|
||||
|
@ -497,7 +498,7 @@ function test_attachment_reordering() {
|
|||
// Bug 1417856
|
||||
{ select: [2],
|
||||
button: "btn_sortAttachmentsToggle",
|
||||
result: ["a", "b", "B", "bb", "C", "x"] }
|
||||
result: ["a", "b", "B", "bb", "C", "x"] },
|
||||
];
|
||||
|
||||
// Check 2: basic and advanced, mouse-only.
|
||||
|
@ -595,7 +596,7 @@ function test_attachment_reordering() {
|
|||
result: ["x", "bb", "B", "a", "z", "y2", "y1", "C", "b"] },
|
||||
{ select: [0, 2, 3, 7],
|
||||
button: "btn_moveAttachmentBottom",
|
||||
result: ["bb", "z", "y2", "y1", "b", "x", "B", "a", "C"] }
|
||||
result: ["bb", "z", "y2", "y1", "b", "x", "B", "a", "C"] },
|
||||
];
|
||||
|
||||
// Check 3: basic and advanced, keyboard-only.
|
||||
|
@ -733,7 +734,7 @@ function test_attachment_reordering() {
|
|||
// key_moveAttachmentTop2 (secondary shortcut on MAC, same as Win primary)
|
||||
key: "VK_HOME",
|
||||
key_modifiers: modAlt,
|
||||
result: ["a", "b", "C", "bb", "B", "x", "y1", "y2", "z"] }
|
||||
result: ["a", "b", "C", "bb", "B", "x", "y1", "y2", "z"] },
|
||||
];
|
||||
|
||||
// Check 4: Alt+Y keyboard shortcut for sorting (Bug 1425891).
|
||||
|
@ -744,7 +745,7 @@ function test_attachment_reordering() {
|
|||
// key_sortAttachmentsToggle
|
||||
key: "y",
|
||||
key_modifiers: modAlt,
|
||||
result: ["a", "b", "B", "bb", "C", "x", "y1", "y2", "z"] }
|
||||
result: ["a", "b", "B", "bb", "C", "x", "y1", "y2", "z"] },
|
||||
];
|
||||
|
||||
// Execute the tests of reordering actions as defined above.
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
* Tests that messages with "broken" base64 are correctly displayed.
|
||||
*/
|
||||
|
||||
// mozmake SOLO_TEST=composition/test-base64-display.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-base64-display.js";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-base64-display.js";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -6,18 +6,20 @@
|
|||
* Tests that we do the right thing wrt. blocked resources during composition.
|
||||
*/
|
||||
|
||||
// make mozmill-one SOLO_TEST=composition/test-blocked-content.js
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-blocked-content";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-blocked-content";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"compose-helpers",
|
||||
"notificationbox-helpers"
|
||||
"window-helpers",
|
||||
"compose-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
|
|
|
@ -7,15 +7,21 @@
|
|||
* replying to messages.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-charset-edit.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-charset-edit";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-charset-edit";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"window-helpers", "notificationbox-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -49,7 +55,7 @@ function setupModule(module) {
|
|||
* @param aGetText: if true, return header objects. if false, return body data.
|
||||
* @return Map(partnum -> message headers)
|
||||
*/
|
||||
function getMsgHeaders(aMsgHdr, aGetText=false) {
|
||||
function getMsgHeaders(aMsgHdr, aGetText = false) {
|
||||
let msgFolder = aMsgHdr.folder;
|
||||
let msgUri = msgFolder.getUriForMsg(aMsgHdr);
|
||||
|
||||
|
@ -59,11 +65,11 @@ function getMsgHeaders(aMsgHdr, aGetText=false) {
|
|||
_done: false,
|
||||
_data: new Map(),
|
||||
_text: new Map(),
|
||||
endMessage: function () { this._done = true; },
|
||||
deliverPartData: function (num, text) {
|
||||
endMessage() { this._done = true; },
|
||||
deliverPartData(num, text) {
|
||||
this._text.set(num, this._text.get(num) + text);
|
||||
},
|
||||
startPart: function (num, headers) {
|
||||
startPart(num, headers) {
|
||||
this._data.set(num, headers);
|
||||
this._text.set(num, "");
|
||||
},
|
||||
|
@ -90,7 +96,7 @@ function test_wrong_reply_charset() {
|
|||
let folder = gDrafts;
|
||||
let msg0 = create_message({
|
||||
bodyPart: new SyntheticPartLeaf("Some text",
|
||||
{charset: "invalid-charset"})
|
||||
{charset: "invalid-charset"}),
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
be_in_folder(folder);
|
||||
|
@ -131,7 +137,7 @@ function test_no_mojibake() {
|
|||
let nonASCII = "ケツァルコアトル";
|
||||
let UTF7 = "+MLEwxDChMOswszCiMMgw6w-";
|
||||
let msg0 = create_message({
|
||||
bodyPart: new SyntheticPartLeaf(UTF7, {charset: "utf-7"})
|
||||
bodyPart: new SyntheticPartLeaf(UTF7, {charset: "utf-7"}),
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
be_in_folder(folder);
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
* all characters doesn't fit the selected charset.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-charset-upgrade.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-charset-upgrade";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-charset-upgrade";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
|
@ -163,7 +164,7 @@ function test_encoding_upgrade_plaintext_compose() {
|
|||
|
||||
let draftMsg2Content = get_msg_source(draftMsg2, "UTF-8");
|
||||
if (draftMsg2Content.includes("<html>"))
|
||||
throw new Error("Plaintext draft contained <html>; "+
|
||||
throw new Error("Plaintext draft contained <html>; " +
|
||||
"draftMsg2Content=" + draftMsg2Content);
|
||||
|
||||
if (!draftMsg2Content.includes(CHINESE))
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
* Tests that messages in cp932, Thunderbirds alias for Shift_JIS, are correctly displayed.
|
||||
*/
|
||||
|
||||
// mozmake SOLO_TEST=composition/test-cp932-display.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-cp932-display.js";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cp932-display.js";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -7,15 +7,21 @@
|
|||
* called from the context of an open composer.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-draft-identity.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-draft-identity";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-draft-identity";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"compose-helpers", "notificationbox-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"compose-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
||||
|
@ -68,14 +74,14 @@ function setupModule(module) {
|
|||
function create_draft(aFrom, aIdKey) {
|
||||
let msgCount = gDrafts.getTotalMessages(false);
|
||||
let source =
|
||||
"From - Wed Mar 01 01:02:03 2017\n"+
|
||||
"From - Wed Mar 01 01:02:03 2017\n" +
|
||||
"X-Mozilla-Status: 0000\n" +
|
||||
"X-Mozilla-Status2: 00000000\n" +
|
||||
"X-Mozilla-Keys: \n" +
|
||||
"FCC: mailbox://nobody@Local%20Folders/Sent\n" +
|
||||
(aIdKey ?
|
||||
`X-Identity-Key: ${aIdKey}\n` +
|
||||
`X-Account-Key: ${gAccount.key}\n`:"") +
|
||||
`X-Account-Key: ${gAccount.key}\n` : "") +
|
||||
`From: ${aFrom}\n` +
|
||||
"To: nobody@example.invalid\n" +
|
||||
"Subject: test!\n" +
|
||||
|
|
|
@ -7,15 +7,21 @@
|
|||
* - that we don't allow opening multiple copies of a draft.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-drafts.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-drafts";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-drafts";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"window-helpers", "notificationbox-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
@ -38,7 +44,7 @@ function setupModule(module) {
|
|||
function test_open_draft_again() {
|
||||
make_new_sets_in_folder(draftsFolder, [{count: 1}]);
|
||||
be_in_folder(draftsFolder);
|
||||
let draftMsg = select_click_row(0);
|
||||
select_click_row(0);
|
||||
|
||||
// Wait for the notification with the Edit button.
|
||||
wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
|
||||
|
@ -180,7 +186,7 @@ function test_edit_as_new_in_draft() {
|
|||
|
||||
assert_equals(draftsFolder.getTotalMessages(false), 1);
|
||||
|
||||
let draftMsg = select_click_row(0);
|
||||
select_click_row(0);
|
||||
|
||||
// Wait for the notification with the Edit button.
|
||||
wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
|
||||
|
@ -254,7 +260,7 @@ function test_remove_space_stuffing_format_flowed() {
|
|||
|
||||
be_in_folder(draftsFolder);
|
||||
|
||||
let draftMsg = select_click_row(0);
|
||||
select_click_row(0);
|
||||
|
||||
// Wait for the notification with the Edit button.
|
||||
wait_for_notification_to_show(mc, kBoxId, "draftMsgContent");
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
* Tests that actions such as replying to an .eml works properly.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-eml-actions.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-eml-actions";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-eml-actions";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-focus";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-focus";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
function setupModule(module) {
|
||||
for (let lib of MODULE_REQUIRES) {
|
||||
|
@ -77,7 +79,7 @@ function test_f6_no_attachment() {
|
|||
|
||||
function test_f6_attachment() {
|
||||
let cwc = open_compose_new_mail();
|
||||
add_attachment(cwc, "http://www.mozilla.org/");
|
||||
add_attachments(cwc, "http://www.mozilla.org/");
|
||||
check_element_cycling(cwc, true, false);
|
||||
close_compose_window(cwc);
|
||||
}
|
||||
|
@ -90,7 +92,7 @@ function test_ctrl_tab_no_attachment() {
|
|||
|
||||
function test_ctrl_tab_attachment() {
|
||||
let cwc = open_compose_new_mail();
|
||||
add_attachment(cwc, "http://www.mozilla.org/");
|
||||
add_attachments(cwc, "http://www.mozilla.org/");
|
||||
check_element_cycling(cwc, true, true);
|
||||
close_compose_window(cwc);
|
||||
}
|
||||
|
|
|
@ -9,11 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-forward-headers";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-message-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-forward-headers";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers",
|
||||
"message-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"message-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -21,7 +29,7 @@ var cwc = null; // compose window controller
|
|||
var folder;
|
||||
var gDrafts;
|
||||
|
||||
var setupModule = function (module) {
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let composeHelper = collector.getModule("compose-helpers");
|
||||
|
@ -41,7 +49,7 @@ var setupModule = function (module) {
|
|||
// The test checks for the first DOM node and expects a text and not
|
||||
// a paragraph.
|
||||
Services.prefs.setBoolPref("mail.compose.default_to_paragraph", false);
|
||||
};
|
||||
}
|
||||
|
||||
function teardownModule(module) {
|
||||
Services.prefs.clearUserPref("mail.compose.default_to_paragraph");
|
||||
|
@ -58,13 +66,13 @@ function forward_selected_messages_and_go_to_drafts_folder(f) {
|
|||
|
||||
plan_for_window_close(cwc);
|
||||
// mwc is modal window controller
|
||||
plan_for_modal_dialog("commonDialog", function click_save (mwc) {
|
||||
//accept saving
|
||||
mwc.window.document.documentElement.getButton('accept').doCommand();
|
||||
});
|
||||
plan_for_modal_dialog("commonDialog", function click_save(mwc) {
|
||||
// accept saving
|
||||
mwc.window.document.documentElement.getButton("accept").doCommand();
|
||||
});
|
||||
|
||||
// quit -> do you want to save ?
|
||||
cwc.window.goDoCommand('cmd_close');
|
||||
cwc.window.goDoCommand("cmd_close");
|
||||
// wait for the modal dialog to return
|
||||
wait_for_modal_dialog();
|
||||
// Actually quit the window.
|
||||
|
@ -74,7 +82,7 @@ function forward_selected_messages_and_go_to_drafts_folder(f) {
|
|||
be_in_folder(gDrafts);
|
||||
}
|
||||
|
||||
function test_forward_inline () {
|
||||
function test_forward_inline() {
|
||||
be_in_folder(folder);
|
||||
// original message header
|
||||
let oMsgHdr = select_click_row(0);
|
||||
|
@ -92,14 +100,14 @@ function test_forward_inline () {
|
|||
// well
|
||||
to_mime_message(fMsgHdr, null, function(aMsgHdr, aMimeMsg) {
|
||||
assert_equals(aMimeMsg.headers["x-forwarded-message-id"],
|
||||
"<"+oMsgHdr.messageId+">");
|
||||
assert_equals(aMimeMsg.headers["references"],
|
||||
"<"+oMsgHdr.messageId+">");
|
||||
"<" + oMsgHdr.messageId + ">");
|
||||
assert_equals(aMimeMsg.headers.references,
|
||||
"<" + oMsgHdr.messageId + ">");
|
||||
});
|
||||
press_delete(mc);
|
||||
}
|
||||
|
||||
function test_forward_as_attachments () {
|
||||
function test_forward_as_attachments() {
|
||||
be_in_folder(folder);
|
||||
// original message header
|
||||
let oMsgHdr0 = select_click_row(0);
|
||||
|
@ -122,9 +130,9 @@ function test_forward_as_attachments () {
|
|||
// well
|
||||
to_mime_message(fMsgHdr, null, function(aMsgHdr, aMimeMsg) {
|
||||
assert_equals(aMimeMsg.headers["x-forwarded-message-id"],
|
||||
"<"+oMsgHdr0.messageId+"> <"+oMsgHdr1.messageId+">");
|
||||
assert_equals(aMimeMsg.headers["references"],
|
||||
"<"+oMsgHdr0.messageId+"> <"+oMsgHdr1.messageId+">");
|
||||
"<" + oMsgHdr0.messageId + "> <" + oMsgHdr1.messageId + ">");
|
||||
assert_equals(aMimeMsg.headers.references,
|
||||
"<" + oMsgHdr0.messageId + "> <" + oMsgHdr1.messageId + ">");
|
||||
});
|
||||
|
||||
press_delete(mc);
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
* It's easiest to test the forward case.
|
||||
*/
|
||||
|
||||
// mozmake SOLO_TEST=composition/test-forward-rfc822-attach.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-forward-rfc822-attach";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-forward-rfc822-attach";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
* Tests that UTF-8 messages are correctly forwarded.
|
||||
*/
|
||||
|
||||
// mozmake SOLO_TEST=composition/test-forward-utf8.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-forward-utf8";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-forward-utf8";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-forwarded-content";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-forwarded-content";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"window-helpers", "compose-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
var folder = null;
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
* an .eml message that's attached to another mail.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-forwarded-eml-actions.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-forwarded-eml-actions";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-forwarded-eml-actions";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"compose-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
@ -81,7 +81,7 @@ var setupModule = function(module) {
|
|||
|
||||
folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
|
||||
folder.addMessage(source);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper to open an attached .eml file, invoke the hotkey and check some
|
||||
|
@ -113,7 +113,7 @@ function setupWindowAndTest(hotkeyToHit, hotkeyModifiers) {
|
|||
let subjectText = compWin.e("msgSubject").value;
|
||||
if (!subjectText.includes(msgsubject))
|
||||
throw new Error("subject text didn't contain the original subject; " +
|
||||
"msgsubject=" + msgsubject + ", subjectText=" + subjectText);
|
||||
"msgsubject=" + msgsubject + ", subjectText=" + subjectText);
|
||||
|
||||
close_compose_window(compWin, false);
|
||||
close_window(msgWin);
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
* Tests that we load and display embedded images in messages.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-image-display.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-image-display";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-image-display";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [ "folder-display-helpers", "window-helpers",
|
||||
"compose-helpers" ];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
|
|
@ -8,24 +8,32 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-image-insertion-dialog";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"keyboard-helpers",
|
||||
];
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'window-helpers', 'keyboard-helpers'];
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
var fdh, ch, wh, kh;
|
||||
|
||||
function setupModule(module) {
|
||||
fdh = collector.getModule('folder-display-helpers');
|
||||
fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
ch = collector.getModule("compose-helpers");
|
||||
ch.installInto(module);
|
||||
wh = collector.getModule('window-helpers');
|
||||
wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
kh = collector.getModule('keyboard-helpers');
|
||||
kh = collector.getModule("keyboard-helpers");
|
||||
kh.installInto(module);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
* Tests that multipart/related messages are handled properly.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-multipart-related.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-multipart-related";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-multipart-related";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
|
@ -47,11 +48,11 @@ function getMsgHeaders(aMsgHdr) {
|
|||
_done: false,
|
||||
_data: new Map(),
|
||||
_text: new Map(),
|
||||
endMessage: function () { this._done = true; },
|
||||
deliverPartData: function (num, text) {
|
||||
endMessage() { this._done = true; },
|
||||
deliverPartData(num, text) {
|
||||
this._text.set(num, this._text.get(num) + text);
|
||||
},
|
||||
startPart: function (num, headers) {
|
||||
startPart(num, headers) {
|
||||
this._data.set(num, headers);
|
||||
this._text.set(num, "");
|
||||
},
|
||||
|
@ -84,7 +85,7 @@ function test_basic_multipart_related() {
|
|||
let fileURL = fileHandler.getURLSpecFromFile(file);
|
||||
|
||||
// Add a simple image to our dialog
|
||||
plan_for_modal_dialog("imageDlg", function (dialog) {
|
||||
plan_for_modal_dialog("imageDlg", function(dialog) {
|
||||
// Insert the url of the image.
|
||||
dialog.type(null, fileURL);
|
||||
dialog.type(dialog.eid("altTextInput"), "Alt text");
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-newmsg-compose-identity";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-newmsg-compose-identity";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"window-helpers", "compose-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
* mail-reply-to, and reply to self.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-reply-addresses.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-reply-addresses";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-reply-addresses";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"window-helpers", "compose-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "compose-helpers"];
|
||||
|
||||
var folder;
|
||||
var i = 0;
|
||||
|
@ -182,7 +182,7 @@ function testReplyToMungedReplyToList() {
|
|||
clobberHeaders: {
|
||||
"Reply-To": "Munged List <munged.list@example.com>",
|
||||
"List-Post": "<mailto:munged.list@example.com>",
|
||||
}
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -203,15 +203,15 @@ function testReplyToMungedReplyToList() {
|
|||
"addr_to": [
|
||||
"Munged List <munged.list@example.com>",
|
||||
"someone.else@example.com",
|
||||
"Tester <test@example.com>"
|
||||
]
|
||||
"Tester <test@example.com>",
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
checkReply(
|
||||
open_compose_with_reply_to_list,
|
||||
{
|
||||
"addr_to": ["munged.list@example.com"]
|
||||
"addr_to": ["munged.list@example.com"],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ function testToCcReply() {
|
|||
to: "Mr Burns <mrburns@example.com>, workers@example.com, " +
|
||||
myEmail,
|
||||
cc: "Lisa <lisa@example.com>",
|
||||
subject: "testToCcReply - normal mail with to and cc (me in To)"
|
||||
subject: "testToCcReply - normal mail with to and cc (me in To)",
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -247,7 +247,7 @@ function testToCcReply() {
|
|||
// Cc: identity Cc list, including self.
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -262,7 +262,7 @@ function testToCcReplyAll() {
|
|||
to: "Mr Burns <mrburns@example.com>, workers@example.com, " +
|
||||
myEmail,
|
||||
cc: "Lisa <lisa@example.com>",
|
||||
subject: "testToCcReplyAll - normal mail with to and cc (me in To)"
|
||||
subject: "testToCcReplyAll - normal mail with to and cc (me in To)",
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -279,7 +279,7 @@ function testToCcReplyAll() {
|
|||
"addr_to": ["Homer <homer@example.com>",
|
||||
"Mr Burns <mrburns@example.com>",
|
||||
"workers@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -294,7 +294,7 @@ function testToCcReplyAll() {
|
|||
"workers@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>",
|
||||
myEmail,
|
||||
"smithers@example.com"]
|
||||
"smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -311,11 +311,15 @@ function testToCcReplyAllInternational() {
|
|||
"=?KOI8-R?Q?=E9=D7=C1=CE?= <ivan@example.com>, " + myEmail,
|
||||
cc: "=?Big5?B?pP2oca1e?= <xiuying@example.com>",
|
||||
subject: "testToCcReplyAllInternational - non-ascii people mail with to and cc (me in To)",
|
||||
clobberHeaders: { 'Content-Transfer-Encoding': 'quoted-printable' },
|
||||
clobberHeaders: { "Content-Transfer-Encoding": "quoted-printable" },
|
||||
// Content-Transfer-Encoding ^^^ should be set from the body encoding below,
|
||||
//but that doesn't seem to work. (No Content-Transfer-Encoding header is
|
||||
// but that doesn't seem to work. (No Content-Transfer-Encoding header is
|
||||
// generated).
|
||||
body: {charset: "windows-1251", encoding: "quoted-printable", body: "=CF=F0=E8=E2=E5=F2 =E8=E7 =CC=EE=F1=EA=E2=FB"}
|
||||
body: {
|
||||
charset: "windows-1251",
|
||||
encoding: "quoted-printable",
|
||||
body: "=CF=F0=E8=E2=E5=F2 =E8=E7 =CC=EE=F1=EA=E2=FB",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -333,7 +337,7 @@ function testToCcReplyAllInternational() {
|
|||
"Mr Burns <mrburns@example.com>",
|
||||
"Åke <ake@example.com>",
|
||||
"Иван <ivan@example.com>"],
|
||||
"addr_cc": ["王秀英 <xiuying@example.com>"]
|
||||
"addr_cc": ["王秀英 <xiuying@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -347,7 +351,7 @@ function testToCcReplyAllInternational() {
|
|||
"Mr Burns <mrburns@example.com>",
|
||||
"Åke <ake@example.com>",
|
||||
"Иван <ivan@example.com>"],
|
||||
"addr_cc": ["王秀英 <xiuying@example.com>", "Åsa <asa@example.com>"]
|
||||
"addr_cc": ["王秀英 <xiuying@example.com>", "Åsa <asa@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -364,8 +368,8 @@ function testToCcReplyWhenReplyToSet() {
|
|||
cc: "Lisa <lisa@example.com>, " + myEmail,
|
||||
subject: "testToCcReplyWhenReplyToSet - to/cc mail with reply-to set (me in Cc)",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "marge@example.com"
|
||||
}
|
||||
"Reply-To": "marge@example.com",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -387,7 +391,7 @@ function testToCcReplyWhenReplyToSet() {
|
|||
// Cc: auto-Ccs
|
||||
{
|
||||
"addr_to": ["marge@example.com"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -404,8 +408,8 @@ function testToCcReplyAllWhenReplyToSet() {
|
|||
cc: "Lisa <lisa@example.com>, " + myEmail,
|
||||
subject: "testToCcReplyAllWhenReplyToSet - to/cc mail with reply-to set (me in Cc)",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "marge@example.com"
|
||||
}
|
||||
"Reply-To": "marge@example.com",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -421,7 +425,7 @@ function testToCcReplyAllWhenReplyToSet() {
|
|||
{
|
||||
"addr_to": ["marge@example.com",
|
||||
"workers@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -433,7 +437,7 @@ function testToCcReplyAllWhenReplyToSet() {
|
|||
{
|
||||
"addr_to": ["marge@example.com",
|
||||
"workers@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -449,8 +453,8 @@ function testReplyToList() {
|
|||
cc: "Lisa <lisa@example.com>, " + myEmail,
|
||||
subject: "testReplyToList - mailing list message (me in Cc)",
|
||||
clobberHeaders: {
|
||||
"List-Post": "<mailto:workers-list@example.com>"
|
||||
}
|
||||
"List-Post": "<mailto:workers-list@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -472,7 +476,7 @@ function testReplyToList() {
|
|||
// Cc: auto-Ccs
|
||||
{
|
||||
"addr_to": ["workers-list@example.com"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -489,8 +493,8 @@ function testReplySenderForListPost() {
|
|||
cc: "Lisa <lisa@example.com>, " + myEmail,
|
||||
subject: "testReplySenderForListPost - mailing list message (me in Cc)",
|
||||
clobberHeaders: {
|
||||
"List-Post": "<mailto:workers-list@example.com>"
|
||||
}
|
||||
"List-Post": "<mailto:workers-list@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -512,7 +516,7 @@ function testReplySenderForListPost() {
|
|||
// Cc: auto-Ccs
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -528,8 +532,8 @@ function testReplyToAllForListPost() {
|
|||
cc: "Lisa <lisa@example.com>, " + myEmail,
|
||||
subject: "testReplyToAllForListPost - mailing list message (me in Cc)",
|
||||
clobberHeaders: {
|
||||
"List-Post": "<mailto:workers-list@example.com>"
|
||||
}
|
||||
"List-Post": "<mailto:workers-list@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -544,7 +548,7 @@ function testReplyToAllForListPost() {
|
|||
// Cc: original CC without me
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "workers-list@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -555,7 +559,7 @@ function testReplyToAllForListPost() {
|
|||
// Cc: original CC + auto-Ccs (including me!)
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "workers-list@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -573,8 +577,8 @@ function testReplyToListWhenReplyToSet() {
|
|||
subject: "testReplyToListWhenReplyToSet - mailing list message w/ cc, reply-to (me in To)",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "marge@example.com",
|
||||
"List-Post": "<mailto:workers-list@example.com>"
|
||||
}
|
||||
"List-Post": "<mailto:workers-list@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -589,7 +593,7 @@ function testReplyToListWhenReplyToSet() {
|
|||
// Cc: original Cc
|
||||
{
|
||||
"addr_to": ["marge@example.com", "workers-list@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -600,7 +604,7 @@ function testReplyToListWhenReplyToSet() {
|
|||
// Cc: original Cc + auto-Ccs
|
||||
{
|
||||
"addr_to": ["marge@example.com", "workers-list@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -619,8 +623,8 @@ function testMailReplyTo() {
|
|||
subject: "testMailReplyTo - mail with Mail-Reply-To header",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "workers-list@example.com", // reply-to munging
|
||||
"Mail-Reply-To": "Homer S. <homer@example.com>"
|
||||
}
|
||||
"Mail-Reply-To": "Homer S. <homer@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -642,7 +646,7 @@ function testMailReplyTo() {
|
|||
// Cc: auto-Ccs
|
||||
{
|
||||
"addr_to": ["Homer S. <homer@example.com>"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -662,8 +666,8 @@ function testMailFollowupTo() {
|
|||
clobberHeaders: {
|
||||
// Homer is on the list, and don't want extra copies, so he has
|
||||
// set the Mail-Followup-To header so followups go to the list.
|
||||
"Mail-Followup-To": "workers-list@example.com"
|
||||
}
|
||||
"Mail-Followup-To": "workers-list@example.com",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -685,7 +689,7 @@ function testMailFollowupTo() {
|
|||
// Cc: auto-Ccs
|
||||
{
|
||||
"addr_to": ["workers-list@example.com"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"]
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -702,8 +706,8 @@ function testReplyToSelfReply() {
|
|||
subject: "testReplyToSelfReply - reply to self",
|
||||
clobberHeaders: {
|
||||
"Bcc": "Moe <moe@example.com>",
|
||||
"Reply-To": "Flanders <flanders@example.com>"
|
||||
}
|
||||
"Reply-To": "Flanders <flanders@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -718,7 +722,7 @@ function testReplyToSelfReply() {
|
|||
// Reply-To: original Reply-To
|
||||
{
|
||||
"addr_to": ["Bart <bart@example.com>", "Maggie <maggie@example.com>"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -731,7 +735,7 @@ function testReplyToSelfReply() {
|
|||
{
|
||||
"addr_to": ["Bart <bart@example.com>", "Maggie <maggie@example.com>"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -749,8 +753,8 @@ function testReplyToSelfReplyAll() {
|
|||
subject: "testReplyToSelfReplyAll - reply to self",
|
||||
clobberHeaders: {
|
||||
"Bcc": "Moe <moe@example.com>",
|
||||
"Reply-To": "Flanders <flanders@example.com>"
|
||||
}
|
||||
"Reply-To": "Flanders <flanders@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -770,7 +774,7 @@ function testReplyToSelfReplyAll() {
|
|||
"Maggie <maggie@example.com>"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
"addr_bcc": ["Moe <moe@example.com>"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -787,7 +791,7 @@ function testReplyToSelfReplyAll() {
|
|||
"Maggie <maggie@example.com>"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
"addr_bcc": ["Moe <moe@example.com>"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -806,8 +810,8 @@ function testReplyToSelfNotOriginalSourceMsgReplyAll() {
|
|||
cc: "Lisa <lisa@example.com>",
|
||||
subject: "testReplyToSelfNotOriginalSourceMsgReplyAll - reply to self",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "Flanders <flanders@example.com>"
|
||||
}
|
||||
"Reply-To": "Flanders <flanders@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -828,7 +832,7 @@ function testReplyToSelfNotOriginalSourceMsgReplyAll() {
|
|||
"Maggie <maggie@example.com>"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
"addr_bcc": [myEmail, "smithers@example.com"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoBcc(identity2);
|
||||
|
@ -846,7 +850,7 @@ function testReplyToSelfNotOriginalSourceMsgReplyAll() {
|
|||
"Maggie <maggie@example.com>"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>", myEmail, "smithers@example.com"],
|
||||
"addr_bcc": ["moe@example.com"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity2);
|
||||
|
@ -864,7 +868,7 @@ function testReplyToSelfNotOriginalSourceMsgReplyAll() {
|
|||
"Maggie <maggie@example.com>"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
"addr_bcc": [myEmail2, "smithers@example.com"],
|
||||
"addr_reply": ["Flanders <flanders@example.com>"]
|
||||
"addr_reply": ["Flanders <flanders@example.com>"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoBcc(identity2);
|
||||
|
@ -881,8 +885,8 @@ function testReplyToOtherIdentity() {
|
|||
cc: "Lisa <lisa@example.com>",
|
||||
subject: "testReplyToOtherIdentity - reply to other identity",
|
||||
clobberHeaders: {
|
||||
"Reply-To": "secretary@example.com"
|
||||
}
|
||||
"Reply-To": "secretary@example.com",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -899,7 +903,7 @@ function testReplyToOtherIdentity() {
|
|||
//
|
||||
{
|
||||
"addr_to": ["secretary@example.com", "barney@example.com"],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"]
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -916,8 +920,8 @@ function testReplyToSelfWithBccs() {
|
|||
subject: "testReplyToSelfWithBccs - reply to self",
|
||||
clobberHeaders: {
|
||||
"Bcc": "Moe <moe@example.com>, Barney <barney@example.com>",
|
||||
"Reply-To": myEmail2
|
||||
}
|
||||
"Reply-To": myEmail2,
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -936,7 +940,7 @@ function testReplyToSelfWithBccs() {
|
|||
"addr_to": [myEmail],
|
||||
"addr_cc": [myEmail2, "Lisa <lisa@example.com>"],
|
||||
"addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"],
|
||||
"addr_reply": [myEmail2]
|
||||
"addr_reply": [myEmail2],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -952,8 +956,8 @@ function testReplyToOtherIdentityWithBccs() {
|
|||
cc: "Lisa <lisa@example.com>",
|
||||
subject: "testReplyToOtherIdentityWithBccs - reply to other identity",
|
||||
clobberHeaders: {
|
||||
"Bcc": "Moe <moe@example.com>, Barney <barney@example.com>"
|
||||
}
|
||||
"Bcc": "Moe <moe@example.com>, Barney <barney@example.com>",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -970,7 +974,7 @@ function testReplyToOtherIdentityWithBccs() {
|
|||
{
|
||||
"addr_to": [myEmail2],
|
||||
"addr_cc": ["Lisa <lisa@example.com>"],
|
||||
"addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"]
|
||||
"addr_bcc": ["Moe <moe@example.com>", "Barney <barney@example.com>"],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -984,8 +988,8 @@ function testNewsgroupsReplyAll() {
|
|||
to: "test1-list@example.org",
|
||||
subject: "testNewsgroupsReplyAll - sent to two newsgroups and a list",
|
||||
clobberHeaders: {
|
||||
"Newsgroups": "example.test1, example.test2"
|
||||
}
|
||||
"Newsgroups": "example.test1, example.test2",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -1000,7 +1004,7 @@ function testNewsgroupsReplyAll() {
|
|||
// Newsgroups: original Ccs
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
|
||||
"addr_newsgroups": ["example.test1", "example.test2"]
|
||||
"addr_newsgroups": ["example.test1", "example.test2"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -1012,7 +1016,7 @@ function testNewsgroupsReplyAll() {
|
|||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
"addr_newsgroups": ["example.test1", "example.test2"]
|
||||
"addr_newsgroups": ["example.test1", "example.test2"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -1029,8 +1033,8 @@ function testNewsgroupsReplyAllFollowupTo() {
|
|||
subject: "testNewsgroupsReplyAllFollowupTo - Followup-To set",
|
||||
clobberHeaders: {
|
||||
"Newsgroups": "example.test1, example.test2",
|
||||
"Followup-To": "example.test2"
|
||||
}
|
||||
"Followup-To": "example.test2",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
@ -1045,7 +1049,7 @@ function testNewsgroupsReplyAllFollowupTo() {
|
|||
// Newsgroups: <Followup-To>
|
||||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
|
||||
"addr_newsgroups": ["example.test2"]
|
||||
"addr_newsgroups": ["example.test2"],
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -1058,7 +1062,7 @@ function testNewsgroupsReplyAllFollowupTo() {
|
|||
{
|
||||
"addr_to": ["Homer <homer@example.com>", "test1-list@example.org"],
|
||||
"addr_cc": [myEmail, "smithers@example.com"],
|
||||
"addr_newsgroups": ["example.test2"]
|
||||
"addr_newsgroups": ["example.test2"],
|
||||
}
|
||||
);
|
||||
stopUsingAutoCc(identity);
|
||||
|
@ -1073,7 +1077,7 @@ function testToFromWithReplyTo() {
|
|||
from: myEmail,
|
||||
to: myEmail,
|
||||
subject: "testToFromWithReplyTo - To=From w/ Reply-To set",
|
||||
clobberHeaders: { "Reply-To": "Flanders <flanders@example.com>" }
|
||||
clobberHeaders: { "Reply-To": "Flanders <flanders@example.com>" },
|
||||
});
|
||||
add_message_to_folder(folder, msg0);
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
* Tests that the reply to a format=flowed message is also flowed.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-reply-format-flowed.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-reply-format-flowed";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-reply-format-flowed";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -20,12 +20,13 @@
|
|||
* and enforcing the charset default.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-reply-multipart-charset.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-reply-multipart-charset";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-reply-multipart-charset";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
|
|
|
@ -6,15 +6,21 @@
|
|||
* Tests the mail.strip_sig_on_reply pref.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-reply-signature.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-reply-signature";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-message-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-reply-signature";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers",
|
||||
"message-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"message-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -35,8 +41,8 @@ function setupModule(module) {
|
|||
"get with the \n flow! get with the flow!\n-- \n" + sig + "\n",
|
||||
contentType: "text/plain",
|
||||
charset: "UTF-8",
|
||||
format: "flowed"
|
||||
}
|
||||
format: "flowed",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg);
|
||||
let msg2 = create_message({
|
||||
|
@ -46,11 +52,11 @@ function setupModule(module) {
|
|||
"not flowed!\n-- \n" + sig + "\n",
|
||||
contentType: "text/plain",
|
||||
charset: "UTF-8",
|
||||
format: ""
|
||||
}
|
||||
format: "",
|
||||
},
|
||||
});
|
||||
add_message_to_folder(folder, msg2);
|
||||
};
|
||||
}
|
||||
|
||||
/** Test sig strip true for format flowed. */
|
||||
function test_sig_strip_true_ff() {
|
||||
|
@ -95,8 +101,7 @@ function check_sig_strip_works(aRow, aShouldStrip) {
|
|||
|
||||
if (aShouldStrip && body.textContent.includes(sig)) {
|
||||
throw new Error("signature was not stripped; body=" + body.textContent);
|
||||
}
|
||||
else if (!aShouldStrip && !body.textContent.includes(sig)) {
|
||||
} else if (!aShouldStrip && !body.textContent.includes(sig)) {
|
||||
throw new Error("signature stripped; body=" + body.textContent);
|
||||
}
|
||||
close_compose_window(rwc);
|
||||
|
|
|
@ -8,17 +8,24 @@
|
|||
* that we don't prompt if there are no changes.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-save-changes-on-quit.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-save-changes-on-quit";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-prompt-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-save-changes-on-quit";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"prompt-helpers", "window-helpers"];
|
||||
var SAVE = 0
|
||||
var CANCEL = 1
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"prompt-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var SAVE = 0;
|
||||
var CANCEL = 1;
|
||||
var DONT_SAVE = 2;
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -172,7 +179,7 @@ function test_window_quit_state_reset_on_aborted_quit() {
|
|||
|
||||
if (numOfPrompts > 1)
|
||||
gMockPromptService.returnValue = CANCEL;
|
||||
}
|
||||
};
|
||||
|
||||
gMockPromptService.returnValue = DONT_SAVE;
|
||||
|
||||
|
|
|
@ -8,11 +8,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-send-button";
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-send-button";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers",
|
||||
"window-helpers", "address-book-helpers"];
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"address-book-helpers",
|
||||
];
|
||||
|
||||
var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
|
@ -20,7 +28,7 @@ var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm"
|
|||
|
||||
var account = null;
|
||||
|
||||
var setupModule = function (module) {
|
||||
function setupModule(module) {
|
||||
collector.getModule("folder-display-helpers").installInto(module);
|
||||
collector.getModule("compose-helpers").installInto(module);
|
||||
collector.getModule("window-helpers").installInto(module);
|
||||
|
@ -32,7 +40,7 @@ var setupModule = function (module) {
|
|||
account = MailServices.accounts.FindAccountForServer(server);
|
||||
let inbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
|
||||
be_in_folder(inbox);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the send commands are in the wished state.
|
||||
|
@ -59,7 +67,6 @@ function check_send_commands_state(aCwc, aEnabled) {
|
|||
* by the user.
|
||||
*/
|
||||
function test_send_enabled_manual_address() {
|
||||
let isMac = AppConstants.platform == "macosx";
|
||||
let cwc = open_compose_new_mail(); // compose controller
|
||||
// On an empty window, Send must be disabled.
|
||||
check_send_commands_state(cwc, false);
|
||||
|
|
|
@ -7,19 +7,18 @@
|
|||
* in the composition.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-send-format.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-send-format";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-send-format";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
|
||||
const nsIMsgCompConvertible = Ci.nsIMsgCompConvertible;
|
||||
|
||||
function setupModule(module) {
|
||||
for (let lib of MODULE_REQUIRES) {
|
||||
collector.getModule(lib).installInto(module);
|
||||
|
@ -44,14 +43,14 @@ function checkMsgFile(aFilePath, aConvertibility) {
|
|||
* Tests that we only open one compose window for one instance of a draft.
|
||||
*/
|
||||
function test_msg_convertibility() {
|
||||
checkMsgFile("./format1-plain.eml", nsIMsgCompConvertible.Plain);
|
||||
checkMsgFile("./format1-plain.eml", Ci.nsIMsgCompConvertible.Plain);
|
||||
|
||||
// Bug 1385636
|
||||
checkMsgFile("./format1-altering.eml", nsIMsgCompConvertible.Altering);
|
||||
checkMsgFile("./format1-altering.eml", Ci.nsIMsgCompConvertible.Altering);
|
||||
|
||||
// Bug 584313
|
||||
checkMsgFile("./format2-style-attr.eml", nsIMsgCompConvertible.No);
|
||||
checkMsgFile("./format3-style-tag.eml", nsIMsgCompConvertible.No);
|
||||
checkMsgFile("./format2-style-attr.eml", Ci.nsIMsgCompConvertible.No);
|
||||
checkMsgFile("./format3-style-tag.eml", Ci.nsIMsgCompConvertible.No);
|
||||
}
|
||||
|
||||
function teardownModule() {
|
||||
|
|
|
@ -9,21 +9,23 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-signature-init';
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['compose-helpers',
|
||||
'folder-display-helpers'];
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var kHtmlPref = 'mail.identity.default.compose_html';
|
||||
var kReplyOnTopPref = 'mail.identity.default.reply_on_top';
|
||||
var MODULE_NAME = "test-signature-init";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["compose-helpers", "folder-display-helpers"];
|
||||
|
||||
var kHtmlPref = "mail.identity.default.compose_html";
|
||||
var kReplyOnTopPref = "mail.identity.default.reply_on_top";
|
||||
var kReplyOnTop = 1;
|
||||
var kSigBottomPref = 'mail.identity.default.sig_bottom';
|
||||
var kSigBottomPref = "mail.identity.default.sig_bottom";
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function setupModule(module) {
|
||||
collector.getModule('folder-display-helpers').installInto(module);
|
||||
collector.getModule('compose-helpers').installInto(module);
|
||||
collector.getModule("folder-display-helpers").installInto(module);
|
||||
collector.getModule("compose-helpers").installInto(module);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -45,8 +47,8 @@ function test_on_reply_above_signature_below_reply() {
|
|||
let mailBody = get_compose_body(cw);
|
||||
|
||||
let node = mailBody.firstChild;
|
||||
assert_equals(node.localName, 'br',
|
||||
'Expected a BR node to start the compose body.');
|
||||
assert_equals(node.localName, "br",
|
||||
"Expected a BR node to start the compose body.");
|
||||
|
||||
Services.prefs.setBoolPref(kHtmlPref, origHtml);
|
||||
Services.prefs.setIntPref(kReplyOnTopPref, origReplyOnTop);
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
* Tests that the signature updates properly when switching identities.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=composition/test-signature-updating.js mozmill-one
|
||||
|
||||
// mail.identity.id1.htmlSigFormat = false
|
||||
// mail.identity.id1.htmlSigText = "Tinderbox is soo 90ies"
|
||||
|
||||
|
@ -16,15 +14,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-signature-updating";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-signature-updating";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var cwc = null; // compose window controller
|
||||
|
||||
var setupModule = function (module) {
|
||||
function setupModule(module) {
|
||||
for (let lib of MODULE_REQUIRES) {
|
||||
collector.getModule(lib).installInto(module);
|
||||
}
|
||||
|
@ -34,7 +36,7 @@ var setupModule = function (module) {
|
|||
let server = MailServices.accounts.FindServer("tinderbox", FAKE_SERVER_HOSTNAME, "pop3");
|
||||
let inbox = get_special_folder(Ci.nsMsgFolderFlags.Inbox, false, server);
|
||||
be_in_folder(inbox);
|
||||
};
|
||||
}
|
||||
|
||||
function teardownModule(module) {
|
||||
Services.prefs.clearUserPref("mail.compose.default_to_paragraph");
|
||||
|
|
|
@ -4,12 +4,21 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-compose-mailto';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'window-helpers', 'keyboard-helpers',
|
||||
'content-tab-helpers'];
|
||||
var MODULE_NAME = "test-compose-mailto";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
"keyboard-helpers",
|
||||
"content-tab-helpers",
|
||||
];
|
||||
|
||||
var folder = null;
|
||||
var composeHelper = null;
|
||||
|
@ -21,20 +30,20 @@ var gPreCount;
|
|||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-policy/html', 'content');
|
||||
var url = collector.addHttpResource("../content-policy/html", "content");
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let kh = collector.getModule('keyboard-helpers');
|
||||
let kh = collector.getModule("keyboard-helpers");
|
||||
kh.installInto(module);
|
||||
composeHelper = collector.getModule('compose-helpers');
|
||||
composeHelper = collector.getModule("compose-helpers");
|
||||
composeHelper.installInto(module);
|
||||
windowHelper = collector.getModule('window-helpers');
|
||||
windowHelper = collector.getModule("window-helpers");
|
||||
windowHelper.installInto(module);
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
};
|
||||
}
|
||||
|
||||
function test_openComposeFromMailToLink() {
|
||||
// Open a content tab with the mailto link in it.
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-dns-prefetch";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'content-tab-helpers'];
|
||||
var MODULE_NAME = "test-dns-prefetch";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "content-tab-helpers"];
|
||||
|
||||
var folder = null;
|
||||
var composeHelper = null;
|
||||
|
@ -24,31 +26,30 @@ var gMsgHdr = null;
|
|||
|
||||
// These two constants are used to build the message body.
|
||||
var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
|
||||
'<html>\n' +
|
||||
'<head>\n' +
|
||||
'\n' +
|
||||
"<html>\n" +
|
||||
"<head>\n" +
|
||||
"\n" +
|
||||
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
|
||||
'</head>\n' +
|
||||
"</head>\n" +
|
||||
'<body bgcolor="#ffffff" text="#000000">\n' +
|
||||
'dns prefetch test message\n' +
|
||||
'</body>\n</html>\n';
|
||||
"dns prefetch test message\n" +
|
||||
"</body>\n</html>\n";
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
composeHelper = collector.getModule('compose-helpers');
|
||||
composeHelper = collector.getModule("compose-helpers");
|
||||
composeHelper.installInto(module);
|
||||
let cth = collector.getModule('content-tab-helpers');
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
|
||||
folder = create_folder("dnsPrefetch");
|
||||
};
|
||||
}
|
||||
|
||||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@mozillamessaging.invalid";
|
||||
.generateUUID() + "@mozillamessaging.invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
"X-Mozilla-Status: 0001\n" +
|
||||
|
@ -160,8 +161,8 @@ function test_dnsPrefetch_contentTab() {
|
|||
// in the data of what we want.
|
||||
let preCount = mc.tabmail.tabContainer.childNodes.length;
|
||||
|
||||
let dataurl = 'data:text/html,<html><head><title>test dns prefetch</title>' +
|
||||
'</head><body>test dns prefetch</body></html>';
|
||||
let dataurl = "data:text/html,<html><head><title>test dns prefetch</title>" +
|
||||
"</head><body>test dns prefetch</body></html>";
|
||||
|
||||
let newTab = open_content_tab_with_url(dataurl);
|
||||
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-exposed-in-content-tabs';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'compose-helpers',
|
||||
'content-tab-helpers'];
|
||||
var MODULE_NAME = "test-exposed-in-content-tabs";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "content-tab-helpers"];
|
||||
|
||||
var folder = null;
|
||||
var composeHelper = null;
|
||||
|
@ -21,35 +23,34 @@ var gMsgNo = 0;
|
|||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-policy/html', 'content');
|
||||
var url = collector.addHttpResource("../content-policy/html", "content");
|
||||
|
||||
// These two constants are used to build the message body.
|
||||
var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
|
||||
'<html>\n' +
|
||||
'<head>\n' +
|
||||
'\n' +
|
||||
"<html>\n" +
|
||||
"<head>\n" +
|
||||
"\n" +
|
||||
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
|
||||
'</head>\n' +
|
||||
"</head>\n" +
|
||||
'<body bgcolor="#ffffff" text="#000000">\n' +
|
||||
'<img id="testelement" src="' + url + 'pass.png"/>\n' +
|
||||
'</body>\n</html>\n';
|
||||
"</body>\n</html>\n";
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
composeHelper = collector.getModule('compose-helpers');
|
||||
composeHelper = collector.getModule("compose-helpers");
|
||||
composeHelper.installInto(module);
|
||||
let cth = collector.getModule('content-tab-helpers');
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
|
||||
folder = create_folder("exposedInContent");
|
||||
};
|
||||
}
|
||||
|
||||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@mozillamessaging.invalid";
|
||||
.generateUUID() + "@mozillamessaging.invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
"X-Mozilla-Status: 0001\n" +
|
||||
|
@ -108,7 +109,7 @@ function checkContentTab(msgURL) {
|
|||
// in the data of what we want.
|
||||
let preCount = mc.tabmail.tabContainer.childNodes.length;
|
||||
|
||||
let dataurl = 'data:text/html,<html><head><title>test exposed</title>' +
|
||||
let dataurl = "data:text/html,<html><head><title>test exposed</title>" +
|
||||
'</head><body><iframe id="msgIframe" src="' + msgURL + '"/></body></html>';
|
||||
|
||||
let newTab = open_content_tab_with_url(dataurl);
|
||||
|
|
|
@ -17,17 +17,25 @@
|
|||
* - Feed message
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=content-policy/test-general-content-policy.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-general-content-policy';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-keyboard-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-notificationbox-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
|
||||
'compose-helpers', 'content-tab-helpers',
|
||||
'keyboard-helpers',
|
||||
'notificationbox-helpers'];
|
||||
var MODULE_NAME = "test-general-content-policy";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"compose-helpers",
|
||||
"content-tab-helpers",
|
||||
"keyboard-helpers",
|
||||
"notificationbox-helpers",
|
||||
];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
|
||||
|
@ -40,7 +48,7 @@ var gMsgNo = 0;
|
|||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-policy/html', 'content');
|
||||
var url = collector.addHttpResource("../content-policy/html", "content");
|
||||
|
||||
/**
|
||||
* The TESTS array is constructed from objects containing the following:
|
||||
|
@ -65,7 +73,7 @@ var TESTS = [
|
|||
checkForAllowed: function img_checkAllowed(element) {
|
||||
return element.QueryInterface(Ci.nsIImageLoadingContent)
|
||||
.imageBlockingStatus == Ci.nsIContentPolicy.ACCEPT;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "Video",
|
||||
|
@ -74,7 +82,7 @@ var TESTS = [
|
|||
webPage: "remotevideo.html",
|
||||
checkForAllowed: function video_checkAllowed(element) {
|
||||
return element.networkState != element.NETWORK_NO_SOURCE;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "Image-Data",
|
||||
|
@ -84,34 +92,33 @@ var TESTS = [
|
|||
checkForAllowed: function img_checkAllowed(element) {
|
||||
return element.QueryInterface(Ci.nsIImageLoadingContent)
|
||||
.imageBlockingStatus == Ci.nsIContentPolicy.ACCEPT;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// These two constants are used to build the message body.
|
||||
var msgBodyStart = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
|
||||
'<html>\n' +
|
||||
'<head>\n' +
|
||||
'\n' +
|
||||
"<html>\n" +
|
||||
"<head>\n" +
|
||||
"\n" +
|
||||
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
|
||||
'</head>\n' +
|
||||
"</head>\n" +
|
||||
'<body bgcolor="#ffffff" text="#000000">\n';
|
||||
|
||||
var msgBodyEnd = '</body>\n</html>\n';
|
||||
var msgBodyEnd = "</body>\n</html>\n";
|
||||
|
||||
var setupModule = function (module) {
|
||||
function setupModule(module) {
|
||||
for (let dep of MODULE_REQUIRES) {
|
||||
collector.getModule(dep).installInto(module);
|
||||
}
|
||||
|
||||
folder = create_folder("generalContentPolicy");
|
||||
};
|
||||
}
|
||||
|
||||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@mozillamessaging.invalid";
|
||||
.generateUUID() + "@mozillamessaging.invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
"X-Mozilla-Status: 0001\n" +
|
||||
|
@ -374,7 +381,6 @@ function checkAllowForHostsWithPerms(test) {
|
|||
}
|
||||
|
||||
function test_generalContentPolicy() {
|
||||
let folderTab = mc.tabmail.currentTabInfo;
|
||||
be_in_folder(folder);
|
||||
|
||||
assert_nothing_selected();
|
||||
|
|
|
@ -9,20 +9,20 @@
|
|||
* folder of that account to be emptied multiple times.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=content-policy/test-js-content-policy.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-js-content-policy';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-js-content-policy";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder = null;
|
||||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-policy/html', 'content');
|
||||
var url = collector.addHttpResource("../content-policy/html", "content");
|
||||
|
||||
function setupModule(module) {
|
||||
for (let lib of MODULE_REQUIRES) {
|
||||
|
@ -31,17 +31,16 @@ function setupModule(module) {
|
|||
|
||||
folder = create_folder("jsContentPolicy");
|
||||
Services.prefs.setBoolPref("javascript.enabled", true);
|
||||
};
|
||||
}
|
||||
|
||||
function teardownModule(module) {
|
||||
Services.prefs.clearUserPref("javascript.enabled");
|
||||
}
|
||||
|
||||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@mozillamessaging.invalid";
|
||||
.generateUUID() + "@mozillamessaging.invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
"X-Mozilla-Status: 0001\n" +
|
||||
|
@ -68,24 +67,24 @@ function addToFolder(aSubject, aBody, aFolder) {
|
|||
}
|
||||
|
||||
var jsMsgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
|
||||
'<html>\n' +
|
||||
'<head>\n' +
|
||||
'\n' +
|
||||
"<html>\n" +
|
||||
"<head>\n" +
|
||||
"\n" +
|
||||
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
|
||||
'</head>\n' +
|
||||
"</head>\n" +
|
||||
'<body bgcolor="#ffffff" text="#000000">\n' +
|
||||
'this is a test<big><big><big> stuff\n' +
|
||||
'<br><br>\n' +
|
||||
'</big></big></big>\n' +
|
||||
'<noscript>\n'+
|
||||
'hello, this content is noscript!\n' +
|
||||
'</noscript>\n' +
|
||||
'<script>\n'+
|
||||
'var jsIsTurnedOn = true;\n' +
|
||||
'</script>\n' +
|
||||
'\n' +
|
||||
'</body>\n' +
|
||||
'</html>\n';
|
||||
"this is a test<big><big><big> stuff\n" +
|
||||
"<br><br>\n" +
|
||||
"</big></big></big>\n" +
|
||||
"<noscript>\n" +
|
||||
"hello, this content is noscript!\n" +
|
||||
"</noscript>\n" +
|
||||
"<script>\n" +
|
||||
"var jsIsTurnedOn = true;\n" +
|
||||
"</script>\n" +
|
||||
"\n" +
|
||||
"</body>\n" +
|
||||
"</html>\n";
|
||||
|
||||
var gMsgNo = 0;
|
||||
|
||||
|
@ -102,7 +101,7 @@ function checkJsInMail() {
|
|||
|
||||
let mc = mozmill.getMail3PaneController();
|
||||
// This works because messagepane is type=content-primary in these tests.
|
||||
if (typeof mc.window.content.wrappedJSObject.jsIsTurnedOn != 'undefined')
|
||||
if (typeof mc.window.content.wrappedJSObject.jsIsTurnedOn != "undefined")
|
||||
throw new Error("JS is turned on in mail - it shouldn't be.");
|
||||
|
||||
let noscript = mc.window.content.wrappedJSObject.document
|
||||
|
@ -122,7 +121,7 @@ function checkJsInNonMessageContent() {
|
|||
|
||||
// load something non-message-like in the message pane
|
||||
mc.window.GetMessagePaneFrame().location.href =
|
||||
"data:text/html;charset=utf-8,<script>var jsIsTurnedOn%3Dtrue%3B<%2Fscript>bar"+
|
||||
"data:text/html;charset=utf-8,<script>var jsIsTurnedOn%3Dtrue%3B<%2Fscript>bar" +
|
||||
"<noscript><p id='noscript-p'>hey this is noscript</p>";
|
||||
|
||||
wait_for_message_display_completion();
|
||||
|
@ -246,7 +245,6 @@ function checkJsInRemoteContent() {
|
|||
}
|
||||
|
||||
function test_jsContentPolicy() {
|
||||
let folderTab = mc.tabmail.currentTabInfo;
|
||||
be_in_folder(folder);
|
||||
|
||||
assert_nothing_selected();
|
||||
|
@ -263,5 +261,4 @@ function test_jsContentPolicy() {
|
|||
checkJsInFeedContent();
|
||||
checkJsInRemoteContent();
|
||||
checkJsInFeedTab();
|
||||
|
||||
}
|
||||
|
|
|
@ -9,11 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-plugins-policy';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers',
|
||||
'compose-helpers', 'content-tab-helpers'];
|
||||
var MODULE_NAME = "test-plugins-policy";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"window-helpers",
|
||||
"compose-helpers",
|
||||
"content-tab-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -23,36 +31,36 @@ var gMsgNo = 0;
|
|||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-policy/html', 'content');
|
||||
var url = collector.addHttpResource("../content-policy/html", "content");
|
||||
|
||||
// These two constants are used to build the message body.
|
||||
var msgBody = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n' +
|
||||
'<html>\n' +
|
||||
'<head>\n' +
|
||||
'\n' +
|
||||
"<html>\n" +
|
||||
"<head>\n" +
|
||||
"\n" +
|
||||
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">\n' +
|
||||
'</head>\n' +
|
||||
"</head>\n" +
|
||||
'<body bgcolor="#ffffff" text="#000000">\n' +
|
||||
'<embed id="testelement" type="application/x-test" width="400" height="400" border="1"></embed>\n' +
|
||||
'</body>\n</html>\n';
|
||||
"</body>\n</html>\n";
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
composeHelper = collector.getModule('compose-helpers');
|
||||
composeHelper = collector.getModule("compose-helpers");
|
||||
composeHelper.installInto(module);
|
||||
let cth = collector.getModule('content-tab-helpers');
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
|
||||
folder = create_folder("pluginPolicy");
|
||||
};
|
||||
}
|
||||
|
||||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@mozillamessaging.invalid";
|
||||
.generateUUID() + "@mozillamessaging.invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
|
||||
|
@ -85,8 +93,7 @@ function isPluginLoaded(contentDocument) {
|
|||
// if setColor throws, then the plugin isn't running
|
||||
element.setColor("FFFF0000");
|
||||
return true;
|
||||
}
|
||||
catch (ex) {
|
||||
} catch (ex) {
|
||||
// Any errors and we'll just return false below - they may be expected.
|
||||
}
|
||||
return false;
|
||||
|
@ -169,12 +176,8 @@ function test_3paneWindowDeniedAgain() {
|
|||
assert_selected_and_displayed(0);
|
||||
|
||||
// Now check that the content hasn't been loaded
|
||||
if (isPluginLoaded(mozmill.getMail3PaneController().window
|
||||
.content.document) != false)
|
||||
throw new Error(loadAllowed ?
|
||||
"Plugin has been unexpectedly blocked in message content" :
|
||||
"Plugin has not been blocked in message as expected");
|
||||
|
||||
if (isPluginLoaded(mozmill.getMail3PaneController().window.content.document))
|
||||
throw new Error("Plugin has not been blocked in message as expected");
|
||||
}
|
||||
|
||||
function test_checkStandaloneMessageWindowDenied() {
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
* Test that view-source content can be reloaded to change encoding.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=content-policy/test-view-source.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-view-source";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-view-source";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
|
@ -32,7 +32,7 @@ function setupModule(module) {
|
|||
function addToFolder(aSubject, aBody, aFolder) {
|
||||
let msgId = Cc["@mozilla.org/uuid-generator;1"]
|
||||
.getService(Ci.nsIUUIDGenerator)
|
||||
.generateUUID() +"@invalid";
|
||||
.generateUUID() + "@invalid";
|
||||
|
||||
let source = "From - Sat Nov 1 12:39:54 2008\n" +
|
||||
"X-Mozilla-Status: 0001\n" +
|
||||
|
|
|
@ -9,7 +9,7 @@ var themes = [
|
|||
headerURL: "test.png",
|
||||
footerURL: "test.png",
|
||||
textcolor: "#fff",
|
||||
accentcolor: "#6b6b6b"
|
||||
accentcolor: "#6b6b6b",
|
||||
},
|
||||
{
|
||||
id: "test-02",
|
||||
|
@ -17,8 +17,8 @@ var themes = [
|
|||
headerURL: "test.png",
|
||||
footerURL: "test.png",
|
||||
textcolor: "#bcf",
|
||||
accentcolor: "#8888FF"
|
||||
}
|
||||
accentcolor: "#8888FF",
|
||||
},
|
||||
];
|
||||
|
||||
const INSTALL = "InstallBrowserTheme";
|
||||
|
|
|
@ -4,13 +4,22 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-about-support';
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
|
||||
'compose-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-about-support";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"content-tab-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["DOMParser"]);
|
||||
|
||||
var warningText = new Map();
|
||||
|
@ -111,7 +120,7 @@ function find_private_element(aTab) {
|
|||
.querySelector("#accounts-table td.data-private~td.data-private");
|
||||
assert_true(elem != null);
|
||||
assert_true(elem.textContent.length > 0);
|
||||
assert_equals(get_content_tab_element_display(aTab,elem), "none");
|
||||
assert_equals(get_content_tab_element_display(aTab, elem), "none");
|
||||
return elem;
|
||||
}
|
||||
|
||||
|
@ -258,8 +267,7 @@ function test_private_data() {
|
|||
function check_text_in_body(aDocument, aText) {
|
||||
if (typeof(aDocument) == "object")
|
||||
return (get_element_by_text(aDocument, aText) != null);
|
||||
else
|
||||
return aDocument.includes(aText);
|
||||
return aDocument.includes(aText);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
* 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/. */
|
||||
|
||||
// make SOLO_TEST=content-tabs/test-addons-mgr.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-addons-mgr";
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-addons-mgr";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers", "window-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
|
@ -21,22 +21,22 @@ function setupModule(module) {
|
|||
}
|
||||
|
||||
function test_open_addons_with_url() {
|
||||
mc.window.openAddonsMgr('addons://list/theme');
|
||||
mc.window.openAddonsMgr("addons://list/theme");
|
||||
mc.sleep(0);
|
||||
|
||||
let tab = mc.tabmail.currentTabInfo;
|
||||
wait_for_content_tab_load(tab, 'about:addons', 10000);
|
||||
assert_true(content_tab_e(tab, 'category-theme').selected,
|
||||
wait_for_content_tab_load(tab, "about:addons", 10000);
|
||||
assert_true(content_tab_e(tab, "category-theme").selected,
|
||||
"Themes category should be selected!");
|
||||
|
||||
mc.tabmail.switchToTab(0); // switch to 3pane
|
||||
|
||||
mc.window.openAddonsMgr('addons://list/plugin');
|
||||
mc.window.openAddonsMgr("addons://list/plugin");
|
||||
mc.sleep(0);
|
||||
|
||||
tab = mc.tabmail.currentTabInfo;
|
||||
wait_for_content_tab_load(tab, 'about:addons', 10000);
|
||||
assert_true(content_tab_e(tab, 'category-plugin').selected,
|
||||
wait_for_content_tab_load(tab, "about:addons", 10000);
|
||||
assert_true(content_tab_e(tab, "category-plugin").selected,
|
||||
"Plugins category should be selected!");
|
||||
|
||||
mc.tabmail.closeTab(tab);
|
||||
|
@ -54,13 +54,13 @@ function test_addon_prefs() {
|
|||
let popups = mc.click_menus_in_sequence(mc.e("appmenu-popup"), [ { id: "appmenu_addons" } ], true);
|
||||
|
||||
let foundAddon = false;
|
||||
plan_for_modal_dialog("mozmill-prefs", function (controller) {
|
||||
plan_for_modal_dialog("mozmill-prefs", function(controller) {
|
||||
// Add |mc.sleep(1000);| here to see the popup dialog.
|
||||
controller.window.close();
|
||||
});
|
||||
|
||||
// MozMill add-on should be somewhere in the list. When found, click it.
|
||||
for (let item of popups[popups.length-1].children) {
|
||||
for (let item of popups[popups.length - 1].children) {
|
||||
if (item.tagName == "menuitem" && item.getAttribute("collapsed") != "true" &&
|
||||
item.label == "MozMill") {
|
||||
foundAddon = true;
|
||||
|
|
|
@ -4,11 +4,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-content-tab';
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-dom-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
|
||||
'dom-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-content-tab";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [
|
||||
"folder-display-helpers",
|
||||
"content-tab-helpers",
|
||||
"dom-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
|
||||
var mozmill = ChromeUtils.import("chrome://mozmill/content/modules/mozmill.jsm");
|
||||
|
@ -19,7 +27,7 @@ var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
// so we get the right path for the resources.
|
||||
// Note: this one adds to '' as we need to make sure that favicon.ico is in the
|
||||
// root directory.
|
||||
var url = collector.addHttpResource('../content-tabs/html', '');
|
||||
var url = collector.addHttpResource("../content-tabs/html", "");
|
||||
var whatsUrl = url + "whatsnew.html";
|
||||
|
||||
function setupModule(module) {
|
||||
|
@ -148,15 +156,15 @@ function test_content_tab_default_favicon() {
|
|||
|
||||
function test_content_tab_onbeforeunload() {
|
||||
let count = mc.tabmail.tabContainer.childNodes.length;
|
||||
let tab = mc.tabmail.tabInfo[count-1];
|
||||
tab.browser.contentWindow.addEventListener("beforeunload", function (event) {
|
||||
let tab = mc.tabmail.tabInfo[count - 1];
|
||||
tab.browser.contentWindow.addEventListener("beforeunload", function(event) {
|
||||
event.returnValue = "Green llama in your car";
|
||||
});
|
||||
|
||||
const interactionPref = "dom.require_user_interaction_for_beforeunload";
|
||||
Services.prefs.setBoolPref(interactionPref, false);
|
||||
|
||||
plan_for_modal_dialog("commonDialog", function (controller) {
|
||||
plan_for_modal_dialog("commonDialog", function(controller) {
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
});
|
||||
mc.tabmail.closeTab(tab);
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-install-xpi';
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['window-helpers', 'folder-display-helpers',
|
||||
'content-tab-helpers'];
|
||||
var MODULE_NAME = "test-install-xpi";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["window-helpers", "folder-display-helpers", "content-tab-helpers"];
|
||||
|
||||
var controller = ChromeUtils.import("chrome://mozmill/content/modules/controller.jsm");
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
@ -17,23 +19,23 @@ var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../content-tabs/html', 'content-tabs');
|
||||
var url = collector.addHttpResource("../content-tabs/html", "content-tabs");
|
||||
|
||||
var gDocument;
|
||||
var gNewTab;
|
||||
|
||||
var setupModule = function (module) {
|
||||
let wh = collector.getModule('window-helpers');
|
||||
function setupModule(module) {
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let cth = collector.getModule('content-tab-helpers');
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
|
||||
gDocument = mc.window.document;
|
||||
gNewTab = open_content_tab_with_url(url + "installxpi.html",
|
||||
"specialTabs.siteClickHandler(event, new RegExp('^" + url + "'));");
|
||||
};
|
||||
}
|
||||
|
||||
var teardownModule = function(module) {
|
||||
mc.tabmail.closeTab(gNewTab);
|
||||
|
|
|
@ -10,19 +10,22 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-cookies';
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-cookies";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ['window-helpers', 'content-tab-helpers', 'folder-display-helpers'];
|
||||
var MODULE_REQUIRES = ["window-helpers", "content-tab-helpers", "folder-display-helpers"];
|
||||
|
||||
// RELATIVE_ROOT messes with the collector, so we have to bring the path back
|
||||
// so we get the right path for the resources.
|
||||
var url = collector.addHttpResource('../cookies/html', 'cookies');
|
||||
var url = collector.addHttpResource("../cookies/html", "cookies");
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
|
@ -49,5 +52,5 @@ function test_load_cookie_result_page() {
|
|||
throw new Error("Document has no cookie :-(");
|
||||
|
||||
if (cookie != "name=CookieTest")
|
||||
throw new Error("Cookie set incorrectly, expected: name=CookieTest, got: " +cookie + "\n");
|
||||
throw new Error("Cookie set incorrectly, expected: name=CookieTest, got: " + cookie + "\n");
|
||||
}
|
||||
|
|
|
@ -6,19 +6,25 @@
|
|||
* Test about:downloads.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=downloads/test-about-downloads.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-about-downloads";
|
||||
/* import-globals-from ../shared-modules/test-attachment-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-dom-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-prompt-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-about-downloads";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = [ 'attachment-helpers',
|
||||
'content-tab-helpers',
|
||||
'dom-helpers',
|
||||
'folder-display-helpers',
|
||||
'prompt-helpers',
|
||||
'window-helpers' ];
|
||||
var MODULE_REQUIRES = [
|
||||
"attachment-helpers",
|
||||
"content-tab-helpers",
|
||||
"dom-helpers",
|
||||
"folder-display-helpers",
|
||||
"prompt-helpers",
|
||||
"window-helpers",
|
||||
];
|
||||
|
||||
var elementslib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
var downloads = ChromeUtils.import("resource://gre/modules/Downloads.jsm");
|
||||
|
@ -62,33 +68,33 @@ var downloadsView = {
|
|||
let finished = false;
|
||||
Promise.all(succeededPromises).then(() => finished = true, Cu.reportError);
|
||||
mc.waitFor(() => finished, "Timeout waiting for downloads to complete.");
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function prepare_messages() {
|
||||
let folder = create_folder("about:downloads");
|
||||
let msgSet = make_new_sets_in_folder(folder, [
|
||||
make_new_sets_in_folder(folder, [
|
||||
{
|
||||
count: 1,
|
||||
attachments: [{
|
||||
filename: attachmentFileNames[0],
|
||||
body: "Body"
|
||||
}]
|
||||
body: "Body",
|
||||
}],
|
||||
},
|
||||
{
|
||||
count: 1,
|
||||
attachments: [{
|
||||
filename: attachmentFileNames[1],
|
||||
body: "Body"
|
||||
}]
|
||||
body: "Body",
|
||||
}],
|
||||
},
|
||||
{
|
||||
count: 1,
|
||||
attachments: [{
|
||||
filename: attachmentFileNames[2],
|
||||
body: "Body"
|
||||
}]
|
||||
}
|
||||
body: "Body",
|
||||
}],
|
||||
},
|
||||
]);
|
||||
be_in_folder(folder);
|
||||
}
|
||||
|
@ -205,7 +211,7 @@ function test_remove_file() {
|
|||
let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
|
||||
wait_for_popup_to_open(contextMenu);
|
||||
mc.click_menus_in_sequence(contextMenu, [
|
||||
{ command: "msgDownloadsCmd_remove" }
|
||||
{ command: "msgDownloadsCmd_remove" },
|
||||
]);
|
||||
mc.waitFor(() => downloadsView.count == 2,
|
||||
"Timeout waiting for removing a saved attachment file.");
|
||||
|
@ -239,7 +245,7 @@ function test_remove_multiple_files() {
|
|||
let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
|
||||
wait_for_popup_to_open(contextMenu);
|
||||
mc.click_menus_in_sequence(contextMenu, [
|
||||
{ command: "msgDownloadsCmd_remove" }
|
||||
{ command: "msgDownloadsCmd_remove" },
|
||||
]);
|
||||
mc.waitFor(() => downloadsView.count == 1,
|
||||
"Timeout waiting for removing two saved attachment files.");
|
||||
|
@ -266,7 +272,7 @@ function test_clear_all_files() {
|
|||
let contextMenu = content_tab_e(downloadsTab, "msgDownloadsContextMenu");
|
||||
wait_for_popup_to_open(contextMenu);
|
||||
mc.click_menus_in_sequence(contextMenu, [
|
||||
{ command: "msgDownloadsCmd_clearDownloads" }
|
||||
{ command: "msgDownloadsCmd_clearDownloads" },
|
||||
]);
|
||||
mc.waitFor(() => downloadsView.count == 0,
|
||||
"Timeout waiting for clearing all saved attachment files.");
|
||||
|
@ -286,7 +292,7 @@ function teardownTest() {
|
|||
mc.waitFor(() => downloadsView.count == 0,
|
||||
"Timeout waiting for clearing all saved attachment files.");
|
||||
let empty = content_tab_e(downloadsTab, "msgDownloadsListEmptyDescription");
|
||||
mc.waitFor(() => empty.hidden == false,
|
||||
mc.waitFor(() => empty.hidden === false,
|
||||
"Timeout waiting for msgDownloadsListEmptyDescription is visible.");
|
||||
}
|
||||
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-archive-messages';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-archive-messages";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder;
|
||||
|
||||
|
@ -17,9 +19,9 @@ var folder;
|
|||
var NUM_MESSAGES_IN_THREAD = 6;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("ThreadedMessages");
|
||||
|
@ -93,7 +95,7 @@ function test_batch_archiver() {
|
|||
/* Test archiving a partial selection */
|
||||
let child2 = select_click_row(1);
|
||||
let child3 = select_click_row(2);
|
||||
let child4 = select_click_row(3);
|
||||
select_click_row(3);
|
||||
|
||||
select_shift_click_row(2);
|
||||
select_shift_click_row(1);
|
||||
|
|
|
@ -8,17 +8,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-close-window-on-delete';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-close-window-on-delete";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("CloseWindowOnDeleteA");
|
||||
|
@ -35,11 +37,11 @@ function disabled_test_close_message_window_on_delete_from_message_window() {
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_window();
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_window();
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -67,12 +69,12 @@ function disabled_test_close_multiple_message_windows_on_delete_from_message_win
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_window();
|
||||
let msgcA = open_selected_message_in_new_window();
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_window();
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -103,12 +105,12 @@ function disabled_test_close_multiple_message_windows_on_delete_from_3pane_windo
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_window();
|
||||
let msgcA = open_selected_message_in_new_window();
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_window();
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -140,11 +142,11 @@ function test_close_message_tab_on_delete_from_message_tab() {
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_tab(true);
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_tab(true);
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -173,12 +175,12 @@ function disabled_test_close_multiple_message_tabs_on_delete_from_message_tab()
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_tab(true);
|
||||
let msgcA = open_selected_message_in_new_tab(true);
|
||||
open_selected_message_in_new_tab(true);
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_tab(true);
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -207,12 +209,12 @@ function disabled_test_close_multiple_message_tabs_on_delete_from_3pane_window()
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_tab(true);
|
||||
let msgcA = open_selected_message_in_new_tab(true);
|
||||
open_selected_message_in_new_tab(true);
|
||||
open_selected_message_in_new_tab(true);
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_tab(true);
|
||||
|
||||
let preCount = folder.getTotalMessages(false);
|
||||
|
@ -242,12 +244,12 @@ function disabled_test_close_multiple_windows_tabs_on_delete_from_3pane_window()
|
|||
be_in_folder(folder);
|
||||
|
||||
// select the first message
|
||||
let firstMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// display it
|
||||
let msgc = open_selected_message_in_new_tab(true);
|
||||
open_selected_message_in_new_tab(true);
|
||||
let msgcA = open_selected_message_in_new_window();
|
||||
|
||||
let secondMessage = select_click_row(1);
|
||||
select_click_row(1);
|
||||
let msgc2 = open_selected_message_in_new_tab(true);
|
||||
let msgc2A = open_selected_message_in_new_window();
|
||||
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
// needed to zero inter-folder processing delay
|
||||
var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
|
||||
/*
|
||||
* Test column default logic and persistence logic. Persistence comes in both
|
||||
* tab-switching (because of the multiplexed implementation) and
|
||||
* folder-switching forms.
|
||||
*/
|
||||
|
||||
// make mozmill-one SOLO_TEST=folder-display/test-columns.js
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-columns';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-columns";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
// needed to zero inter-folder processing delay
|
||||
var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
|
||||
var folderInbox, folderSent, folderVirtual, folderA, folderB;
|
||||
// INBOX_DEFAULTS sans 'dateCol' but gains 'tagsCol'
|
||||
|
@ -40,9 +40,9 @@ var VIRTUAL_DEFAULTS;
|
|||
var GLODA_DEFAULTS;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
useCorrespondent =
|
||||
|
@ -55,7 +55,7 @@ function setupModule(module) {
|
|||
"unreadButtonColHeader",
|
||||
useCorrespondent ? "correspondentCol" : "senderCol",
|
||||
"junkStatusCol",
|
||||
"dateCol"
|
||||
"dateCol",
|
||||
];
|
||||
SENT_DEFAULTS = [
|
||||
"threadCol",
|
||||
|
@ -65,7 +65,7 @@ function setupModule(module) {
|
|||
"unreadButtonColHeader",
|
||||
useCorrespondent ? "correspondentCol" : "recipientCol",
|
||||
"junkStatusCol",
|
||||
"dateCol"
|
||||
"dateCol",
|
||||
];
|
||||
VIRTUAL_DEFAULTS = [
|
||||
"threadCol",
|
||||
|
@ -76,7 +76,7 @@ function setupModule(module) {
|
|||
useCorrespondent ? "correspondentCol" : "senderCol",
|
||||
"junkStatusCol",
|
||||
"dateCol",
|
||||
"locationCol"
|
||||
"locationCol",
|
||||
];
|
||||
GLODA_DEFAULTS = [
|
||||
"threadCol",
|
||||
|
@ -84,7 +84,7 @@ function setupModule(module) {
|
|||
"subjectCol",
|
||||
useCorrespondent ? "correspondentCol" : "senderCol",
|
||||
"dateCol",
|
||||
"locationCol"
|
||||
"locationCol",
|
||||
];
|
||||
|
||||
// create the source
|
||||
|
@ -394,7 +394,7 @@ function test_reset_to_inbox() {
|
|||
}
|
||||
|
||||
function subtest_say_yes(cwc) {
|
||||
cwc.window.document.documentElement.getButton('accept').doCommand();
|
||||
cwc.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
||||
function _apply_to_folder_common(aChildrenToo, folder) {
|
||||
|
@ -496,7 +496,7 @@ function test_apply_to_folder_no_children_swapped() {
|
|||
// Hide the columns that were added in other tests, since reset now
|
||||
// only resets the order.
|
||||
hide_column("tagsCol");
|
||||
hide_column("sizeCol")
|
||||
hide_column("sizeCol");
|
||||
|
||||
// permute!
|
||||
let conExtra = [...INBOX_DEFAULTS];
|
||||
|
@ -581,7 +581,7 @@ function wait_for_columns_state_updated() {
|
|||
const STATE_PREF = "mailnews.database.global.views.global";
|
||||
let columns_state_updated = function() {
|
||||
gColumnStateUpdated = true;
|
||||
}
|
||||
};
|
||||
Services.prefs.addObserver(STATE_PREF, columns_state_updated);
|
||||
mc.waitFor(() => gColumnStateUpdated, "Timeout waiting for columns state updated.");
|
||||
Services.prefs.removeObserver(STATE_PREF, columns_state_updated);
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-deletion-from-virtual-folders';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-deletion-from-virtual-folders";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var baseFolder, folder, lastMessageFolder;
|
||||
|
||||
|
@ -25,9 +27,9 @@ var setNormal;
|
|||
var msgc;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
baseFolder = create_folder("DeletionFromVirtualFoldersA");
|
||||
|
@ -46,13 +48,13 @@ function setupModule(module) {
|
|||
mc.assertNode(mc.eid("mailviews-container"));
|
||||
}
|
||||
|
||||
/// Check whether this message is displayed in the folder tab
|
||||
// Check whether this message is displayed in the folder tab
|
||||
var VERIFY_FOLDER_TAB = 0x1;
|
||||
/// Check whether this message is displayed in the foreground message tab
|
||||
// Check whether this message is displayed in the foreground message tab
|
||||
var VERIFY_MESSAGE_TAB = 0x2;
|
||||
/// Check whether this message is displayed in the background message tab
|
||||
// Check whether this message is displayed in the background message tab
|
||||
var VERIFY_BACKGROUND_MESSAGE_TAB = 0x4;
|
||||
/// Check whether this message is displayed in the message window
|
||||
// Check whether this message is displayed in the message window
|
||||
var VERIFY_MESSAGE_WINDOW = 0x8;
|
||||
var VERIFY_ALL = 0xF;
|
||||
|
||||
|
|
|
@ -12,19 +12,21 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-deletion-with-multiple-displays';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-deletion-with-multiple-displays";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder, lastMessageFolder, oneBeforeFolder, oneAfterFolder,
|
||||
multipleDeletionFolder1, multipleDeletionFolder2, multipleDeletionFolder3,
|
||||
multipleDeletionFolder4;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("DeletionA");
|
||||
|
@ -91,13 +93,13 @@ function _open_message_in_all_four_display_mechanisms_helper(aFolder, aIndex) {
|
|||
assert_selected_and_displayed(msgc, curMessage);
|
||||
}
|
||||
|
||||
/// Check whether this message is displayed in the folder tab
|
||||
// Check whether this message is displayed in the folder tab
|
||||
var VERIFY_FOLDER_TAB = 0x1;
|
||||
/// Check whether this message is displayed in the foreground message tab
|
||||
// Check whether this message is displayed in the foreground message tab
|
||||
var VERIFY_MESSAGE_TAB = 0x2;
|
||||
/// Check whether this message is displayed in the background message tab
|
||||
// Check whether this message is displayed in the background message tab
|
||||
var VERIFY_BACKGROUND_MESSAGE_TAB = 0x4;
|
||||
/// Check whether this message is displayed in the message window
|
||||
// Check whether this message is displayed in the message window
|
||||
var VERIFY_MESSAGE_WINDOW = 0x8;
|
||||
var VERIFY_ALL = 0xF;
|
||||
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-display-name";
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-display-name";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
|
||||
|
||||
|
@ -180,7 +182,7 @@ function check_display_name(index, columnName, expectedName) {
|
|||
|
||||
// Select the nth message
|
||||
be_in_folder(folder);
|
||||
let curMessage = select_click_row(index);
|
||||
select_click_row(index);
|
||||
|
||||
let tree = mc.folderDisplay.tree;
|
||||
let cellText = tree.view.getCellText(index, tree.columns[columnIndex]);
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-displaying-messages-in-folder-tabs";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-search-window-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-displaying-messages-in-folder-tabs";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"search-window-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "search-window-helpers"];
|
||||
|
||||
var folderA;
|
||||
var folderB;
|
||||
|
@ -392,4 +394,4 @@ function test_display_message_scrolls_to_message() {
|
|||
*/
|
||||
function test_cleanup() {
|
||||
remove_from_toolbar(mc.e("mail-bar3"), "mailviews-container");
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,17 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-folder-pane-visibility";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-folder-pane-visibility";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("FolderPaneVisibility");
|
||||
|
@ -75,10 +77,9 @@ function assert_folder_pane_hidden(aFolderPaneIllegal) {
|
|||
if (aFolderPaneIllegal) {
|
||||
if (mc.e("folderpane_splitter").collapsed === false)
|
||||
throw new Error("folderpane_splitter should be collapsed!");
|
||||
//if (paneMenuItem.getAttribute("disabled") != "true")
|
||||
// if (paneMenuItem.getAttribute("disabled") != "true")
|
||||
// throw new Error("The Folder Pane menu item should be disabled.");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (mc.e("folderpane_splitter").collapsed === true)
|
||||
throw new Error("folderpane_splitter should not be collapsed!");
|
||||
if (paneMenuItem.getAttribute("checked") == "true")
|
||||
|
@ -198,8 +199,7 @@ function test_folder_pane_persistence_generally_works() {
|
|||
for (let [iTab, folderPaneVisible] of aConfig.entries()) {
|
||||
if (iTab == 0) {
|
||||
curState = folderPaneVisible;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
open_folder_in_new_tab(folder);
|
||||
if (curState != folderPaneVisible) {
|
||||
toggle_folder_pane();
|
||||
|
@ -230,7 +230,7 @@ function test_folder_pane_persistence_generally_works() {
|
|||
// 1st time: [+ - - + +]
|
||||
[1, 0, 0, 1, 1],
|
||||
// 2nd time: [- + + - -]
|
||||
[0, 1, 1, 0, 0]
|
||||
[0, 1, 1, 0, 0],
|
||||
];
|
||||
|
||||
for (let config of configs) {
|
||||
|
|
|
@ -9,15 +9,16 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-folder-toolbar";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-folder-toolbar";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folderA, folderB;
|
||||
|
||||
function setupModule(module)
|
||||
{
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule("window-helpers");
|
||||
|
@ -29,8 +30,7 @@ function setupModule(module)
|
|||
make_new_sets_in_folder(folderB, [{count: 1}]);
|
||||
}
|
||||
|
||||
function test_add_folder_toolbar()
|
||||
{
|
||||
function test_add_folder_toolbar() {
|
||||
// It should not be present by default
|
||||
let folderLoc = mc.eid("locationFolders");
|
||||
mc.assertNodeNotExist(folderLoc);
|
||||
|
@ -44,8 +44,7 @@ function test_add_folder_toolbar()
|
|||
"Uninitialized Folder doesn't have a default label.");
|
||||
}
|
||||
|
||||
function test_folder_toolbar_shows_correct_item()
|
||||
{
|
||||
function test_folder_toolbar_shows_correct_item() {
|
||||
add_to_toolbar(mc.e("mail-bar3"), "folder-location-container");
|
||||
let folderLoc = mc.eid("locationFolders");
|
||||
|
||||
|
@ -80,8 +79,7 @@ function test_folder_toolbar_shows_correct_item()
|
|||
close_tab(tabFolderB);
|
||||
}
|
||||
|
||||
function test_folder_toolbar_disappears_on_message_tab()
|
||||
{
|
||||
function test_folder_toolbar_disappears_on_message_tab() {
|
||||
add_to_toolbar(mc.e("mail-bar3"), "folder-location-container");
|
||||
be_in_folder(folderB);
|
||||
let folderLoc = mc.eid("locationFolders");
|
||||
|
@ -92,7 +90,7 @@ function test_folder_toolbar_disappears_on_message_tab()
|
|||
"The toolbar should be shown.");
|
||||
|
||||
// Select one message
|
||||
let msgHdr = select_click_row(0);
|
||||
select_click_row(0);
|
||||
// Open it
|
||||
let messageTab = open_selected_message_in_new_tab();
|
||||
|
||||
|
|
|
@ -10,10 +10,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-invalid-db-folder-load';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-invalid-db-folder-load";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder;
|
||||
var setA;
|
||||
|
@ -22,9 +24,9 @@ var curMessage;
|
|||
var nsMsgViewSortType = Ci.nsMsgViewSortType;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("InvalidMSF");
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-mail-views';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-mail-views";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var baseFolder, savedFolder;
|
||||
var setUntagged, setTagged;
|
||||
|
@ -16,9 +18,9 @@ var {MailViewConstants} = ChromeUtils.import("resource:///modules/MailViewManage
|
|||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
var setupModule = function(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
// Create a folder with some messages that have no tags and some that are
|
||||
|
|
|
@ -11,12 +11,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-message-commands-on-msgstore";
|
||||
/* import-globals-from ../shared-modules/test-compose-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-message-commands-on-msgstore";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers",
|
||||
"compose-helpers",
|
||||
"window-helpers"];
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "compose-helpers", "window-helpers"];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
@ -49,13 +50,13 @@ function setupModule(module) {
|
|||
let urlListener = {
|
||||
compactDone: false,
|
||||
|
||||
OnStartRunningUrl: function (aUrl) {
|
||||
OnStartRunningUrl(aUrl) {
|
||||
},
|
||||
OnStopRunningUrl: function (aUrl, aExitCode) {
|
||||
OnStopRunningUrl(aUrl, aExitCode) {
|
||||
assert_equals(aExitCode, 0);
|
||||
assert_true(gInbox.msgDatabase.summaryValid);
|
||||
this.compactDone = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// Compaction adds the X-Mozilla-Status rows into the messages
|
||||
|
@ -88,7 +89,7 @@ function check_status(aMsgHdr, aOffset, aStatusOffset, aStatus) {
|
|||
|
||||
let expectedStatusString = aStatus.toString(16);
|
||||
while (expectedStatusString.length < 4) {
|
||||
expectedStatusString = '0' + expectedStatusString;
|
||||
expectedStatusString = "0" + expectedStatusString;
|
||||
}
|
||||
|
||||
assert_equals(mboxstring.substr(aOffset + aStatusOffset, statusHeader.length),
|
||||
|
|
|
@ -10,11 +10,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-message-commands';
|
||||
/* import-globals-from ../shared-modules/test-content-tab-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'content-tab-helpers',
|
||||
'window-helpers'];
|
||||
var MODULE_NAME = "test-message-commands";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "content-tab-helpers", "window-helpers"];
|
||||
|
||||
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
|
@ -27,17 +29,17 @@ var acctMgr;
|
|||
var tagArray;
|
||||
|
||||
var setupModule = function(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let cth = collector.getModule('content-tab-helpers');
|
||||
let cth = collector.getModule("content-tab-helpers");
|
||||
cth.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
unreadFolder = create_folder('UnreadFolder');
|
||||
shiftDeleteFolder = create_folder('ShiftDeleteFolder');
|
||||
threadDeleteFolder = create_folder('ThreadDeleteFolder');
|
||||
archiveSrcFolder = create_folder('ArchiveSrc');
|
||||
unreadFolder = create_folder("UnreadFolder");
|
||||
shiftDeleteFolder = create_folder("ShiftDeleteFolder");
|
||||
threadDeleteFolder = create_folder("ThreadDeleteFolder");
|
||||
archiveSrcFolder = create_folder("ArchiveSrc");
|
||||
|
||||
make_new_sets_in_folder(unreadFolder, [{count: 2}]);
|
||||
make_new_sets_in_folder(shiftDeleteFolder, [{count: 3}]);
|
||||
|
@ -162,7 +164,6 @@ function test_mark_n_read_mixed() {
|
|||
curMessages[1].markRead(true);
|
||||
mark_read_via_menu(0, true);
|
||||
check_read_status(curMessages, true);
|
||||
|
||||
}
|
||||
|
||||
function test_mark_n_unread_mixed() {
|
||||
|
@ -270,35 +271,35 @@ function test_shift_delete_prompt() {
|
|||
let curMessage = select_click_row(0);
|
||||
|
||||
// First, try shift-deleting and then cancelling at the prompt.
|
||||
Services.prefs.setBoolPref('mail.warn_on_shift_delete', true);
|
||||
plan_for_modal_dialog('commonDialog', function(controller) {
|
||||
controller.window.document.documentElement.getButton('cancel').doCommand();
|
||||
Services.prefs.setBoolPref("mail.warn_on_shift_delete", true);
|
||||
plan_for_modal_dialog("commonDialog", function(controller) {
|
||||
controller.window.document.documentElement.getButton("cancel").doCommand();
|
||||
});
|
||||
// We don't use press_delete here because we're not actually deleting this
|
||||
// time!
|
||||
mc.keypress(null, 'VK_DELETE', {shiftKey: true});
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
mc.keypress(null, "VK_DELETE", {shiftKey: true});
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we didn't actually delete the message.
|
||||
assert_equals(curMessage, select_click_row(0));
|
||||
|
||||
// Second, try shift-deleting and then accepting the deletion.
|
||||
plan_for_modal_dialog('commonDialog', function(controller) {
|
||||
controller.window.document.documentElement.getButton('accept').doCommand();
|
||||
plan_for_modal_dialog("commonDialog", function(controller) {
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
});
|
||||
press_delete(mc, {shiftKey: true});
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we really did delete the message.
|
||||
assert_not_equals(curMessage, select_click_row(0));
|
||||
|
||||
// Finally, try shift-deleting when we turned off the prompt.
|
||||
Services.prefs.setBoolPref('mail.warn_on_shift_delete', false);
|
||||
Services.prefs.setBoolPref("mail.warn_on_shift_delete", false);
|
||||
curMessage = select_click_row(0);
|
||||
press_delete(mc, {shiftKey: true});
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we really did delete the message.
|
||||
assert_not_equals(curMessage, select_click_row(0));
|
||||
|
||||
Services.prefs.clearUserPref('mail.warn_on_shift_delete');
|
||||
Services.prefs.clearUserPref("mail.warn_on_shift_delete");
|
||||
}
|
||||
|
||||
function test_thread_delete_prompt() {
|
||||
|
@ -308,35 +309,35 @@ function test_thread_delete_prompt() {
|
|||
|
||||
let curMessage = select_click_row(0);
|
||||
// First, try deleting and then cancelling at the prompt.
|
||||
Services.prefs.setBoolPref('mail.warn_on_collapsed_thread_operation', true);
|
||||
plan_for_modal_dialog('commonDialog', function(controller) {
|
||||
controller.window.document.documentElement.getButton('cancel').doCommand();
|
||||
Services.prefs.setBoolPref("mail.warn_on_collapsed_thread_operation", true);
|
||||
plan_for_modal_dialog("commonDialog", function(controller) {
|
||||
controller.window.document.documentElement.getButton("cancel").doCommand();
|
||||
});
|
||||
// We don't use press_delete here because we're not actually deleting this
|
||||
// time!
|
||||
mc.keypress(null, 'VK_DELETE', {});
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
mc.keypress(null, "VK_DELETE", {});
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we didn't actually delete the message.
|
||||
assert_equals(curMessage, select_click_row(0));
|
||||
|
||||
// Second, try deleting and then accepting the deletion.
|
||||
plan_for_modal_dialog('commonDialog', function(controller) {
|
||||
controller.window.document.documentElement.getButton('accept').doCommand();
|
||||
plan_for_modal_dialog("commonDialog", function(controller) {
|
||||
controller.window.document.documentElement.getButton("accept").doCommand();
|
||||
});
|
||||
press_delete(mc);
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we really did delete the message.
|
||||
assert_not_equals(curMessage, select_click_row(0));
|
||||
|
||||
// Finally, try shift-deleting when we turned off the prompt.
|
||||
Services.prefs.setBoolPref('mail.warn_on_collapsed_thread_operation', false);
|
||||
Services.prefs.setBoolPref("mail.warn_on_collapsed_thread_operation", false);
|
||||
curMessage = select_click_row(0);
|
||||
press_delete(mc);
|
||||
wait_for_modal_dialog('commonDialog');
|
||||
wait_for_modal_dialog("commonDialog");
|
||||
// Make sure we really did delete the message.
|
||||
assert_not_equals(curMessage, select_click_row(0));
|
||||
|
||||
Services.prefs.clearUserPref('mail.warn_on_collapsed_thread_operation');
|
||||
Services.prefs.clearUserPref("mail.warn_on_collapsed_thread_operation");
|
||||
}
|
||||
|
||||
function test_yearly_archive() {
|
||||
|
@ -527,11 +528,11 @@ function test_tag_keys_disabled_in_content_tab() {
|
|||
be_in_folder(unreadFolder);
|
||||
let curMessage = select_click_row(0);
|
||||
|
||||
mc.window.openAddonsMgr('addons://list/theme');
|
||||
mc.window.openAddonsMgr("addons://list/theme");
|
||||
mc.sleep(0);
|
||||
|
||||
let tab = mc.tabmail.currentTabInfo;
|
||||
wait_for_content_tab_load(tab, 'about:addons', 15000);
|
||||
wait_for_content_tab_load(tab, "about:addons", 15000);
|
||||
|
||||
// Make sure pressing the "1" key in a content tab doesn't tag a message
|
||||
check_tag_in_message(curMessage, tagArray[0], false);
|
||||
|
|
|
@ -9,17 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-message-pane-visibility';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-message-pane-visibility";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folder;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("MessagePaneVisibility");
|
||||
|
@ -67,7 +69,6 @@ function test_toggle_message_pane_on() {
|
|||
* with a collapsed message pane.
|
||||
*/
|
||||
function test_collapsed_message_pane_does_not_break_message_tab() {
|
||||
|
||||
be_in_folder(folder);
|
||||
|
||||
// - toggle message pane off
|
||||
|
@ -170,8 +171,7 @@ function test_message_pane_persistence_generally_works() {
|
|||
for (let [iTab, messagePaneVisible] of aConfig.entries()) {
|
||||
if (iTab == 0) {
|
||||
curState = messagePaneVisible;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
open_folder_in_new_tab(folder);
|
||||
if (curState != messagePaneVisible) {
|
||||
toggle_message_pane();
|
||||
|
@ -202,7 +202,7 @@ function test_message_pane_persistence_generally_works() {
|
|||
// 1st time: [+ - - + +]
|
||||
[1, 0, 0, 1, 1],
|
||||
// 2nd time: [- + + - -]
|
||||
[0, 1, 1, 0, 0]
|
||||
[0, 1, 1, 0, 0],
|
||||
];
|
||||
for (let config of configs) {
|
||||
openTabs(config);
|
||||
|
@ -228,6 +228,5 @@ function test_message_pane_persistence_generally_works() {
|
|||
// restores it to + for when we are done.
|
||||
toggle_message_pane();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-message-reloads";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-message-reloads";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
|
|
|
@ -10,15 +10,16 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-message-size';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers'];
|
||||
var MODULE_NAME = "test-message-size";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
var folder;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
|
||||
folder = create_folder("MessageSizeA");
|
||||
|
@ -26,7 +27,7 @@ function setupModule(module) {
|
|||
// Create messages with sizes in the byte, KB, and MB ranges.
|
||||
let bytemsg = create_message({body: {body: " "}});
|
||||
|
||||
let kbstring = "x ".repeat(1024/2);
|
||||
let kbstring = "x ".repeat(1024 / 2);
|
||||
let kbmsg = create_message({body: {body: kbstring}});
|
||||
|
||||
let mbstring = kbstring.repeat(1024);
|
||||
|
@ -52,9 +53,9 @@ function _help_test_message_size(index, unit) {
|
|||
let abbrSize = parseFloat(sizeStr);
|
||||
|
||||
if (isNaN(abbrSize))
|
||||
throw new Error("formatted size is not numeric: '"+sizeStr+"'");
|
||||
if (Math.abs(realSize/Math.pow(1024, unit) - abbrSize) > 0.5)
|
||||
throw new Error("size mismatch: '"+realSize+"' and '"+sizeStr+"'");
|
||||
throw new Error("formatted size is not numeric: '" + sizeStr + "'");
|
||||
if (Math.abs(realSize / Math.pow(1024, unit) - abbrSize) > 0.5)
|
||||
throw new Error("size mismatch: '" + realSize + "' and '" + sizeStr + "'");
|
||||
}
|
||||
|
||||
function test_byte_message_size() {
|
||||
|
|
|
@ -9,18 +9,20 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-message-window';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-message-window";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folderA, folderB;
|
||||
var curMessage;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folderA = create_folder("MessageWindowA");
|
||||
|
@ -95,11 +97,10 @@ function test_del_collapsed_thread() {
|
|||
press_delete(msgc);
|
||||
if (folderA.getTotalMessages(false) != 4)
|
||||
throw new Error("should have only deleted one message");
|
||||
|
||||
}
|
||||
|
||||
function subtest_say_yes(cwc) {
|
||||
cwc.window.document.documentElement.getButton('accept').doCommand();
|
||||
cwc.window.document.documentElement.getButton("accept").doCommand();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,10 +10,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-opening-messages-without-a-backing-view';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-opening-messages-without-a-backing-view";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
|
||||
|
@ -26,17 +28,17 @@ var msgHdrsInFolder = null;
|
|||
// Number of messages to open for multi-message tests
|
||||
var NUM_MESSAGES_TO_OPEN = 5;
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("OpeningMessagesNoBackingViewA");
|
||||
make_new_sets_in_folder(folder, [{count: 10}]);
|
||||
// We don't obey mail view persistence unless the view picker is there
|
||||
add_to_toolbar(mc.e("mail-bar3"), "mailviews-container");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Test opening a single message without a backing view in a new tab.
|
||||
|
|
|
@ -18,10 +18,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-opening-messages';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-opening-messages";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
// One folder's enough
|
||||
var folder = null;
|
||||
|
@ -29,15 +31,15 @@ var folder = null;
|
|||
// Number of messages to open for multi-message tests
|
||||
var NUM_MESSAGES_TO_OPEN = 5;
|
||||
|
||||
var setupModule = function (module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("OpeningMessagesA");
|
||||
make_new_sets_in_folder(folder, [{count: 10}]);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Test opening a single message in a new tab.
|
||||
|
@ -196,7 +198,7 @@ function check_message_pane_in_window_full_height(aWC) {
|
|||
try {
|
||||
let childRect = child.getBoundingClientRect();
|
||||
childrenHeightsSum += childRect.height;
|
||||
childrenHeightsStr += '"' + child.id + '": ' + childRect.height + ', ';
|
||||
childrenHeightsStr += '"' + child.id + '": ' + childRect.height + ", ";
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-pane-focus";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-pane-focus";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
|
@ -38,7 +39,7 @@ function setupModule(module) {
|
|||
*/
|
||||
function get_focused_pane() {
|
||||
let panes = [
|
||||
"threadTree", "folderTree", "messagepane", "multimessage"
|
||||
"threadTree", "folderTree", "messagepane", "multimessage",
|
||||
].map(id => mc.e(id));
|
||||
|
||||
let currentNode = mc.window.top.document.activeElement;
|
||||
|
|
|
@ -10,15 +10,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-recent-menu";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
var {fixIterator} = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
|
||||
|
||||
var MODULE_NAME = 'test-recent-menu';
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
|
||||
var folder1, folder2;
|
||||
var gInitRecentMenuCount;
|
||||
|
||||
|
@ -39,7 +41,7 @@ var setupModule = function(module) {
|
|||
folder2 = create_folder("aaafolder2");
|
||||
|
||||
make_new_sets_in_folder(folder1, [{count: 3}]);
|
||||
}
|
||||
};
|
||||
|
||||
function test_move_message() {
|
||||
be_in_folder(folder1);
|
||||
|
@ -60,13 +62,13 @@ function test_move_message() {
|
|||
array.appendElement(msgHdr);
|
||||
let copyListener = {
|
||||
copyDone: false,
|
||||
OnStartCopy: function() {},
|
||||
OnProgress: function(aProgress, aProgressMax) {},
|
||||
SetMessageKey: function(aKey) { },
|
||||
SetMessageId: function(aMessageId) {},
|
||||
OnStopCopy: function(aStatus) {
|
||||
OnStartCopy() {},
|
||||
OnProgress(aProgress, aProgressMax) {},
|
||||
SetMessageKey(aKey) { },
|
||||
SetMessageId(aMessageId) {},
|
||||
OnStopCopy(aStatus) {
|
||||
this.copyDone = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
MailServices.copy.CopyMessages(folder1, array, folder2, true,
|
||||
copyListener, mc.window.msgWindow, true);
|
||||
|
|
|
@ -9,17 +9,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-right-click-middle-click-folders';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-right-click-middle-click-folders";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folderA, folderB, folderC;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folderA = create_folder("RightClickMiddleClickFoldersA");
|
||||
|
@ -126,7 +128,7 @@ function _middle_click_folder_with_nothing_selected_helper(aBackground) {
|
|||
assert_no_folders_selected();
|
||||
|
||||
let originalTab = mc.tabmail.currentTabInfo;
|
||||
let [newTab, ] = middle_click_on_folder(folderA);
|
||||
let [newTab] = middle_click_on_folder(folderA);
|
||||
if (aBackground) {
|
||||
// Make sure we haven't switched to the new tab.
|
||||
assert_selected_tab(originalTab);
|
||||
|
@ -150,7 +152,7 @@ function _middle_click_folder_with_one_thing_selected_helper(aBackground) {
|
|||
assert_folder_selected_and_displayed(folderB);
|
||||
|
||||
let originalTab = mc.tabmail.currentTabInfo;
|
||||
let [newTab, ] = middle_click_on_folder(folderA);
|
||||
let [newTab] = middle_click_on_folder(folderA);
|
||||
if (aBackground) {
|
||||
// Make sure we haven't switched to the new tab.
|
||||
assert_selected_tab(originalTab);
|
||||
|
@ -169,7 +171,7 @@ function _middle_click_folder_with_many_things_selected_helper(aBackground) {
|
|||
assert_folders_selected_and_displayed(folderB, folderC);
|
||||
|
||||
let originalTab = mc.tabmail.currentTabInfo;
|
||||
let [newTab, ] = middle_click_on_folder(folderA);
|
||||
let [newTab] = middle_click_on_folder(folderA);
|
||||
if (aBackground) {
|
||||
// Make sure we haven't switched to the new tab.
|
||||
assert_selected_tab(originalTab);
|
||||
|
@ -192,7 +194,7 @@ function _middle_click_folder_on_existing_single_selection_helper(aBackground) {
|
|||
assert_folder_selected_and_displayed(folderC);
|
||||
|
||||
let originalTab = mc.tabmail.currentTabInfo;
|
||||
let [newTab, ] = middle_click_on_folder(folderC);
|
||||
let [newTab] = middle_click_on_folder(folderC);
|
||||
if (aBackground) {
|
||||
// Make sure we haven't switched to the new tab.
|
||||
assert_selected_tab(originalTab);
|
||||
|
@ -214,7 +216,7 @@ function _middle_click_on_existing_multi_selection_helper(aBackground) {
|
|||
assert_folders_selected_and_displayed(folderA, folderB, folderC);
|
||||
|
||||
let originalTab = mc.tabmail.currentTabInfo;
|
||||
let [newTab, ] = middle_click_on_folder(folderB);
|
||||
let [newTab] = middle_click_on_folder(folderB);
|
||||
if (aBackground) {
|
||||
// Make sure we haven't switched to the new tab.
|
||||
assert_selected_tab(originalTab);
|
||||
|
@ -255,5 +257,5 @@ _generate_background_foreground_tests([
|
|||
"middle_click_folder_with_nothing_selected",
|
||||
"middle_click_folder_with_one_thing_selected",
|
||||
"middle_click_folder_with_many_things_selected",
|
||||
"middle_click_folder_on_existing_single_selection"
|
||||
"middle_click_folder_on_existing_single_selection",
|
||||
]);
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-right-click-middle-click-messages';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-right-click-middle-click-messages";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var elib = ChromeUtils.import("chrome://mozmill/content/modules/elementslib.jsm");
|
||||
|
||||
|
@ -23,9 +25,9 @@ var folder, threadedFolder;
|
|||
var NUM_MESSAGES_IN_THREAD = 6;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folder = create_folder("RightClickMiddleClickA");
|
||||
|
@ -175,8 +177,7 @@ function _middle_click_with_nothing_selected_helper(aBackground) {
|
|||
assert_selected_tab(folderTab);
|
||||
// Now switch to the new tab and check
|
||||
switch_tab(tabMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wait_for_message_display_completion();
|
||||
}
|
||||
|
||||
|
@ -204,8 +205,7 @@ function _middle_click_with_one_thing_selected_helper(aBackground) {
|
|||
assert_selected_tab(folderTab);
|
||||
// Now switch to the new tab and check
|
||||
switch_tab(tabMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wait_for_message_display_completion();
|
||||
}
|
||||
|
||||
|
@ -235,8 +235,7 @@ function _middle_click_with_many_things_selected_helper(aBackground) {
|
|||
assert_selected_tab(folderTab);
|
||||
// Now switch to the new tab and check
|
||||
switch_tab(tabMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wait_for_message_display_completion();
|
||||
}
|
||||
|
||||
|
@ -264,8 +263,7 @@ function _middle_click_on_existing_single_selection_helper(aBackground) {
|
|||
assert_selected_tab(folderTab);
|
||||
// Now switch to the new tab and check
|
||||
switch_tab(tabMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wait_for_message_display_completion();
|
||||
}
|
||||
|
||||
|
@ -294,8 +292,7 @@ function _middle_click_on_existing_multi_selection_helper(aBackground) {
|
|||
assert_selected_tab(folderTab);
|
||||
// Now switch to the new tab and check
|
||||
switch_tab(tabMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
wait_for_message_display_completion();
|
||||
}
|
||||
|
||||
|
@ -332,7 +329,7 @@ function _middle_click_on_collapsed_thread_root_helper(aBackground) {
|
|||
|
||||
// Middle-click on the root of the collapsed thread, which is also the last
|
||||
// row
|
||||
let [tabMessage, ] = middle_click_on_row(
|
||||
let [tabMessage] = middle_click_on_row(
|
||||
mc.folderDisplay.view.dbView.rowCount - 1);
|
||||
|
||||
if (!aBackground) {
|
||||
|
@ -375,7 +372,7 @@ function _middle_click_on_expanded_thread_root_helper(aBackground) {
|
|||
|
||||
// Middle-click on the root of the expanded thread, which is the row with
|
||||
// index (number of rows - number of messages in thread).
|
||||
let [tabMessage, ] = middle_click_on_row(
|
||||
let [tabMessage] = middle_click_on_row(
|
||||
mc.folderDisplay.view.dbView.rowCount - NUM_MESSAGES_IN_THREAD);
|
||||
|
||||
if (!aBackground) {
|
||||
|
@ -421,7 +418,7 @@ _generate_background_foreground_tests([
|
|||
"middle_click_on_existing_single_selection",
|
||||
"middle_click_on_existing_multi_selection",
|
||||
"middle_click_on_collapsed_thread_root",
|
||||
"middle_click_on_expanded_thread_root"
|
||||
"middle_click_on_expanded_thread_root",
|
||||
]);
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,15 +9,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-savedsearch-reload-after-compact";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-savedsearch-reload-after-compact";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
}
|
||||
|
||||
|
@ -27,7 +29,7 @@ function setupModule(module) {
|
|||
*/
|
||||
function test_setup_virtual_folder_and_compact() {
|
||||
let otherFolder = create_folder("otherFolder");
|
||||
let [msgSet] = make_new_sets_in_folder(otherFolder, [{count: 2}]);
|
||||
make_new_sets_in_folder(otherFolder, [{count: 2}]);
|
||||
|
||||
/**
|
||||
* We delete the first message in the local folder, so compaction of the
|
||||
|
@ -37,22 +39,22 @@ function test_setup_virtual_folder_and_compact() {
|
|||
* view still gets rebuilt, such that there is a valid msg hdr at row 0.
|
||||
*/
|
||||
be_in_folder(otherFolder);
|
||||
let curMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
press_delete();
|
||||
|
||||
let folderVirtual = create_virtual_folder([inboxFolder, otherFolder], {},
|
||||
true, "SavedSearch");
|
||||
|
||||
be_in_folder(folderVirtual);
|
||||
curMessage = select_click_row(0);
|
||||
select_click_row(0);
|
||||
let urlListener = {
|
||||
compactDone: false,
|
||||
|
||||
OnStartRunningUrl: function (aUrl) {
|
||||
OnStartRunningUrl(aUrl) {
|
||||
},
|
||||
OnStopRunningUrl: function (aUrl, aExitCode) {
|
||||
OnStopRunningUrl(aUrl, aExitCode) {
|
||||
this.compactDone = true;
|
||||
}
|
||||
},
|
||||
};
|
||||
if (otherFolder.msgStore.supportsCompaction) {
|
||||
otherFolder.compactAll(urlListener, null, false);
|
||||
|
@ -63,6 +65,6 @@ function test_setup_virtual_folder_and_compact() {
|
|||
// Let the event queue clear.
|
||||
mc.sleep(0);
|
||||
// Check view is still valid
|
||||
let msgHdr = mc.dbView.getMsgHdrAt(0);
|
||||
mc.dbView.getMsgHdrAt(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,16 +4,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-selection';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers'];
|
||||
var MODULE_NAME = "test-selection";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
// let us have 2 folders
|
||||
var folder = null, folder2 = null;
|
||||
|
||||
var setupModule = function(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
|
||||
folder = create_folder("SelectionA");
|
||||
|
@ -98,13 +99,13 @@ function test_selection_persists_through_folder_tab_changes() {
|
|||
switch_tab(tab1);
|
||||
assert_selected_and_displayed(2);
|
||||
select_shift_click_row(4); // 2-4 selected
|
||||
assert_selected_and_displayed([2,4]); // ensures multi-message summary
|
||||
assert_selected_and_displayed([2, 4]); // ensures multi-message summary
|
||||
|
||||
switch_tab(tab2);
|
||||
assert_selected_and_displayed(3);
|
||||
|
||||
close_tab(tab2);
|
||||
assert_selected_and_displayed([2,4]);
|
||||
assert_selected_and_displayed([2, 4]);
|
||||
}
|
||||
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=474701#c87
|
||||
|
@ -119,7 +120,7 @@ function test_enter_scroll_to_new() {
|
|||
// leave the folder so that the messages get marked as read
|
||||
enter_folder(folder.rootFolder);
|
||||
// add a new message, and make sure it is new
|
||||
let newSet = make_new_sets_in_folder(folder, [{count: 1}]);
|
||||
make_new_sets_in_folder(folder, [{count: 1}]);
|
||||
// enter the folder
|
||||
enter_folder(folder);
|
||||
// make sure it (which must be the last row) is visible
|
||||
|
|
|
@ -19,18 +19,20 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-summarization';
|
||||
/* import-globals-from ../shared-modules/test-address-book-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'address-book-helpers'];
|
||||
var MODULE_NAME = "test-summarization";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "address-book-helpers"];
|
||||
|
||||
var folder;
|
||||
var thread1, thread2, msg1, msg2;
|
||||
|
||||
var setupModule = function(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let abh = collector.getModule('address-book-helpers');
|
||||
let abh = collector.getModule("address-book-helpers");
|
||||
abh.installInto(module);
|
||||
|
||||
folder = create_folder("SummarizationA");
|
||||
|
@ -179,17 +181,17 @@ function test_summarization_thread_detection() {
|
|||
toggle_thread_row(0);
|
||||
assert_messages_summarized(mc, messages);
|
||||
// count the number of messages represented
|
||||
assert_summary_contains_N_elts('#message_list > li', 10);
|
||||
assert_summary_contains_N_elts("#message_list > li", 10);
|
||||
select_shift_click_row(1);
|
||||
// this should have shifted to the multi-message view
|
||||
assert_summary_contains_N_elts('.item_header > .date', 0);
|
||||
assert_summary_contains_N_elts('.item_header > .subject', 2);
|
||||
assert_summary_contains_N_elts(".item_header > .date", 0);
|
||||
assert_summary_contains_N_elts(".item_header > .subject", 2);
|
||||
select_none();
|
||||
assert_nothing_selected();
|
||||
select_click_row(1); // select a single message
|
||||
select_shift_click_row(2); // add a thread
|
||||
assert_summary_contains_N_elts('.item_header > .date', 0);
|
||||
assert_summary_contains_N_elts('.item_header > .subject', 2);
|
||||
assert_summary_contains_N_elts(".item_header > .date", 0);
|
||||
assert_summary_contains_N_elts(".item_header > .subject", 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,8 +218,7 @@ function test_new_thread_that_was_not_summarized_expands() {
|
|||
assert_selected_and_displayed(willNotMoveMsg);
|
||||
|
||||
// give it a friend...
|
||||
let [extraNonMoveMsg] = make_new_sets_in_folders(
|
||||
[folder], [{count: 1, inReplyTo: willNotMoveMsg}]);
|
||||
make_new_sets_in_folders([folder], [{count: 1, inReplyTo: willNotMoveMsg}]);
|
||||
assert_expanded(willNotMoveMsg);
|
||||
assert_selected_and_displayed(willNotMoveMsg);
|
||||
|
||||
|
@ -226,8 +227,7 @@ function test_new_thread_that_was_not_summarized_expands() {
|
|||
assert_selected_and_displayed(willMoveMsg);
|
||||
|
||||
// give it a friend...
|
||||
let [extraMoveMsg] = make_new_sets_in_folders(
|
||||
[folder], [{count: 1, inReplyTo: willMoveMsg}]);
|
||||
make_new_sets_in_folders([folder], [{count: 1, inReplyTo: willMoveMsg}]);
|
||||
assert_expanded(willMoveMsg);
|
||||
assert_selected_and_displayed(willMoveMsg);
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ function test_summary_when_multiple_identities() {
|
|||
|
||||
let folder2 = create_folder("Search2");
|
||||
be_in_folder(folder2);
|
||||
make_new_sets_in_folders([folder2], [{count: 1, inReplyTo: thread1}])
|
||||
make_new_sets_in_folders([folder2], [{count: 1, inReplyTo: thread1}]);
|
||||
|
||||
let folderVirtual = create_virtual_folder([folder1, folder2], {}, true, "SearchBoth");
|
||||
|
||||
|
@ -294,8 +294,8 @@ function test_summary_when_multiple_identities() {
|
|||
select_click_row(0);
|
||||
assert_messages_summarized(mc, mc.folderDisplay.selectedMessages);
|
||||
// Thread summary shows a date, while multimessage summary shows a subject.
|
||||
assert_summary_contains_N_elts('.item_header > .subject', 0);
|
||||
assert_summary_contains_N_elts('.item_header > .date', 2);
|
||||
assert_summary_contains_N_elts(".item_header > .subject", 0);
|
||||
assert_summary_contains_N_elts(".item_header > .date", 2);
|
||||
|
||||
// Second half of the test, makes sure MultiMessageSummary groups messages
|
||||
// according to their view thread id
|
||||
|
@ -304,15 +304,14 @@ function test_summary_when_multiple_identities() {
|
|||
be_in_folder(folderVirtual);
|
||||
select_shift_click_row(1);
|
||||
|
||||
assert_summary_contains_N_elts('.item_header > .subject', 2);
|
||||
assert_summary_contains_N_elts(".item_header > .subject", 2);
|
||||
}
|
||||
|
||||
function extract_first_address(thread)
|
||||
{
|
||||
function extract_first_address(thread) {
|
||||
let addresses = {};
|
||||
let fullNames = {};
|
||||
let names = {};
|
||||
let numAddresses = MailServices.headerParser.parseHeadersWithArray(
|
||||
MailServices.headerParser.parseHeadersWithArray(
|
||||
thread1.getMsgHdr(0).mime2DecodedAuthor,
|
||||
addresses, names, fullNames);
|
||||
|
||||
|
@ -320,15 +319,14 @@ function extract_first_address(thread)
|
|||
}
|
||||
|
||||
function check_address_name(name) {
|
||||
let htmlframe = mc.e('multimessage');
|
||||
let match = htmlframe.contentDocument.querySelector('.author');
|
||||
let htmlframe = mc.e("multimessage");
|
||||
let match = htmlframe.contentDocument.querySelector(".author");
|
||||
if (match.textContent != name)
|
||||
throw new Error("Expected to find sender named '" + name + "', found '" +
|
||||
match.textContent + "'");
|
||||
}
|
||||
|
||||
function test_display_name_no_abook()
|
||||
{
|
||||
function test_display_name_no_abook() {
|
||||
be_in_folder(folder);
|
||||
|
||||
let address = extract_first_address(thread1);
|
||||
|
@ -341,8 +339,7 @@ function test_display_name_no_abook()
|
|||
check_address_name(address.name + " <" + address.email + ">");
|
||||
}
|
||||
|
||||
function test_display_name_abook()
|
||||
{
|
||||
function test_display_name_abook() {
|
||||
be_in_folder(folder);
|
||||
|
||||
let address = extract_first_address(thread1);
|
||||
|
@ -354,8 +351,7 @@ function test_display_name_abook()
|
|||
check_address_name("My Friend");
|
||||
}
|
||||
|
||||
function test_display_name_abook_no_pdn()
|
||||
{
|
||||
function test_display_name_abook_no_pdn() {
|
||||
be_in_folder(folder);
|
||||
|
||||
let address = extract_first_address(thread1);
|
||||
|
|
|
@ -13,17 +13,19 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-tabs-simple';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers', 'window-helpers'];
|
||||
var MODULE_NAME = "test-tabs-simple";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers"];
|
||||
|
||||
var folderA, folderB, setA, setB;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
let wh = collector.getModule('window-helpers');
|
||||
let wh = collector.getModule("window-helpers");
|
||||
wh.installInto(module);
|
||||
|
||||
folderA = create_folder("TabsSimpleA");
|
||||
|
|
|
@ -8,23 +8,22 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-virtual-folder-commands";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ['folder-display-helpers'];
|
||||
var MODULE_NAME = "test-virtual-folder-commands";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
var msgsPerThread = 5;
|
||||
var singleVirtFolder;
|
||||
var multiVirtFolder;
|
||||
|
||||
function setupModule(module) {
|
||||
let fdh = collector.getModule('folder-display-helpers');
|
||||
let fdh = collector.getModule("folder-display-helpers");
|
||||
fdh.installInto(module);
|
||||
|
||||
let [folderOne, setOne] = make_folder_with_sets(
|
||||
[{msgsPerThread: msgsPerThread}]);
|
||||
let [folderTwo, setTwo] = make_folder_with_sets(
|
||||
[{msgsPerThread: msgsPerThread}]);
|
||||
let [folderOne] = make_folder_with_sets([{msgsPerThread}]);
|
||||
let [folderTwo] = make_folder_with_sets([{msgsPerThread}]);
|
||||
|
||||
singleVirtFolder = make_virtual_folder([folderOne], {});
|
||||
multiVirtFolder = make_virtual_folder([folderOne, folderTwo], {});
|
||||
|
|
|
@ -6,12 +6,11 @@
|
|||
* Test that "watch thread" and "ignore thread" works correctly.
|
||||
*/
|
||||
|
||||
// make SOLO_TEST=folder-display/test-watch-ignore-thread.js mozmill-one
|
||||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-watch-ignore-thread";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-watch-ignore-thread";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
|
@ -42,7 +41,7 @@ function clickViewMessagesItem(aMenuId) {
|
|||
[
|
||||
{id: "appmenu_View"},
|
||||
{id: "appmenu_viewMessagesMenu"},
|
||||
{id: aMenuId}
|
||||
{id: aMenuId},
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -98,7 +97,6 @@ function test_view_threads_ignored_threads() {
|
|||
* Test that Watch Thread makes the thread watched.
|
||||
*/
|
||||
function test_watch_thread() {
|
||||
let t2root = thread2.getMsgHdr(0);
|
||||
let t2second = select_click_row(1);
|
||||
let t3root = thread3.getMsgHdr(0);
|
||||
assert_selected_and_displayed(t2second);
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-display-message-with-folder-modes";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-display-message-with-folder-modes";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = "test-folder-names-in-recent-mode";
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
|
||||
var MODULE_NAME = "test-folder-names-in-recent-mode";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers"];
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var MODULE_NAME = 'test-folder-pane';
|
||||
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-nntp-helpers.js */
|
||||
/* import-globals-from ../shared-modules/test-window-helpers.js */
|
||||
|
||||
var RELATIVE_ROOT = '../shared-modules';
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers",
|
||||
"nntp-helpers"];
|
||||
var MODULE_NAME = "test-folder-pane";
|
||||
var RELATIVE_ROOT = "../shared-modules";
|
||||
var MODULE_REQUIRES = ["folder-display-helpers", "window-helpers", "nntp-helpers"];
|
||||
|
||||
var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
|
||||
|
||||
|
@ -67,7 +69,6 @@ function test_offline_sync_folder_selection_tree() {
|
|||
{ id: "appmenu_offline" },
|
||||
{ id: "appmenu_synchronizeOffline" } ]);
|
||||
wait_for_modal_dialog("mailnews:synchronizeOffline");
|
||||
|
||||
}
|
||||
|
||||
function subtest_offline_sync(osc) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче