Bug 1870187 - ESMify Pop3d.jsm. r=mkmelin
Depends on D196519 Differential Revision: https://phabricator.services.mozilla.com/D196520 --HG-- rename : mailnews/test/fakeserver/Pop3d.jsm => mailnews/test/fakeserver/Pop3d.sys.mjs extra : moz-landing-system : lando
This commit is contained in:
Родитель
0a2770c865
Коммит
9be1af571f
|
@ -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 { Pop3Daemon, POP3_RFC5034_handler } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Pop3d.jsm"
|
||||
);
|
||||
import {
|
||||
Pop3Daemon,
|
||||
POP3_RFC5034_handler,
|
||||
} from "resource://testing-common/mailnews/Pop3d.sys.mjs";
|
||||
import { nsMailServer } from "resource://testing-common/mailnews/Maild.sys.mjs";
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,7 +51,7 @@ TEST_HARNESS_FILES.testing.mochitest.fakeserver += [
|
|||
"../../../mailnews/test/fakeserver/Imapd.sys.mjs",
|
||||
"../../../mailnews/test/fakeserver/Maild.sys.mjs",
|
||||
"../../../mailnews/test/fakeserver/Nntpd.jsm",
|
||||
"../../../mailnews/test/fakeserver/Pop3d.jsm",
|
||||
"../../../mailnews/test/fakeserver/Pop3d.sys.mjs",
|
||||
"../../../mailnews/test/fakeserver/Smtpd.jsm",
|
||||
]
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ var gDEPTH = "../../../../";
|
|||
|
||||
// Import the pop3 server scripts
|
||||
/* import-globals-from ../../../test/fakeserver/Auth.jsm */
|
||||
/* import-globals-from ../../../test/fakeserver/Pop3d.jsm */
|
||||
var { nsMailServer } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Maild.sys.mjs"
|
||||
);
|
||||
|
@ -38,7 +37,9 @@ var {
|
|||
POP3_RFC1939_handler,
|
||||
POP3_RFC2449_handler,
|
||||
POP3_RFC5034_handler,
|
||||
} = ChromeUtils.import("resource://testing-common/mailnews/Pop3d.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Pop3d.sys.mjs"
|
||||
);
|
||||
|
||||
// Setup the daemon and server
|
||||
// If the debugOption is set, then it will be applied to the server.
|
||||
|
|
|
@ -16,7 +16,7 @@ var expectedTransaction = [
|
|||
"STAT",
|
||||
];
|
||||
|
||||
const kStateAuthNeeded = 1; // the same value as in Pop3d.jsm
|
||||
const kStateAuthNeeded = 1; // the same value as in Pop3d.sys.mjs
|
||||
|
||||
var urlListener = {
|
||||
OnStartRunningUrl(url) {},
|
||||
|
|
|
@ -57,7 +57,7 @@ TESTING_JS_MODULES.mailnews += [
|
|||
"test/fakeserver/Ldapd.jsm",
|
||||
"test/fakeserver/Maild.sys.mjs",
|
||||
"test/fakeserver/Nntpd.jsm",
|
||||
"test/fakeserver/Pop3d.jsm",
|
||||
"test/fakeserver/Pop3d.sys.mjs",
|
||||
"test/fakeserver/Smtpd.jsm",
|
||||
"test/resources/IMAPpump.jsm",
|
||||
"test/resources/LocalAccountUtils.jsm",
|
||||
|
|
|
@ -6,13 +6,6 @@
|
|||
/* This file implements test POP3 servers
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = [
|
||||
"Pop3Daemon",
|
||||
"POP3_RFC1939_handler",
|
||||
"POP3_RFC2449_handler",
|
||||
"POP3_RFC5034_handler",
|
||||
];
|
||||
|
||||
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
|
||||
"resource://testing-common/mailnews/Auth.jsm"
|
||||
);
|
||||
|
@ -58,7 +51,7 @@ function readFile(fileName) {
|
|||
return mailTestUtils.loadFileToString(file);
|
||||
}
|
||||
|
||||
class Pop3Daemon {
|
||||
export class Pop3Daemon {
|
||||
messages = [];
|
||||
_messages = [];
|
||||
_totalMessageSize = 0;
|
||||
|
@ -111,7 +104,7 @@ var kStateTransaction = 3; // Authenticated, can fetch and delete mail
|
|||
* If dropOnAuthFailure is set, the server will drop the connection
|
||||
* on authentication errors, to simulate servers that do the same.
|
||||
*/
|
||||
class POP3_RFC1939_handler {
|
||||
export class POP3_RFC1939_handler {
|
||||
kUsername = "fred";
|
||||
kPassword = "wilma";
|
||||
|
||||
|
@ -267,7 +260,7 @@ class POP3_RFC1939_handler {
|
|||
*
|
||||
* @see RFC 2449
|
||||
*/
|
||||
class POP3_RFC2449_handler extends POP3_RFC1939_handler {
|
||||
export class POP3_RFC2449_handler extends POP3_RFC1939_handler {
|
||||
kCapabilities = ["UIDL", "TOP"]; // the test may adapt this as necessary
|
||||
|
||||
CAPA(args) {
|
||||
|
@ -289,7 +282,7 @@ class POP3_RFC2449_handler extends POP3_RFC1939_handler {
|
|||
* @see RFC 5034
|
||||
* @author Ben Bucksch <ben.bucksch beonex.com> <http://business.beonex.com>
|
||||
*/
|
||||
class POP3_RFC5034_handler extends POP3_RFC2449_handler {
|
||||
export class POP3_RFC5034_handler extends POP3_RFC2449_handler {
|
||||
kAuthSchemes = ["CRAM-MD5", "PLAIN", "LOGIN"]; // the test may adapt this as necessary
|
||||
_usedCRAMMD5Challenge = null; // not base64-encoded
|
||||
|
|
@ -43,7 +43,9 @@ var {
|
|||
POP3_RFC1939_handler,
|
||||
POP3_RFC2449_handler,
|
||||
POP3_RFC5034_handler,
|
||||
} = ChromeUtils.import("resource://testing-common/mailnews/Pop3d.jsm");
|
||||
} = ChromeUtils.importESModule(
|
||||
"resource://testing-common/mailnews/Pop3d.sys.mjs"
|
||||
);
|
||||
|
||||
function POP3Pump() {
|
||||
// public attributes
|
||||
|
|
|
@ -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/Pop3d.jsm": "comm/mailnews/test/fakeserver/Pop3d.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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче