Bug 1870187 - ESMify Smtpd.jsm. r=mkmelin
Depends on D196520 Differential Revision: https://phabricator.services.mozilla.com/D196521 --HG-- rename : mailnews/test/fakeserver/Smtpd.jsm => mailnews/test/fakeserver/Smtpd.sys.mjs extra : moz-landing-system : lando
This commit is contained in:
Родитель
9be1af571f
Коммит
6f78f8f74a
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
);
|
||||
import {
|
||||
SmtpDaemon,
|
||||
SMTP_RFC2821_handler,
|
||||
} from "resource://testing-common/mailnews/Smtpd.sys.mjs";
|
||||
import { nsMailServer } from "resource://testing-common/mailnews/Maild.sys.mjs";
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,8 +9,8 @@ var { localAccountUtils } = ChromeUtils.import(
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
|
|
|
@ -12,8 +12,8 @@ var { localAccountUtils } = ChromeUtils.import(
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
|
|
|
@ -12,8 +12,8 @@ var { localAccountUtils } = ChromeUtils.import(
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
|
|
|
@ -12,8 +12,8 @@ var { localAccountUtils } = ChromeUtils.import(
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
|
|
|
@ -96,8 +96,8 @@ var IMAPServer = {
|
|||
|
||||
var SMTPServer = {
|
||||
open() {
|
||||
const { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
const { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
const { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
|
|
|
@ -52,7 +52,7 @@ TEST_HARNESS_FILES.testing.mochitest.fakeserver += [
|
|||
"../../../mailnews/test/fakeserver/Maild.sys.mjs",
|
||||
"../../../mailnews/test/fakeserver/Nntpd.jsm",
|
||||
"../../../mailnews/test/fakeserver/Pop3d.sys.mjs",
|
||||
"../../../mailnews/test/fakeserver/Smtpd.jsm",
|
||||
"../../../mailnews/test/fakeserver/Smtpd.sys.mjs",
|
||||
]
|
||||
|
||||
TEST_HARNESS_FILES.testing.mochitest.resources += [
|
||||
|
|
|
@ -33,8 +33,8 @@ load("../../../resources/abSetup.js");
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
|
|
|
@ -57,8 +57,8 @@ var {
|
|||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
|
||||
function makeServer(daemon, infoString, otherProps) {
|
||||
|
|
|
@ -19,8 +19,8 @@ do_get_profile();
|
|||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Smtpd.jsm"
|
||||
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Smtpd.sys.mjs"
|
||||
);
|
||||
|
||||
var SMTP_PORT = 1024 + 120;
|
||||
|
|
|
@ -58,7 +58,7 @@ TESTING_JS_MODULES.mailnews += [
|
|||
"test/fakeserver/Maild.sys.mjs",
|
||||
"test/fakeserver/Nntpd.jsm",
|
||||
"test/fakeserver/Pop3d.sys.mjs",
|
||||
"test/fakeserver/Smtpd.jsm",
|
||||
"test/fakeserver/Smtpd.sys.mjs",
|
||||
"test/resources/IMAPpump.jsm",
|
||||
"test/resources/LocalAccountUtils.jsm",
|
||||
"test/resources/MailTestUtils.jsm",
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
// This file implements test SMTP servers
|
||||
|
||||
var EXPORTED_SYMBOLS = ["SmtpDaemon", "SMTP_RFC2821_handler"];
|
||||
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
);
|
||||
|
||||
class SmtpDaemon {
|
||||
export class SmtpDaemon {
|
||||
_messages = {};
|
||||
}
|
||||
|
||||
|
@ -25,7 +23,7 @@ var kStateAuthenticated = 3;
|
|||
* If dropOnAuthFailure is set, the server will drop the connection
|
||||
* on authentication errors, to simulate servers that do the same.
|
||||
*/
|
||||
class SMTP_RFC2821_handler {
|
||||
export class SMTP_RFC2821_handler {
|
||||
kAuthRequired = false;
|
||||
kUsername = "testsmtp";
|
||||
kPassword = "smtptest";
|
|
@ -403,7 +403,6 @@
|
|||
"resource://testing-common/mailnews/MessageInjection.jsm": "comm/mailnews/test/resources/MessageInjection.jsm",
|
||||
"resource://testing-common/mailnews/NetworkTestUtils.jsm": "comm/mailnews/test/resources/NetworkTestUtils.jsm",
|
||||
"resource://testing-common/mailnews/Nntpd.jsm": "comm/mailnews/test/fakeserver/Nntpd.jsm",
|
||||
"resource://testing-common/mailnews/Smtpd.jsm": "comm/mailnews/test/fakeserver/Smtpd.jsm",
|
||||
"resource://testing-common/mailnews/smimeUtils.jsm": "comm/mailnews/test/resources/smimeUtils.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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче