Bug 1786655 - Use PascalCase for class names in {Smtpd,Nntpd,Pop3d}.jsm. r=mkmelin

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

--HG--
extra : rebase_source : 8c643aaf5259ce46ce813022af97717bfe5d828b
extra : amend_source : 9cb9163749ccd3846169ffbfd066fac64de507a9
This commit is contained in:
Ping Chen 2022-08-24 20:26:12 +10:00
Родитель 783208b644
Коммит 2f8bd68359
24 изменённых файлов: 50 добавлений и 50 удалений

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

@ -14,7 +14,7 @@ var {
fsDebugRecv,
fsDebugRecvSend,
} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
@ -28,7 +28,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -17,7 +17,7 @@ var {
fsDebugRecv,
fsDebugRecvSend,
} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
@ -31,7 +31,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -17,7 +17,7 @@ var {
fsDebugRecv,
fsDebugRecvSend,
} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
@ -31,7 +31,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -17,7 +17,7 @@ var {
fsDebugRecv,
fsDebugRecvSend,
} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
@ -31,7 +31,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -211,11 +211,11 @@ function createNewsgroup(group) {
var NNTPServer = {
open() {
let { NNTP_RFC977_handler, nntpDaemon } = ChromeUtils.import(
let { NNTP_RFC977_handler, NntpDaemon } = ChromeUtils.import(
"resource://testing-common/mailnews/Nntpd.jsm"
);
this.daemon = new nntpDaemon();
this.daemon = new NntpDaemon();
this.server = new nsMailServer(
daemon => new NNTP_RFC977_handler(daemon),
this.daemon
@ -241,7 +241,7 @@ var NNTPServer = {
},
addMessages(folder, messages) {
let { newsArticle } = ChromeUtils.import(
let { NewsArticle } = ChromeUtils.import(
"resource://testing-common/mailnews/Nntpd.jsm"
);
@ -254,7 +254,7 @@ var NNTPServer = {
if (!message.endsWith("\r\n")) {
message = message + "\r\n";
}
let article = new newsArticle(message);
let article = new NewsArticle(message);
article.groups = [group];
this.daemon.addArticle(article);
});

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

@ -98,14 +98,14 @@ var IMAPServer = {
var SMTPServer = {
open() {
const { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
const { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
const { nsMailServer } = ChromeUtils.import(
"resource://testing-common/mailnews/Maild.jsm"
);
this.daemon = new smtpDaemon();
this.daemon = new SmtpDaemon();
this.server = new nsMailServer(daemon => {
let handler = new SMTP_RFC2821_handler(daemon);
handler.kUsername = "john.doe@example-imap.com";

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

@ -15,7 +15,7 @@ const EXPORTED_SYMBOLS = [
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { newsArticle, NNTP_RFC977_handler, nntpDaemon } = ChromeUtils.import(
var { NewsArticle, NNTP_RFC977_handler, NntpDaemon } = ChromeUtils.import(
"resource://testing-common/mailnews/Nntpd.jsm"
);
var { nsMailServer } = ChromeUtils.import(
@ -43,13 +43,13 @@ var groups = [
// Sets up the NNTP daemon object for use in fake server
function setupNNTPDaemon() {
var daemon = new nntpDaemon();
var daemon = new NntpDaemon();
groups.forEach(function(element) {
daemon.addGroup(element[0]);
});
var article = new newsArticle(kSimpleNewsArticle);
var article = new NewsArticle(kSimpleNewsArticle);
daemon.addArticleToGroup(article, "test.subscribe.simple", 1);
return daemon;

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

@ -38,7 +38,7 @@ var {
fsDebugRecv,
fsDebugRecvSend,
} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
@ -54,7 +54,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -60,7 +60,7 @@ var {
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
"resource://testing-common/mailnews/Auth.jsm"
);
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
@ -189,7 +189,7 @@ function setupSmtpServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
var server = new nsMailServer(handler, new smtpDaemon());
var server = new nsMailServer(handler, new SmtpDaemon());
return server;
}

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

@ -40,7 +40,7 @@ var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
"resource://testing-common/mailnews/Auth.jsm"
);
var {
pop3Daemon,
Pop3Daemon,
POP3_RFC1939_handler,
POP3_RFC2449_handler,
POP3_RFC5034_handler,
@ -49,7 +49,7 @@ var {
// Setup the daemon and server
// If the debugOption is set, then it will be applied to the server.
function setupServerDaemon(debugOption) {
var daemon = new pop3Daemon();
var daemon = new Pop3Daemon();
var extraProps = {};
function createHandler(d) {
var handler = new POP3_RFC5034_handler(d);

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

@ -208,7 +208,7 @@ function run_test() {
Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
var handler = new GSSAPIFail_handler(d);
handler.kAuthSchemes = authSchemes;

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

@ -43,7 +43,7 @@ add_task(async function setupTest() {
registerAlertTestUtils();
// Set up the Server
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
var handler = new POP3_RFC1939_handler(d);
handler.dropOnAuthFailure = true;

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

@ -43,7 +43,7 @@ add_task(async function setupTest() {
registerAlertTestUtils();
// Set up the Server
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
var handler = new POP3_RFC2449_handler(d);
handler.dropOnAuthFailure = true;

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

@ -45,7 +45,7 @@ add_task(async function setupTest() {
registerAlertTestUtils();
// Set up the Server
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
var handler = new POP3_RFC5034_handler(d);
handler.dropOnAuthFailure = true;

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

@ -92,7 +92,7 @@ function run_test() {
Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
return new CRAMFail_handler(d);
}

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

@ -93,7 +93,7 @@ function run_test() {
Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
return new CRAMFail_handler(d);
}

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

@ -62,7 +62,7 @@ function run_test() {
Services.prefs.setBoolPref("mail.biff.show_tray_icon", false);
Services.prefs.setBoolPref("mail.biff.animate_dock_icon", false);
// Set up the Server
daemon = new pop3Daemon();
daemon = new Pop3Daemon();
function createHandler(d) {
var handler = new POP3_RFC1939_handler(d);
// Login information needs to match the one stored in the signons json file.

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

@ -17,7 +17,7 @@ do_get_profile();
var { nsMailServer } = ChromeUtils.import(
"resource://testing-common/mailnews/Maild.jsm"
);
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
var { SmtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
"resource://testing-common/mailnews/Smtpd.jsm"
);
@ -31,7 +31,7 @@ function setupServerDaemon(handler) {
return new SMTP_RFC2821_handler(d);
};
}
let daemon = new smtpDaemon();
let daemon = new SmtpDaemon();
let server = new nsMailServer(handler, daemon);
return [daemon, server];
}

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

@ -26,12 +26,12 @@ var { fsDebugAll, gThreadManager, nsMailServer } = ChromeUtils.import(
"resource://testing-common/mailnews/Maild.jsm"
);
var {
newsArticle,
NewsArticle,
NNTP_Giganews_handler,
NNTP_RFC2980_handler,
NNTP_RFC4643_extension,
NNTP_RFC977_handler,
nntpDaemon,
NntpDaemon,
} = ChromeUtils.import("resource://testing-common/mailnews/Nntpd.jsm");
var kSimpleNewsArticle =
@ -55,7 +55,7 @@ var groups = [
];
// Sets up the NNTP daemon object for use in fake server
function setupNNTPDaemon() {
var daemon = new nntpDaemon();
var daemon = new NntpDaemon();
groups.forEach(function(element) {
daemon.addGroup(element[0]);
@ -89,10 +89,10 @@ function setupNNTPDaemon() {
}
sstream.close();
fstream.close();
daemon.addArticle(new newsArticle(post));
daemon.addArticle(new NewsArticle(post));
});
var article = new newsArticle(kSimpleNewsArticle);
var article = new NewsArticle(kSimpleNewsArticle);
daemon.addArticleToGroup(article, "test.subscribe.simple", 1);
return daemon;
@ -236,7 +236,7 @@ function make_article(file) {
}
sstream.close();
fstream.close();
return new newsArticle(post);
return new NewsArticle(post);
}
var articleTextListener = {

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

@ -103,7 +103,7 @@ ${btoa(arr)}
add_task(async function test_fetchMessage() {
// Replace the second article with a large message.
daemon.addArticleToGroup(
new newsArticle(generateLongArticle()),
new NewsArticle(generateLongArticle()),
"test.filter",
2
);

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

@ -7,8 +7,8 @@
const { MimeParser } = ChromeUtils.import("resource:///modules/mimeParser.jsm");
var EXPORTED_SYMBOLS = [
"nntpDaemon",
"newsArticle",
"NntpDaemon",
"NewsArticle",
"NNTP_POSTABLE",
"NNTP_REAL_LENGTH",
"NNTP_RFC977_handler",
@ -18,7 +18,7 @@ var EXPORTED_SYMBOLS = [
"NNTP_RFC4643_extension",
];
class nntpDaemon {
class NntpDaemon {
constructor(flags) {
this._groups = {};
this._messages = {};
@ -87,7 +87,7 @@ class nntpDaemon {
}
}
function newsArticle(text) {
function NewsArticle(text) {
this.headers = new Map();
this.body = "";
this.messageID = "";
@ -344,7 +344,7 @@ class NNTP_RFC977_handler {
onMultiline(line) {
if (line == ".") {
if (this.posting) {
var article = new newsArticle(this.post);
var article = new NewsArticle(this.post);
this._daemon.addArticle(article);
this.posting = false;
return "240 Wonderful article, your style is gorgeous!";

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

@ -7,7 +7,7 @@
*/
var EXPORTED_SYMBOLS = [
"pop3Daemon",
"Pop3Daemon",
"POP3_RFC1939_handler",
"POP3_RFC2449_handler",
"POP3_RFC5034_handler",
@ -58,7 +58,7 @@ function readFile(fileName) {
return mailTestUtils.loadFileToString(file);
}
class pop3Daemon {
class Pop3Daemon {
messages = [];
_messages = [];
_totalMessageSize = 0;

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

@ -1,13 +1,13 @@
/* -*- 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 EXPORTED_SYMBOLS = ["SmtpDaemon", "SMTP_RFC2821_handler"];
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
"resource://testing-common/mailnews/Auth.jsm"
);
class smtpDaemon {
class SmtpDaemon {
_messages = {};
}

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

@ -39,7 +39,7 @@ var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
"resource://testing-common/mailnews/Auth.jsm"
);
var {
pop3Daemon,
Pop3Daemon,
POP3_RFC1939_handler,
POP3_RFC2449_handler,
POP3_RFC5034_handler,
@ -91,7 +91,7 @@ POP3Pump.prototype.OnStopRunningUrl = function(aUrl, aResult) {
// Setup the daemon and server
// If the debugOption is set, then it will be applied to the server.
POP3Pump.prototype._setupServerDaemon = function(aDebugOption) {
this._daemon = new pop3Daemon();
this._daemon = new Pop3Daemon();
function createHandler(d) {
return new POP3_RFC1939_handler(d);
}