Bug 1881992 - ESMify IMAPpump.jsm. r=aleca
Differential Revision: https://phabricator.services.mozilla.com/D202689 --HG-- rename : mailnews/test/resources/IMAPpump.jsm => mailnews/test/resources/IMAPpump.sys.mjs extra : rebase_source : 85c6afd4c31cd5f4a2c0258411fe74b053de43f3 extra : amend_source : 1966a51b0b81e4edf16eaed68fa4b35dd74d0fde
This commit is contained in:
Родитель
a277c4321b
Коммит
b1fa38b020
|
@ -14,8 +14,8 @@ const { PromiseTestUtils } = ChromeUtils.importESModule(
|
|||
);
|
||||
|
||||
// IMAP pump
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { ImapMessage } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Imapd.sys.mjs"
|
||||
|
|
|
@ -21,8 +21,8 @@ var { mailTestUtils } = ChromeUtils.importESModule(
|
|||
var { ImapMessage } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Imapd.sys.mjs"
|
||||
);
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { TestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TestUtils.sys.mjs"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
// per https://developers.google.com/google-apps/gmail/imap_extensions
|
||||
|
||||
// IMAP pump
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { PromiseTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/PromiseTestUtils.sys.mjs"
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// extension (RFC 5258 - http://tools.ietf.org/html/rfc5258)
|
||||
|
||||
// IMAP pump
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { PromiseTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/PromiseTestUtils.sys.mjs"
|
||||
|
|
|
@ -16,8 +16,8 @@ var { mailTestUtils } = ChromeUtils.importESModule(
|
|||
var { localAccountUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/LocalAccountUtils.sys.mjs"
|
||||
);
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { PromiseTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/PromiseTestUtils.sys.mjs"
|
||||
|
|
|
@ -17,8 +17,8 @@ var { PromiseTestUtils } = ChromeUtils.importESModule(
|
|||
|
||||
// IMAP pump
|
||||
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
|
||||
add_setup(async function () {
|
||||
|
|
|
@ -60,7 +60,7 @@ TESTING_JS_MODULES.mailnews += [
|
|||
"test/fakeserver/Pop3d.sys.mjs",
|
||||
"test/fakeserver/ServerTestUtils.sys.mjs",
|
||||
"test/fakeserver/Smtpd.sys.mjs",
|
||||
"test/resources/IMAPpump.jsm",
|
||||
"test/resources/IMAPpump.sys.mjs",
|
||||
"test/resources/LocalAccountUtils.sys.mjs",
|
||||
"test/resources/MailTestUtils.sys.mjs",
|
||||
"test/resources/MessageGenerator.sys.mjs",
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
var { MessageGenerator } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/MessageGenerator.sys.mjs"
|
||||
);
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/IMAPpump.sys.mjs"
|
||||
);
|
||||
var { ImapMessage } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Imapd.sys.mjs"
|
||||
|
|
|
@ -11,26 +11,16 @@
|
|||
* then.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = ["IMAPPump", "setupIMAPPump", "teardownIMAPPump"];
|
||||
|
||||
var { MailServices } = ChromeUtils.import(
|
||||
"resource:///modules/MailServices.jsm"
|
||||
);
|
||||
var { localAccountUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/LocalAccountUtils.sys.mjs"
|
||||
);
|
||||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var Imapd = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Imapd.sys.mjs"
|
||||
);
|
||||
var { updateAppInfo } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/AppInfo.sys.mjs"
|
||||
);
|
||||
import { localAccountUtils } from "resource://testing-common/mailnews/LocalAccountUtils.sys.mjs";
|
||||
import { nsMailServer } from "resource://testing-common/mailnews/Maild.sys.mjs";
|
||||
import * as Imapd from "resource://testing-common/mailnews/Imapd.sys.mjs";
|
||||
import { updateAppInfo } from "resource://testing-common/AppInfo.sys.mjs";
|
||||
|
||||
// define globals
|
||||
var IMAPPump = {
|
||||
export var IMAPPump = {
|
||||
daemon: null, // the imap fake server daemon
|
||||
server: null, // the imap fake server
|
||||
incomingServer: null, // nsIMsgIncomingServer for the imap server
|
||||
|
@ -38,7 +28,7 @@ var IMAPPump = {
|
|||
mailbox: null, // imap fake server mailbox
|
||||
};
|
||||
|
||||
function setupIMAPPump(extensions) {
|
||||
export function setupIMAPPump(extensions) {
|
||||
// Create Application info if we need it.
|
||||
updateAppInfo();
|
||||
|
||||
|
@ -120,7 +110,7 @@ function setupIMAPPump(extensions) {
|
|||
}
|
||||
|
||||
// This will clear not only the imap accounts but also local accounts.
|
||||
function teardownIMAPPump() {
|
||||
export function teardownIMAPPump() {
|
||||
// try to finish any pending operations
|
||||
const thread = Services.tm.currentThread;
|
||||
while (thread.hasPendingEvents()) {
|
|
@ -16,9 +16,10 @@ var { VirtualFolderHelper } = ChromeUtils.import(
|
|||
);
|
||||
import { ImapMessage } from "resource://testing-common/mailnews/Imapd.sys.mjs";
|
||||
|
||||
var { IMAPPump, setupIMAPPump } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm"
|
||||
);
|
||||
import {
|
||||
IMAPPump,
|
||||
setupIMAPPump,
|
||||
} from "resource://testing-common/mailnews/IMAPpump.sys.mjs";
|
||||
|
||||
const SEARCH_TERM_MAP_HELPER = {
|
||||
subject: Ci.nsMsgSearchAttrib.Subject,
|
||||
|
|
|
@ -391,7 +391,6 @@
|
|||
"resource://testing-common/gloda/GlodaQueryHelper.jsm": "comm/mailnews/db/gloda/test/unit/resources/GlodaQueryHelper.jsm",
|
||||
"resource://testing-common/gloda/GlodaTestHelper.jsm": "comm/mailnews/db/gloda/test/unit/resources/GlodaTestHelper.jsm",
|
||||
"resource://testing-common/gloda/GlodaTestHelperFunctions.jsm": "comm/mailnews/db/gloda/test/unit/resources/GlodaTestHelperFunctions.jsm",
|
||||
"resource://testing-common/mailnews/IMAPpump.jsm": "comm/mailnews/test/resources/IMAPpump.jsm",
|
||||
"resource://testing-common/mailnews/testJaBaseIncomingServer.jsm": "comm/mailnews/jsaccount/test/unit/resources/testJaBaseIncomingServer.jsm",
|
||||
"resource://testing-common/mailnews/testJaBaseMsgFolder.jsm": "comm/mailnews/jsaccount/test/unit/resources/testJaBaseMsgFolder.jsm",
|
||||
"resource://testing-common/mozmill/AccountManagerHelpers.jsm": "comm/mail/test/browser/shared-modules/AccountManagerHelpers.jsm",
|
||||
|
|
Загрузка…
Ссылка в новой задаче