--- a/.eslintignore
+++ b/.eslintignore
@@ -90,9 +90,9 @@ mail/extensions/openpgp/**
# calendar/ exclusions
# prefs files
calendar/lightning/content/lightning.js
calendar/providers/gdata/defaults/preferences.js
calendar/timezones/preferences.js
# third party library
-calendar/base/modules/ical.js
+calendar/base/modules/Ical.jsm
--- a/calendar/base/backend/icaljs/calDateTime.js
+++ b/calendar/base/backend/icaljs/calDateTime.js
@@ -1,15 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from calICALJSComponents.js */
-var { ICAL, unwrap, unwrapSetter } = ChromeUtils.import("resource://calendar/modules/ical.js");
+var { ICAL, unwrap, unwrapSetter } = ChromeUtils.import("resource://calendar/modules/Ical.jsm");
var UNIX_TIME_TO_PRTIME = 1000000;
function calDateTime(innerObject) {
this.wrappedJSObject = this;
this.innerObject = innerObject || ICAL.Time.epochTime.clone();
}
--- a/calendar/base/backend/icaljs/calDuration.js
+++ b/calendar/base/backend/icaljs/calDuration.js
@@ -1,13 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-var { ICAL, unwrap } = ChromeUtils.import("resource://calendar/modules/ical.js");
+var { ICAL, unwrap } = ChromeUtils.import("resource://calendar/modules/Ical.jsm");
function calDuration(innerObject) {
this.innerObject = innerObject || new ICAL.Duration();
this.wrappedJSObject = this;
}
calDuration.prototype = {
QueryInterface: ChromeUtils.generateQI([Ci.calIDuration]),
--- a/calendar/base/backend/icaljs/calICSService-worker.js
+++ b/calendar/base/backend/icaljs/calICSService-worker.js
@@ -2,23 +2,23 @@
* 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/. */
/**
* ChromeWorker for parseICSAsync method in calICSService.js
*/
/* eslint-env worker */
-/* import-globals-from ../../modules/ical.js */
+/* import-globals-from ../../modules/Ical.jsm */
var NS_OK = 0;
var NS_ERROR_FAILURE = 2147500037;
// eslint-disable-next-line no-unused-vars
-importScripts("resource://calendar/modules/ical.js");
+importScripts("resource://calendar/modules/Ical.jsm");
onmessage = function(event) {
try {
let comp = ICAL.parse(event.data);
postMessage({ rc: NS_OK, data: comp });
} catch (e) {
postMessage({ rc: NS_ERROR_FAILURE, data: "Exception occurred: " + e });
}
--- a/calendar/base/backend/icaljs/calICSService.js
+++ b/calendar/base/backend/icaljs/calICSService.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from calICALJSComponents.js */
var { ICAL, unwrapSetter, unwrapSingle, wrapGetter } = ChromeUtils.import(
- "resource://calendar/modules/ical.js"
+ "resource://calendar/modules/Ical.jsm"
);
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
function calIcalProperty(innerObject) {
this.innerObject = innerObject || new ICAL.Property();
this.wrappedJSObject = this;
}
--- a/calendar/base/backend/icaljs/calPeriod.js
+++ b/calendar/base/backend/icaljs/calPeriod.js
@@ -1,15 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from calICALJSComponents.js */
-var { ICAL, unwrapSetter, wrapGetter } = ChromeUtils.import("resource://calendar/modules/ical.js");
+var { ICAL, unwrapSetter, wrapGetter } = ChromeUtils.import("resource://calendar/modules/Ical.jsm");
function calPeriod(innerObject) {
this.innerObject = innerObject || new ICAL.Period({});
this.wrappedJSObject = this;
}
calPeriod.prototype = {
QueryInterface: ChromeUtils.generateQI([Ci.calIPeriod]),
--- a/calendar/base/backend/icaljs/calRecurrenceRule.js
+++ b/calendar/base/backend/icaljs/calRecurrenceRule.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from calICALJSComponents.js */
var { ICAL, unwrapSetter, unwrapSingle, wrapGetter } = ChromeUtils.import(
- "resource://calendar/modules/ical.js"
+ "resource://calendar/modules/Ical.jsm"
);
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
function calRecurrenceRule(innerObject) {
this.innerObject = innerObject || new ICAL.Recur();
this.wrappedJSObject = this;
}
--- a/calendar/base/content/calendar-base-view.js
+++ b/calendar/base/content/calendar-base-view.js
@@ -4,17 +4,17 @@
/* global cal, currentView, calendarNavigationBar, MozElements, MozXULElement, Services,
toggleOrientation */
"use strict";
// Wrap in a block to prevent leaking to window scope.
{
- const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+ const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
/**
* Calendar observer for calendar view elements. Used in CalendarBaseView class.
*
* @implements {calIObserver}
* @implements {calICompositeObserver}
* @implements {calIAlarmServiceObserver}
*/
rename from calendar/base/modules/ical.js
rename to calendar/base/modules/Ical.jsm
--- a/calendar/base/modules/moz.build
+++ b/calendar/base/modules/moz.build
@@ -24,10 +24,10 @@ EXTRA_JS_MODULES.utils += [
'utils/calXMLUtils.jsm',
]
EXTRA_JS_MODULES += [
'calExtract.jsm',
'calHashedArray.jsm',
'calRecurrenceUtils.jsm',
'calUtils.jsm',
- 'ical.js',
+ 'Ical.jsm',
]
--- a/calendar/base/src/calTimezone.js
+++ b/calendar/base/src/calTimezone.js
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
-var { ICAL } = ChromeUtils.import("resource://calendar/modules/ical.js");
+var { ICAL } = ChromeUtils.import("resource://calendar/modules/Ical.jsm");
function calICALJSTimezone(innerObject) {
this.innerObject = innerObject || new ICAL.Timezone();
this.wrappedJSObject = this;
}
calICALJSTimezone.prototype = {
QueryInterface: ChromeUtils.generateQI([Ci.calITimezone]),
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -4,17 +4,17 @@
/* import-globals-from calTimezone.js */
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
var { cal } = ChromeUtils.import("resource://calendar/modules/calUtils.jsm");
-var { ICAL, unwrapSingle } = ChromeUtils.import("resource://calendar/modules/ical.js");
+var { ICAL, unwrapSingle } = ChromeUtils.import("resource://calendar/modules/Ical.jsm");
function calStringEnumerator(stringArray) {
this.mIndex = 0;
this.mStringArray = stringArray;
}
calStringEnumerator.prototype = {
// nsIUTF8StringEnumerator:
[Symbol.iterator]: function() {
--- a/common/src/ExtensionSupport.jsm
+++ b/common/src/ExtensionSupport.jsm
@@ -14,17 +14,17 @@ const { AddonManager } = ChromeUtils.imp
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// ChromeUtils.import("resource://gre/modules/Deprecated.jsm") - needed for warning.
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
-const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var extensionHooks = new Map();
var legacyExtensions = new Map();
var bootstrapExtensions = new Set();
var openWindowList;
var ExtensionSupport = {
/**
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -5,17 +5,17 @@
/* import-globals-from commandglue.js */
/* import-globals-from mailWindow.js */
/* import-globals-from ../../extensions/mailviews/content/msgViewPickerOverlay.js */
var { DBViewWrapper } = ChromeUtils.import(
"resource:///modules/DBViewWrapper.jsm"
);
var { JSTreeSelection } = ChromeUtils.import(
- "resource:///modules/jsTreeSelection.js"
+ "resource:///modules/JsTreeSelection.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var gFolderDisplay = null;
var gMessageDisplay = null;
/**
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -19,17 +19,17 @@ var {
} = ChromeUtils.import("resource:///modules/folderUtils.jsm");
var { fixIterator, toXPCOMArray } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var { FeedUtils } = ChromeUtils.import("resource:///modules/FeedUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
if (typeof FeedMessageHandler != "object") {
Services.scriptloader.loadSubScript(
"chrome://messenger-newsblog/content/newsblogOverlay.js"
);
}
--- a/mail/base/content/gloda-autocomplete-input.js
+++ b/mail/base/content/gloda-autocomplete-input.js
@@ -19,17 +19,17 @@ if (!customElements.get("autocomplete-in
customElements.whenDefined("autocomplete-input").then(() => {
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
+ "resource:///modules/gloda/GlodaMsgSearcher.jsm"
);
const { GlodaIMSearcher } = ChromeUtils.import(
"resource:///modules/search_im.jsm"
);
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
--- a/mail/base/content/glodaFacet.js
+++ b/mail/base/content/glodaFacet.js
@@ -1591,17 +1591,17 @@
authorNode.textContent = message.from.contact.name;
let toNode = this.to;
toNode.textContent = glodaFacetStrings.get(
"glodaFacetView.result.message.toLabel"
);
// this.author.textContent = ;
let { makeFriendlyDateAgo } = ChromeUtils.import(
- "resource:///modules/templateUtils.js"
+ "resource:///modules/TemplateUtils.jsm"
);
this.date.textContent = makeFriendlyDateAgo(message.date);
// - Recipients
try {
let recipientsNode = this.recipients;
if (message.recipients) {
let recipientCount = 0;
--- a/mail/base/content/glodaFacetTab.js
+++ b/mail/base/content/glodaFacetTab.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
-var { FacetDriver } = ChromeUtils.import("resource:///modules/gloda/facet.js");
+var { FacetDriver } = ChromeUtils.import("resource:///modules/gloda/Facet.jsm");
var glodaFacetTabType = {
name: "glodaFacet",
perTabPanel: "vbox",
lastTabId: 0,
strings: new StringBundle(
"chrome://messenger/locale/glodaFacetView.properties"
),
--- a/mail/base/content/glodaFacetView.js
+++ b/mail/base/content/glodaFacetView.js
@@ -3,39 +3,39 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This file provides the global context for the faceting environment. In the
* Model View Controller (paradigm), we are the view and the XBL widgets are
* the the view and controller.
*
* Because much of the work related to faceting is not UI-specific, we try and
- * push as much of it into mailnews/db/gloda/facet.js. In some cases we may
+ * push as much of it into mailnews/db/gloda/Facet.jsm. In some cases we may
* get it wrong and it may eventually want to migrate.
*/
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { TagUtils } = ChromeUtils.import("resource:///modules/TagUtils.jsm");
var { logObject, logException } = ChromeUtils.import(
- "resource:///modules/errUtils.js"
+ "resource:///modules/ErrUtils.jsm"
);
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
var { FacetDriver, FacetUtils } = ChromeUtils.import(
- "resource:///modules/gloda/facet.js"
+ "resource:///modules/gloda/Facet.jsm"
);
var glodaFacetStrings = new StringBundle(
"chrome://messenger/locale/glodaFacetView.properties"
);
/**
* Object containing query-explanantion binding methods.
--- a/mail/base/content/mailTabs.js
+++ b/mail/base/content/mailTabs.js
@@ -8,24 +8,24 @@
/* import-globals-from mailWindow.js */
/* import-globals-from mailWindowOverlay.js */
/* import-globals-from messageDisplay.js */
/* import-globals-from msgMail3PaneWindow.js */
var { MsgHdrSyntheticView } = ChromeUtils.import(
"resource:///modules/MsgHdrSyntheticView.jsm"
);
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { getSpecialFolderString } = ChromeUtils.import(
"resource:///modules/folderUtils.jsm"
);
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
/**
* Displays message "folder"s, mail "message"s, and "glodaList" results. The
* commonality is that they all use the "mailContent" panel's folder tree,
* thread tree, and message pane objects. This happens for historical reasons,
* likely involving the fact that prior to the introduction of this
* abstraction, everything was always stored in global objects. For the 3.0
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -16,25 +16,25 @@
// From netError.js
/* globals retryThis */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { appIdleManager } = ChromeUtils.import(
- "resource:///modules/appIdleManager.js"
+ "resource:///modules/AppIdleManager.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
// This file stores variables common to mail windows
var messenger;
var statusFeedback;
var msgWindow;
var accountManager;
--- a/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -14,17 +14,17 @@
/* import-globals-from mailCommands.js */
/* import-globals-from mailContextMenus.js */
/* import-globals-from mailWindow.js */
/* import-globals-from phishingDetector.js */
/* import-globals-from utilityOverlay.js */
var { FeedUtils } = ChromeUtils.import("resource:///modules/FeedUtils.jsm");
var { GlodaSyntheticView } = ChromeUtils.import(
- "resource:///modules/gloda/dbview.js"
+ "resource:///modules/gloda/GlodaSyntheticView.jsm"
);
var { MailConsts } = ChromeUtils.import("resource:///modules/MailConsts.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { PluralForm } = ChromeUtils.import(
--- a/mail/base/content/messageWindow.xhtml
+++ b/mail/base/content/messageWindow.xhtml
@@ -100,17 +100,17 @@
<script src="chrome://global/content/nsDragAndDrop.js"/>
<script src="chrome://messenger/content/msgViewNavigation.js"/>
<script src="chrome://messenger/content/editContactPanel.js"/>
<script src="chrome://messenger/content/toolbarIconColor.js"/>
<script src="chrome://messenger/content/msgHdrView.js"/>
<script src="chrome://messenger-smime/content/msgHdrViewSMIMEOverlay.js"/>
<script src="chrome://messenger-smime/content/msgReadSMIMEOverlay.js"/>
#ifdef MOZ_OPENPGP
- <script src="chrome://openpgp/content/bond.js"/>
+ <script src="chrome://openpgp/content/BondOpenPGP.jsm"/>
<script src="chrome://openpgp/content/ui/enigmailMessengerOverlay.js"/>
<script src="chrome://openpgp/content/ui/enigmailMsgHdrViewOverlay.js"/>
#endif
<script src="chrome://messenger/content/mailCommands.js"/>
<script src="chrome://messenger/content/junkCommands.js"/>
<script src="chrome://messenger/content/mailWindowOverlay.js"/>
<script src="chrome://messenger/content/mailTabs.js"/>
<script src="chrome://messenger-newsblog/content/newsblogOverlay.js"/>
--- a/mail/base/content/messenger.xhtml
+++ b/mail/base/content/messenger.xhtml
@@ -129,17 +129,17 @@
<script src="chrome://messenger/content/editContactPanel.js"/>
<script src="chrome://messenger/content/toolbarIconColor.js"/>
<script src="chrome://messenger/content/jsTreeView.js"/>
<script src="chrome://messenger/content/msgHdrView.js"/>
<script src="chrome://global/content/nsDragAndDrop.js"/>
<script src="chrome://messenger-smime/content/msgHdrViewSMIMEOverlay.js"/>
<script src="chrome://messenger-smime/content/msgReadSMIMEOverlay.js"/>
#ifdef MOZ_OPENPGP
-<script src="chrome://openpgp/content/bond.js"/>
+<script src="chrome://openpgp/content/BondOpenPGP.jsm"/>
<script src="chrome://openpgp/content/ui/enigmailMessengerOverlay.js"/>
<script src="chrome://openpgp/content/ui/enigmailMsgHdrViewOverlay.js"/>
#endif
<script src="chrome://messenger/content/chat/chat-messenger.js"/>
<script src="chrome://messenger/content/chat/imStatusSelector.js"/>
<script src="chrome://messenger/content/chat/imContextMenu.js"/>
<script src="chrome://messenger/content/chat/chat-conversation.js"/>
<script src="chrome://messenger/content/preferences/preferencesTab.js"/>
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -22,17 +22,19 @@ var { MailConstants } = ChromeUtils.impo
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { DisplayNameUtils } = ChromeUtils.import(
"resource:///modules/DisplayNameUtils.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
+var { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
+);
var { Status: statusUtils } = ChromeUtils.import(
"resource:///modules/imStatusUtils.jsm"
);
// Warning: It's critical that the code in here for displaying the message
// headers for a selected message remain as fast as possible. In particular,
// right now, we only introduce one reflow per message. i.e. if you click on
// a message in the thread pane, we batch up all the changes for displaying
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -1,16 +1,16 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from ../../../../toolkit/modules/PageMenu.jsm */
/* import-globals-from ../../../mailnews/base/prefs/content/accountUtils.js */
-/* import-globals-from ../../../mailnews/base/util/mailnewsMigrator.js */
+/* import-globals-from ../../../mailnews/base/util/MailnewsMigrator.jsm */
/* import-globals-from ../../components/newmailaccount/content/accountProvisionerTab.js */
/* import-globals-from ../../components/preferences/preferencesTab.js */
/* import-globals-from messenger-customization.js */
/* import-globals-from commandglue.js */
/* import-globals-from folderDisplay.js */
/* import-globals-from folderPane.js */
/* import-globals-from glodaFacetTab.js */
/* import-globals-from mailTabs.js */
@@ -18,33 +18,33 @@
/* import-globals-from quickFilterBar.js */
/* import-globals-from searchBar.js */
/* import-globals-from searchBar.js */
/* import-globals-from specialTabs.js */
/* import-globals-from toolbarIconColor.js */
/* globals PanelUI */
ChromeUtils.import("resource:///modules/activity/activityModules.jsm");
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var { JSTreeSelection } = ChromeUtils.import(
- "resource:///modules/jsTreeSelection.js"
+ "resource:///modules/JsTreeSelection.jsm"
);
var { MailConsts } = ChromeUtils.import("resource:///modules/MailConsts.jsm");
var { MailInstrumentation } = ChromeUtils.import(
"resource:///modules/MailInstrumentation.jsm"
);
var { migrateMailnews } = ChromeUtils.import(
- "resource:///modules/mailnewsMigrator.js"
+ "resource:///modules/MailnewsMigrator.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { msgDBCacheManager } = ChromeUtils.import(
- "resource:///modules/msgDBCacheManager.js"
+ "resource:///modules/MsgDBCacheManager.jsm"
);
var { SessionStoreManager } = ChromeUtils.import(
"resource:///modules/SessionStoreManager.jsm"
);
var { SummaryFrameManager } = ChromeUtils.import(
"resource:///modules/SummaryFrameManager.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
--- a/mail/base/content/multimessageview.js
+++ b/mail/base/content/multimessageview.js
@@ -1,32 +1,32 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { mimeMsgToContentSnippetAndMeta } = ChromeUtils.import(
- "resource:///modules/gloda/connotent.js"
+ "resource:///modules/gloda/GlodaContent.jsm"
);
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
var { DisplayNameUtils } = ChromeUtils.import(
"resource:///modules/DisplayNameUtils.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { TagUtils } = ChromeUtils.import("resource:///modules/TagUtils.jsm");
var { PluralStringFormatter, makeFriendlyDateAgo } = ChromeUtils.import(
- "resource:///modules/templateUtils.js"
+ "resource:///modules/TemplateUtils.jsm"
);
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Set up our string formatter for localizing strings.
XPCOMUtils.defineLazyGetter(this, "formatString", function() {
let formatter = new PluralStringFormatter(
"chrome://messenger/locale/multimessageview.properties"
--- a/mail/base/content/quickFilterBar.js
+++ b/mail/base/content/quickFilterBar.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from folderDisplay.js */
/* import-globals-from mailWindow.js */
var { logException, errorWithDebug } = ChromeUtils.import(
- "resource:///modules/errUtils.js"
+ "resource:///modules/ErrUtils.jsm"
);
var {
MessageTextFilter,
QuickFilterManager,
QuickFilterSearchListener,
QuickFilterState,
} = ChromeUtils.import("resource:///modules/QuickFilterManager.jsm");
var { SearchSpec } = ChromeUtils.import("resource:///modules/SearchSpec.jsm");
--- a/mail/base/content/searchBar.js
+++ b/mail/base/content/searchBar.js
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var gSearchBundle;
var gStatusBar = document.getElementById("statusbar-icon");
/**
* The glodasearch widget is a UI widget (the #searchInput textbox) which is
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -11,17 +11,17 @@
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { AddonManager } = ChromeUtils.import(
"resource://gre/modules/AddonManager.jsm"
);
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var { ExtensionParent } = ChromeUtils.import(
"resource://gre/modules/ExtensionParent.jsm"
);
function tabProgressListener(aTab, aStartsBlank) {
this.mTab = aTab;
this.mBrowser = aTab.browser;
--- a/mail/base/content/tabmail.js
+++ b/mail/base/content/tabmail.js
@@ -10,17 +10,17 @@
/* import-globals-from mailWindow.js */
// Wrap in a block to prevent leaking to window scope.
{
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
+ "resource:///modules/gloda/GlodaMsgSearcher.jsm"
);
/**
* The MozTabmailAlltabsMenuPopup widget is used as a menupopup to list all the
* currently opened tabs.
*
* @extends {MozElements.MozMenuPopup}
* @implements {EventListener}
--- a/mail/base/modules/AppUpdateUI.jsm
+++ b/mail/base/modules/AppUpdateUI.jsm
@@ -13,17 +13,17 @@ const { XPCOMUtils } = ChromeUtils.impor
const { BrowserUtils } = ChromeUtils.import(
"resource://gre/modules/BrowserUtils.jsm"
);
const { clearTimeout, setTimeout } = ChromeUtils.import(
"resource://gre/modules/Timer.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
const PREF_APP_UPDATE_UNSUPPORTED_URL = "app.update.unsupported.url";
const ANCHOR_ID = "app-update-notification-icon";
const NOTIFICATION_ID = "app-update";
XPCOMUtils.defineLazyGetter(this, "appUpdateBundle", function() {
--- a/mail/base/modules/DBViewWrapper.jsm
+++ b/mail/base/modules/DBViewWrapper.jsm
@@ -7,17 +7,17 @@ this.EXPORTED_SYMBOLS = ["DBViewWrapper"
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { MailViewConstants, MailViewManager } = ChromeUtils.import(
"resource:///modules/MailViewManager.jsm"
);
const { SearchSpec } = ChromeUtils.import("resource:///modules/SearchSpec.jsm");
const { VirtualFolderHelper } = ChromeUtils.import(
- "resource:///modules/virtualFolderWrapper.js"
+ "resource:///modules/VirtualFolderWrapper.jsm"
);
var MSG_VIEW_FLAG_DUMMY = 0x20000000;
var nsMsgViewIndex_None = 0xffffffff;
/**
* Helper singleton for DBViewWrapper that tells instances when something
--- a/mail/base/modules/DisplayNameUtils.jsm
+++ b/mail/base/modules/DisplayNameUtils.jsm
@@ -4,17 +4,17 @@
const { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var EXPORTED_SYMBOLS = ["DisplayNameUtils"];
var DisplayNameUtils = {
formatDisplayName,
formatDisplayNameList,
getCardForEmail,
--- a/mail/base/modules/ExtensionsUI.jsm
+++ b/mail/base/modules/ExtensionsUI.jsm
@@ -19,17 +19,17 @@ const { BrowserUtils } = ChromeUtils.imp
);
XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm",
AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm",
ExtensionData: "resource://gre/modules/Extension.jsm",
PluralForm: "resource://gre/modules/PluralForm.jsm",
Services: "resource://gre/modules/Services.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
- StringBundle: "resource:///modules/StringBundle.js",
+ StringBundle: "resource:///modules/StringBundle.jsm",
});
XPCOMUtils.defineLazyGetter(this, "addonsBundle", function() {
return new StringBundle(ADDONS_PROPERTIES);
});
XPCOMUtils.defineLazyGetter(this, "brandBundle", function() {
return new StringBundle(BRAND_PROPERTIES);
});
--- a/mail/base/modules/MailInstrumentation.jsm
+++ b/mail/base/modules/MailInstrumentation.jsm
@@ -7,17 +7,17 @@
*/
/* :::::::: Constants and Helpers ::::::::::::::: */
this.EXPORTED_SYMBOLS = ["MailInstrumentation"];
var nsIMFNService = Ci.nsIMsgFolderNotificationService;
-const { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+const { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/* :::::::: The Module ::::::::::::::: */
var MailInstrumentation = {
--- a/mail/base/modules/MailMigrator.jsm
+++ b/mail/base/modules/MailMigrator.jsm
@@ -15,17 +15,17 @@ ChromeUtils.defineModuleGetter(
this,
"AddrBookDirectory",
"resource:///modules/AddrBookDirectory.jsm"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var MailMigrator = {
/**
* Switch the given fonts to the given encodings, but only if the current fonts
* are defaults.
*/
_switchDefaultFonts(aFonts, aEncodings) {
for (let encoding of aEncodings) {
--- a/mail/base/modules/QuickFilterManager.jsm
+++ b/mail/base/modules/QuickFilterManager.jsm
@@ -13,30 +13,30 @@ const { PluralForm } = ChromeUtils.impor
"resource://gre/modules/PluralForm.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { logException, logObject } = ChromeUtils.import(
- "resource:///modules/errUtils.js"
+ "resource:///modules/ErrUtils.jsm"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// XXX we need to know whether the gloda indexer is enabled for upsell reasons,
// but this should really just be exposed on the main Gloda public interface.
const { GlodaIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
// we need to be able to create gloda message searcher instances for upsells:
const { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
+ "resource:///modules/gloda/GlodaMsgSearcher.jsm"
);
/**
* Shallow object copy.
*/
function shallowObjCopy(obj) {
let newObj = {};
for (let key in obj) {
@@ -994,17 +994,17 @@ var MessageTextFilter = {
name: "text",
domId: "qfb-qs-textbox",
/**
* Parse the string into terms/phrases by finding matching double-quotes. If
* we find a quote that doesn't have a friend, we assume the user was going
* to put a quote at the end of the string. (This is important because we
* update using a timer and this results in stable behavior.)
*
- * This code is cloned from gloda's msg_search.js and known good (enough :).
+ * This code is cloned from gloda's GlodaMsgSearcher.jsm and known good (enough :).
* I did change the friendless quote situation, though.
*
* @param aSearchString The phrase to parse up.
* @return A list of terms.
*/
_parseSearchString(aSearchString) {
aSearchString = aSearchString.trim();
let terms = [];
--- a/mail/base/test/unit/head_mailbase.js
+++ b/mail/base/test/unit/head_mailbase.js
@@ -1,17 +1,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../";
--- a/mail/base/test/unit/resources/viewWrapperTestUtils.js
+++ b/mail/base/test/unit/resources/viewWrapperTestUtils.js
@@ -5,17 +5,17 @@
var { DBViewWrapper, IDBViewWrapperListener } = ChromeUtils.import(
"resource:///modules/DBViewWrapper.jsm"
);
var { MailViewManager, MailViewConstants } = ChromeUtils.import(
"resource:///modules/MailViewManager.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { VirtualFolderHelper } = ChromeUtils.import(
- "resource:///modules/virtualFolderWrapper.js"
+ "resource:///modules/VirtualFolderWrapper.jsm"
);
var { toXPCOMArray } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
// Only load these files if we're an XPCShell test. This file is also included by
// MozMill tests (mail/test/mozmill/shared-modules/test-folder-display-helpers.js).
if (
@@ -23,18 +23,18 @@ if (
.getService(Ci.nsIEnvironment)
.exists("XPCSHELL_TEST_PROFILE_DIR")
) {
/* import-globals-from ../../../../../mailnews/test/resources/logHelper.js */
load("../../../../mailnews/resources/logHelper.js");
/* import-globals-from ../../../../../mailnews/test/resources/asyncTestUtils.js */
load("../../../../mailnews/resources/asyncTestUtils.js");
- /* import-globals-from ../../../../../mailnews/test/resources/messageGenerator.js */
- load("../../../../mailnews/resources/messageGenerator.js");
+ /* import-globals-from ../../../../../mailnews/test/resources/MessageGenerator.jsm */
+ load("../../../../mailnews/resources/MessageGenerator.jsm");
/* import-globals-from ../../../../../mailnews/test/resources/messageModifier.js */
load("../../../../mailnews/resources/messageModifier.js");
/* import-globals-from ../../../../../mailnews/test/resources/messageInjection.js */
load("../../../../mailnews/resources/messageInjection.js");
}
var gInbox;
--- a/mail/base/test/unit/test_alertHook.js
+++ b/mail/base/test/unit/test_alertHook.js
@@ -7,17 +7,17 @@ var { XPCOMUtils } = ChromeUtils.import(
);
var { alertHook } = ChromeUtils.import(
"resource:///modules/activity/alertHook.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MockFactory } = ChromeUtils.import(
- "resource://testing-common/mailnews/MockFactory.js"
+ "resource://testing-common/mailnews/MockFactory.jsm"
);
alertHook.init();
// Replace the alerts service with our own. This will let us check if we're
// prompting or not.
var gAlertShown = false;
var mockAlertsService = {
rename from mail/components/appIdleManager.js
rename to mail/components/AppIdleManager.jsm
--- a/mail/components/MailGlue.jsm
+++ b/mail/components/MailGlue.jsm
@@ -241,17 +241,17 @@ MailGlue.prototype = {
_onMailStartupDone() {
// On Windows 7 and above, initialize the jump list module.
const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
if (
WINTASKBAR_CONTRACTID in Cc &&
Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available
) {
const { WinTaskbarJumpList } = ChromeUtils.import(
- "resource:///modules/windowsJumpLists.js"
+ "resource:///modules/WindowsJumpLists.jsm"
);
WinTaskbarJumpList.startup();
}
const { ExtensionsUI } = ChromeUtils.import(
"resource:///modules/ExtensionsUI.jsm"
);
ExtensionsUI.checkForSideloadedExtensions();
rename from mail/components/about-support/aboutSupportMac.js
rename to mail/components/about-support/AboutSupportMac.jsm
rename from mail/components/about-support/aboutSupportUnix.js
rename to mail/components/about-support/AboutSupportUnix.jsm
rename from mail/components/about-support/aboutSupportWin32.js
rename to mail/components/about-support/AboutSupportWin32.jsm
--- a/mail/components/about-support/content/accounts.js
+++ b/mail/components/about-support/content/accounts.js
@@ -12,23 +12,23 @@ var { MailServices } = ChromeUtils.impor
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// Platform-specific includes
var AboutSupportPlatform;
if ("@mozilla.org/windows-registry-key;1" in Cc) {
- let temp = ChromeUtils.import("resource:///modules/aboutSupportWin32.js");
+ let temp = ChromeUtils.import("resource:///modules/AboutSupportWin32.jsm");
AboutSupportPlatform = temp.AboutSupportPlatform;
} else if ("nsILocalFileMac" in Ci) {
- let temp = ChromeUtils.import("resource:///modules/aboutSupportMac.js");
+ let temp = ChromeUtils.import("resource:///modules/AboutSupportMac.jsm");
AboutSupportPlatform = temp.AboutSupportPlatform;
} else {
- let temp = ChromeUtils.import("resource:///modules/aboutSupportUnix.js");
+ let temp = ChromeUtils.import("resource:///modules/AboutSupportUnix.jsm");
AboutSupportPlatform = temp.AboutSupportPlatform;
}
var gMessengerBundle = Services.strings.createBundle(
"chrome://messenger/locale/messenger.properties"
);
var gSocketTypes = {};
--- a/mail/components/about-support/moz.build
+++ b/mail/components/about-support/moz.build
@@ -1,13 +1,13 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- EXTRA_JS_MODULES += ['aboutSupportWin32.js']
+ EXTRA_JS_MODULES += ['AboutSupportWin32.jsm']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- EXTRA_JS_MODULES += ['aboutSupportMac.js']
+ EXTRA_JS_MODULES += ['AboutSupportMac.jsm']
else:
- EXTRA_JS_MODULES += ['aboutSupportUnix.js']
+ EXTRA_JS_MODULES += ['AboutSupportUnix.jsm']
JAR_MANIFESTS += ['jar.mn']
--- a/mail/components/accountcreation/content/emailWizard.js
+++ b/mail/components/accountcreation/content/emailWizard.js
@@ -19,17 +19,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { OAuth2Providers } = ChromeUtils.import(
"resource:///modules/OAuth2Providers.jsm"
);
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var {
cleanUpHostName,
isLegalHostNameOrIP,
kMaxPort,
kMinPort,
} = ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
/**
--- a/mail/components/accountcreation/content/exchangeAutoDiscover.js
+++ b/mail/components/accountcreation/content/exchangeAutoDiscover.js
@@ -7,17 +7,17 @@
/* import-globals-from guessConfig.js */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(
this,
"AddonManager",
"resource://gre/modules/AddonManager.jsm"
);
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
/**
* Tries to get a configuration from an MS Exchange server
* using Microsoft AutoDiscover protocol.
*
* Disclaimers:
* - To support domain hosters, we cannot use SSL. That means we
* rely on insecure DNS and http, which means the results may be
--- a/mail/components/accountcreation/content/fetchConfig.js
+++ b/mail/components/accountcreation/content/fetchConfig.js
@@ -4,17 +4,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from emailWizard.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { JXON } = ChromeUtils.import("resource:///modules/JXON.js");
+var { JXON } = ChromeUtils.import("resource:///modules/JXON.jsm");
var { DNS } = ChromeUtils.import("resource:///modules/DNS.jsm");
/**
* Tries to find a configuration for this ISP on the local harddisk, in the
* application install directory's "isp" subdirectory.
* Params @see fetchConfigFromISP()
*/
function fetchConfigFromDisk(domain, successCallback, errorCallback) {
--- a/mail/components/accountcreation/content/fetchhttp.js
+++ b/mail/components/accountcreation/content/fetchhttp.js
@@ -12,18 +12,18 @@
* fetched resource is so small (<1 10 KB) that the roundtrip and
* response generation is far more significant than the
* download time of the response. In other words, it's fine for RPC,
* but not for bigger file downloads.
*/
/* import-globals-from emailWizard.js */
-var { JXON } = ChromeUtils.import("resource:///modules/JXON.js");
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { JXON } = ChromeUtils.import("resource:///modules/JXON.jsm");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
/**
* Set up a fetch.
*
* @param {string} url - URL of the server function.
* ATTENTION: The caller needs to make sure that the URL is secure to call.
* @param {Object} args - Additional parameters as properties, see below
*
--- a/mail/components/accountcreation/content/guessConfig.js
+++ b/mail/components/accountcreation/content/guessConfig.js
@@ -1,16 +1,16 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from emailWizard.js */
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// This is a bit ugly - we set outgoingDone to false
// when emailWizard.js cancels the outgoing probe because the user picked
// an outoing server. It does this by poking the probeAbortable object,
// so we need outgoingDone to have global scope.
var outgoingDone = false;
--- a/mail/components/accountcreation/content/readFromXML.js
+++ b/mail/components/accountcreation/content/readFromXML.js
@@ -1,16 +1,16 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from emailWizard.js */
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
var {
cleanUpHostName,
isLegalHostNameOrIP,
kMaxPort,
kMinPort,
} = ChromeUtils.import("resource:///modules/hostnameUtils.jsm");
/* eslint-disable complexity */
--- a/mail/components/accountcreation/content/util.js
+++ b/mail/components/accountcreation/content/util.js
@@ -3,17 +3,17 @@
* 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/. */
/**
* Some common, generic functions
*/
/* import-globals-from emailWizard.js */
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// --------------------------
// Low level, basic functions
function assert(test, errorMsg) {
if (!test) {
throw new NotReached(
@@ -659,17 +659,17 @@ function deepCopy(org) {
}
for (var prop in org) {
result[prop] = deepCopy(org[prop]);
}
return result;
}
if (typeof gEmailWizardLogger == "undefined") {
- var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+ var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.setup");
gEmailWizardLogger.level = Log4Moz.Level.Info;
gEmailWizardLogger.addAppender(
new Log4Moz.ConsoleAppender(new Log4Moz.BasicFormatter())
); // browser console
}
function ddump(text) {
--- a/mail/components/accountcreation/content/verifyConfig.js
+++ b/mail/components/accountcreation/content/verifyConfig.js
@@ -6,20 +6,20 @@
/* import-globals-from emailWizard.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { OAuth2Providers } = ChromeUtils.import(
"resource:///modules/OAuth2Providers.jsm"
);
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
if (typeof gEmailWizardLogger == "undefined") {
- var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+ var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var gEmailWizardLogger = Log4Moz.getConfiguredLogger("mail.wizard");
}
/**
* This checks a given config, by trying a real connection and login,
* with username and password.
*
* TODO
--- a/mail/components/activity/Activity.jsm
+++ b/mail/components/activity/Activity.jsm
@@ -1,15 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var EXPORTED_SYMBOLS = ["ActivityProcess", "ActivityEvent", "ActivityWarning"];
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
// Base class for ActivityProcess and ActivityEvent objects
function Activity() {
this._initLogging();
this._listeners = [];
this._subjects = [];
}
--- a/mail/components/activity/ActivityManager.jsm
+++ b/mail/components/activity/ActivityManager.jsm
@@ -1,16 +1,16 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var EXPORTED_SYMBOLS = ["ActivityManager"];
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
function ActivityManager() {}
ActivityManager.prototype = {
log: Log4Moz.getConfiguredLogger("ActivityManager"),
_listeners: [],
_processCount: 0,
_db: null,
--- a/mail/components/activity/content/activity-widgets.js
+++ b/mail/components/activity/content/activity-widgets.js
@@ -7,20 +7,20 @@
/* global MozXULElement, MozElements, activityManager */
// Wrap in a block to prevent leaking to window scope.
{
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const { Log4Moz } = ChromeUtils.import(
- "resource:///modules/gloda/log4moz.js"
+ "resource:///modules/gloda/Log4moz.jsm"
);
const { makeFriendlyDateAgo } = ChromeUtils.import(
- "resource:///modules/templateUtils.js"
+ "resource:///modules/TemplateUtils.jsm"
);
/**
* The MozActivityBaseRichlistItem widget is the base class for all the
* activity item. It initializes activity details: i.e. id, status,
* icon, name, progress, date etc. for the activity widgets.
*
* @abstract
* @extends {MozElements.MozRichlistitem}
--- a/mail/components/activity/content/activity.js
+++ b/mail/components/activity/content/activity.js
@@ -1,14 +1,14 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const activityManager = Cc["@mozilla.org/activity-manager;1"].getService(
Ci.nsIActivityManager
);
var ACTIVITY_LIMIT = 250;
var activityObject = {
_activityMgrListener: null,
--- a/mail/components/activity/modules/autosync.jsm
+++ b/mail/components/activity/modules/autosync.jsm
@@ -12,17 +12,17 @@ var nsActProcess = Components.Constructo
);
var nsActEvent = Components.Constructor(
"@mozilla.org/activity-event;1",
"nsIActivityEvent",
"init"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var nsIAutoSyncMgrListener = Ci.nsIAutoSyncMgrListener;
/**
* This code aims to mediate between the auto-sync code and the activity mgr.
*
* Not every auto-sync activity is directly mapped to a process or event.
* To prevent a possible event overflow, Auto-Sync monitor generates one
--- a/mail/components/activity/modules/glodaIndexer.jsm
+++ b/mail/components/activity/modules/glodaIndexer.jsm
@@ -15,20 +15,22 @@ var nsActEvent = Components.Constructor(
"nsIActivityEvent",
"init"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
+const { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+);
const { GlodaIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
/**
* Gloda message indexer feedback.
*/
var glodaIndexerActivity = {
get log() {
delete this.log;
--- a/mail/components/activity/modules/moveCopy.jsm
+++ b/mail/components/activity/modules/moveCopy.jsm
@@ -13,17 +13,17 @@ var nsActEvent = Components.Constructor(
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
// This module provides a link between the move/copy code and the activity
// manager.
var moveCopyModule = {
lastMessage: {},
lastFolder: {},
get log() {
--- a/mail/components/activity/modules/pop3Download.jsm
+++ b/mail/components/activity/modules/pop3Download.jsm
@@ -13,17 +13,17 @@ var nsActEvent = Components.Constructor(
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
// This module provides a link between the pop3 service code and the activity
// manager.
var pop3DownloadModule = {
// hash table of most recent download items per folder
_mostRecentActivityForFolder: new Map(),
// hash table of prev download items per folder, so we can
// coalesce consecutive no new message events.
--- a/mail/components/activity/modules/sendLater.jsm
+++ b/mail/components/activity/modules/sendLater.jsm
@@ -17,17 +17,17 @@ var nsActEvent = Components.Constructor(
);
var nsActWarning = Components.Constructor(
"@mozilla.org/activity-warning;1",
"nsIActivityWarning",
"init"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
/**
* This really, really, sucks. Due to mailnews widespread use of
* nsIMsgStatusFeedback we're bound to the UI to get any sensible feedback of
* mail sending operations. The current send later code can't hook into the
* progress listener easily to get the state of messages being sent, so we'll
* just have to do it here.
*/
--- a/mail/components/addrbook/content/abCommon.js
+++ b/mail/components/addrbook/content/abCommon.js
@@ -8,17 +8,17 @@
/* import-globals-from ../../../../mailnews/addrbook/content/abResultsPane.js */
/* import-globals-from ../../../base/content/utilityOverlay.js */
/* import-globals-from abTrees.js */
/* import-globals-from addressbook.js */
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
var { PrivateBrowsingUtils } = ChromeUtils.import(
"resource://gre/modules/PrivateBrowsingUtils.jsm"
);
var gDirTree;
var abList = null;
--- a/mail/components/addrbook/content/abTrees.js
+++ b/mail/components/addrbook/content/abTrees.js
@@ -9,17 +9,17 @@
* This file contains our implementation for various addressbook trees. It
* depends on jsTreeView.js being loaded before this script is loaded.
*/
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
const DIRTYPE_JS = 101;
// Tree Sort helper methods.
var AB_ORDER = ["aab", "pab", "js", "ldap", "mapi+other", "anyab", "cab"];
function getDirectoryValue(aDir, aKey) {
if (aKey == "ab_type") {
--- a/mail/components/addrbook/test/browser/browser_ldap_search.js
+++ b/mail/components/addrbook/test/browser/browser_ldap_search.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 { LDAPServer } = ChromeUtils.import(
"resource://testing-common/LDAPServer.jsm"
);
const { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
const jsonFile =
"http://mochi.test:8888/browser/comm/mail/components/addrbook/test/browser/ldap_contacts.json";
add_task(async () => {
LDAPServer.open();
let response = await fetch(jsonFile);
--- a/mail/components/addrbook/test/browser/browser_mailing_lists.js
+++ b/mail/components/addrbook/test/browser/browser_mailing_lists.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* globals DisplayNameUtils, fixIterator, MailServices, MailUtils */
const { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
const inputs = {
abName: "Mochitest Address Book",
mlName: "Mochitest Mailing List",
nickName: "Nicky",
description: "Just a test mailing list.",
addresses: [
--- a/mail/components/extensions/parent/ext-messages.js
+++ b/mail/components/extensions/parent/ext-messages.js
@@ -1,31 +1,31 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
ChromeUtils.defineModuleGetter(
this,
"Gloda",
- "resource:///modules/gloda/public.js"
+ "resource:///modules/gloda/GlodaPublic.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"MailServices",
"resource:///modules/MailServices.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"MessageArchiver",
"resource:///modules/MessageArchiver.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"MsgHdrToMimeMessage",
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"toXPCOMArray",
"resource:///modules/iteratorUtils.jsm"
);
ChromeUtils.defineModuleGetter(
this,
--- a/mail/components/extensions/test/browser/browser_ext_menus.js
+++ b/mail/components/extensions/test/browser/browser_ext_menus.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
let gAccount, gFolders;
const { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
const treeClick = mailTestUtils.treeClick.bind(null, EventUtils, window);
async function checkShownEvent(extension, menuIds, contexts) {
let [info, tab] = await extension.awaitMessage("onShown");
is(info.menuIds.length, menuIds.length);
for (let i = 0; i < menuIds.length; i++) {
--- a/mail/components/extensions/test/browser/head.js
+++ b/mail/components/extensions/test/browser/head.js
@@ -41,17 +41,17 @@ function addIdentity(account) {
identity.email = "mochitest@localhost";
account.addIdentity(identity);
account.defaultIdentity = identity;
info(`Created identity ${identity.toString()}`);
}
function createMessages(folder, count) {
const { MessageGenerator } = ChromeUtils.import(
- "resource://testing-common/mailnews/messageGenerator.js"
+ "resource://testing-common/mailnews/MessageGenerator.jsm"
);
let messages = new MessageGenerator().makeMessages({ count });
let messageStrings = messages.map(message => message.toMboxString());
folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
folder.addMessageBatch(messageStrings);
}
async function promiseAnimationFrame(win = window) {
--- a/mail/components/extensions/test/xpcshell/head.js
+++ b/mail/components/extensions/test/xpcshell/head.js
@@ -59,17 +59,17 @@ function addIdentity(account, email = "x
if (!account.defaultIdentity) {
account.defaultIdentity = identity;
}
info(`Created identity ${identity.toString()}`);
}
function createMessages(folder, count) {
const { MessageGenerator } = ChromeUtils.import(
- "resource://testing-common/mailnews/messageGenerator.js"
+ "resource://testing-common/mailnews/MessageGenerator.jsm"
);
let messages = new MessageGenerator().makeMessages({
count,
age_incr: { days: 2 },
});
let messageStrings = messages.map(message => message.toMboxString());
folder.QueryInterface(Ci.nsIMsgLocalMailFolder);
folder.addMessageBatch(messageStrings);
--- a/mail/components/extensions/test/xpcshell/test_ext_accounts.js
+++ b/mail/components/extensions/test/xpcshell/test_ext_accounts.js
@@ -4,19 +4,19 @@
"use strict";
var { ExtensionTestUtils } = ChromeUtils.import(
"resource://testing-common/ExtensionXPCShellUtils.jsm"
);
ExtensionTestUtils.init(this);
-var imapd = ChromeUtils.import("resource://testing-common/mailnews/imapd.js");
+var imapd = ChromeUtils.import("resource://testing-common/mailnews/Imapd.jsm");
var { nsMailServer } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
add_task(async function test_accounts() {
let extension = ExtensionTestUtils.loadExtension({
async background() {
--- a/mail/components/extensions/test/xpcshell/test_ext_messages_get.js
+++ b/mail/components/extensions/test/xpcshell/test_ext_messages_get.js
@@ -4,25 +4,25 @@
"use strict";
var { ExtensionTestUtils } = ChromeUtils.import(
"resource://testing-common/ExtensionXPCShellUtils.jsm"
);
ExtensionTestUtils.init(this);
-var imapd = ChromeUtils.import("resource://testing-common/mailnews/imapd.js");
+var imapd = ChromeUtils.import("resource://testing-common/mailnews/Imapd.jsm");
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { MessageGenerator } = ChromeUtils.import(
- "resource://testing-common/mailnews/messageGenerator.js"
+ "resource://testing-common/mailnews/MessageGenerator.jsm"
);
var { nsMailServer } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
/**
* Create a local mail account and add a message.
*/
--- a/mail/components/extensions/test/xpcshell/test_ext_messages_query.js
+++ b/mail/components/extensions/test/xpcshell/test_ext_messages_query.js
@@ -4,19 +4,19 @@
"use strict";
var { ExtensionTestUtils } = ChromeUtils.import(
"resource://testing-common/ExtensionXPCShellUtils.jsm"
);
ExtensionTestUtils.init(this);
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
var { GlodaIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
// Create some folders and populate them.
let account, rootFolder;
let subFolders = {};
add_task(async function setup() {
GlodaIndexer._INDEX_INTERVAL = 0;
--- a/mail/components/im/modules/chatNotifications.jsm
+++ b/mail/components/im/modules/chatNotifications.jsm
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["Notifications"];
const { Services } = ChromeUtils.import("resource:///modules/imServices.jsm");
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
const { clearTimeout, setTimeout } = ChromeUtils.import(
--- a/mail/components/im/modules/index_im.jsm
+++ b/mail/components/im/modules/index_im.jsm
@@ -1,22 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = [];
var CC = Components.Constructor;
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+const { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+);
const { GlodaAccount } = ChromeUtils.import(
- "resource:///modules/gloda/datamodel.js"
+ "resource:///modules/gloda/GlodaDataModel.jsm"
);
const { GlodaIndexer, IndexingJob } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
const { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { Services } = ChromeUtils.import("resource:///modules/imServices.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
@@ -34,17 +36,17 @@ ChromeUtils.defineModuleGetter(this, "OS
ChromeUtils.defineModuleGetter(
this,
"AsyncShutdown",
"resource://gre/modules/AsyncShutdown.jsm"
);
ChromeUtils.defineModuleGetter(
this,
"GlodaDatastore",
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
var kCacheFileName = "indexedFiles.json";
var FileInputStream = CC(
"@mozilla.org/network/file-input-stream;1",
"nsIFileInputStream",
"init"
@@ -63,17 +65,17 @@ XPCOMUtils.defineLazyGetter(this, "MailF
Cc["@mozilla.org/mail/folder-factory;1?name=mailbox"].createInstance(
Ci.nsIMsgFolder
)
);
var gIMAccounts = {};
function GlodaIMConversation(aTitle, aTime, aPath, aContent) {
- // grokNounItem from gloda.js puts automatically the values of all
+ // grokNounItem from Gloda.jsm puts automatically the values of all
// JS properties in the jsonAttributes magic attribute, except if
// they start with _, so we put the values in _-prefixed properties,
// and have getters in the prototype.
this._title = aTitle;
this._time = aTime;
this._path = aPath;
this._content = aContent;
}
@@ -193,17 +195,17 @@ var IMConversationNoun = {
["path", "STRING"],
],
fulltextColumns: [["content", "STRING"]],
},
};
Gloda.defineNoun(IMConversationNoun);
// Needs to be set after calling defineNoun, otherwise it's replaced
-// by databind.js' implementation.
+// by GlodaDatabind.jsm' implementation.
IMConversationNoun.objFromRow = function(aRow) {
// Row columns are:
// 0 id
// 1 title
// 2 time
// 3 path
// 4 jsonAttributes
// 5 content
@@ -282,17 +284,17 @@ this._attrFulltext = Gloda.defineAttribu
attributeType: Gloda.kAttrDerived,
attributeName: "fulltextMatches",
singular: true,
special: Gloda.kSpecialFulltext,
specialColumnName: "imConversationsText",
subjectNouns: [IMConversationNoun.id],
objectNoun: Gloda.NOUN_FULLTEXT,
});
-// For facet.js DateFaceter
+// For Facet.jsm DateFaceter
Gloda.defineAttribute({
provider: WidgetProvider,
extensionName: EXT_NAME,
attributeType: Gloda.kAttrDerived,
attributeName: "date",
singular: true,
special: Gloda.kSpecialColumn,
subjectNouns: [IMConversationNoun.id],
--- a/mail/components/im/modules/search_im.jsm
+++ b/mail/components/im/modules/search_im.jsm
@@ -1,16 +1,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaIMSearcher"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+const { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+);
/**
* How much time boost should a 'score point' amount to? The authoritative,
* incontrivertible answer, across all time and space, is a week.
* Note that gloda stores conversation timestamps in seconds.
*/
// var FUZZSCORE_TIMESTAMP_FACTOR = 60 * 60 * 24 * 7;
--- a/mail/components/moz.build
+++ b/mail/components/moz.build
@@ -33,17 +33,17 @@ DIRS += ['build']
XPIDL_SOURCES += [
'nsIMailGlue.idl',
]
XPIDL_MODULE = 'mailcompsbase'
EXTRA_JS_MODULES += [
'AboutRedirector.jsm',
- 'appIdleManager.js',
+ 'AppIdleManager.jsm',
'MailGlue.jsm',
'MessengerContentHandler.jsm',
]
XPCOM_MANIFESTS += [
'components.conf',
]
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -8,22 +8,22 @@ var { AppConstants } = ChromeUtils.impor
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
// Get a configured logger for this component.
// To debug, set mail.provider.logging.dump (or .console)="All"
var gLog = Log4Moz.getConfiguredLogger("mail.provider");
var stringBundle = new StringBundle(
"chrome://messenger/locale/newmailaccount/accountProvisioner.properties"
);
--- a/mail/components/newmailaccount/content/accountProvisionerTab.js
+++ b/mail/components/newmailaccount/content/accountProvisionerTab.js
@@ -3,17 +3,17 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// mail/base/content/contentAreaClick.js
/* globals hRefForClickEvent, openLinkExternally */
// mail/base/content/specialTabs.js
/* globals specialTabs */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
/**
* A content tab for the account provisioner. We use Javascript-y magic to
* "subclass" specialTabs.contentTabType, and then override the appropriate
* members.
*
* Also note that accountProvisionerTab is a singleton (hence the maxTabs: 1).
*/
--- a/mail/components/newmailaccount/content/uriListener.js
+++ b/mail/components/newmailaccount/content/uriListener.js
@@ -11,17 +11,17 @@
* one of our account providers.
*/
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-var { JXON } = ChromeUtils.import("resource:///modules/JXON.js");
+var { JXON } = ChromeUtils.import("resource:///modules/JXON.jsm");
/**
* This is an observer that watches all HTTP requests for one where the
* response contentType contains text/xml. Once that observation is
* made, we ensure that the associated window for that request matches
* the window belonging to the content tab for the account order form.
* If so, we attach an nsITraceableListener to read the contents of the
* request response, and react accordingly if the contents can be turned
--- a/mail/components/search/SearchIntegration.jsm
+++ b/mail/components/search/SearchIntegration.jsm
@@ -13,17 +13,17 @@
* - gPrefBase: the base for preferences that are stored
* - gStreamListener: an nsIStreamListener to read message text
*/
/* exported SearchSupport */
var EXPORTED_SYMBOLS = ["SearchIntegration"];
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
--- a/mail/components/test/unit/head_mailcomponents.js
+++ b/mail/components/test/unit/head_mailcomponents.js
@@ -1,17 +1,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../";
--- a/mail/components/test/unit/test_about_support.js
+++ b/mail/components/test/unit/test_about_support.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// mail/components/about-support/content/accounts.js
/* globals AboutSupport, AboutSupportPlatform */
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
/*
* Test the about:support module.
*/
var gAccountList = [
{
--- a/mail/components/test/unit/test_autoconfigXML.js
+++ b/mail/components/test/unit/test_autoconfigXML.js
@@ -12,17 +12,17 @@
* reading and allow fallback mechanisms. This test checks whether that works,
* and of course also whether we can read a normal config and get the proper
* values.
*/
// Globals
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { JXON } = ChromeUtils.import("resource:///modules/JXON.js");
+var { JXON } = ChromeUtils.import("resource:///modules/JXON.jsm");
var xmlReader = {};
Services.scriptloader.loadSubScript(
"chrome://messenger/content/accountcreation/util.js",
xmlReader
);
Services.scriptloader.loadSubScript(
"chrome://messenger/content/accountcreation/accountConfig.js",
rename from mail/components/wintaskbar/windowsJumpLists.js
rename to mail/components/wintaskbar/WindowsJumpLists.jsm
--- a/mail/components/wintaskbar/moz.build
+++ b/mail/components/wintaskbar/moz.build
@@ -1,9 +1,9 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
EXTRA_JS_MODULES += [
- 'windowsJumpLists.js',
+ 'WindowsJumpLists.jsm',
]
rename from mail/extensions/openpgp/content/bond.js
rename to mail/extensions/openpgp/content/BondOpenPGP.jsm
--- a/mail/extensions/openpgp/content/modules/cryptoAPI.jsm
+++ b/mail/extensions/openpgp/content/modules/cryptoAPI.jsm
@@ -14,20 +14,20 @@ var Services = ChromeUtils.import("resou
function EnigmailCryptoAPI() {
if (!gCurrentApi) {
const gOpenPGPEngine = Services.prefs.getIntPref("temp.openpgp.engine");
if (gOpenPGPEngine == 1) {
const {
getRNPAPI
- } = ChromeUtils.import("chrome://openpgp/content/modules/cryptoAPI/rnp-cryptoAPI.js");
+ } = ChromeUtils.import("chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm");
gCurrentApi = getRNPAPI();
} else if (gOpenPGPEngine == 2) {
const {
getGnuPGAPI
- } = ChromeUtils.import("chrome://openpgp/content/modules/cryptoAPI/gnupg.js");
+ } = ChromeUtils.import("chrome://openpgp/content/modules/cryptoAPI/GnuPGCryptoAPI.jsm");
gCurrentApi = getGnuPGAPI();
}
}
return gCurrentApi;
}
rename from mail/extensions/openpgp/content/modules/cryptoAPI/gnupg.js
rename to mail/extensions/openpgp/content/modules/cryptoAPI/GnuPGCryptoAPI.jsm
rename from mail/extensions/openpgp/content/modules/cryptoAPI/rnp-cryptoAPI.js
rename to mail/extensions/openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm
--- a/mail/extensions/openpgp/content/modules/cryptoAPI/rnp-cryptoAPI.js
+++ b/mail/extensions/openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm
@@ -218,17 +218,17 @@ class RNPCryptoAPI extends CryptoAPI {
* @return {Promise<Object>} - Return object with decryptedData and
* status information
*
* Use Promise.catch to handle failed decryption.
* retObj.errorMsg will be an error message in this case.
*/
decryptMime(encrypted, options) {
- console.log("rnp-cryptoAPI.js: decryptMime()");
+ console.log("RNPCryptoAPI.jsm: decryptMime()");
EnigmailLog.DEBUG(`rnp-cryptoAPI.js: decryptMime()\n`);
// write something to gpg such that the process doesn't get stuck
if (encrypted.length === 0) {
encrypted = "NO DATA\n";
}
options.noOutput = false;
@@ -246,17 +246,17 @@ class RNPCryptoAPI extends CryptoAPI {
* @return {Promise<Object>} - Return object with decryptedData and
* status information
*
* Use Promise.catch to handle failed decryption.
* retObj.errorMsg will be an error message in this case.
*/
async verifyMime(signed, options) {
- console.log("rnp-cryptoAPI.js: verifyMime()");
+ console.log("RNPCryptoAPI.jsm: verifyMime()");
EnigmailLog.DEBUG(`rnp-cryptoAPI.js: verifyMime()\n`);
options.noOutput = true;
options.verifyOnly = true;
options.uiFlags = EnigmailConstants.UI_PGP_MIME;
return this.decrypt(signed, options);
}
--- a/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-key.jsm
+++ b/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-key.jsm
@@ -1,16 +1,16 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/.
*/
/****
- Private sub-module to gnupg.js for handling key import/export
+ Private sub-module to GnuPGCryptoAPI.jsm for handling key import/export
****/
"use strict";
var EXPORTED_SYMBOLS = ["GnuPG_importKeyFromFile", "GnuPG_extractSecretKey"];
const EnigmailExecution = ChromeUtils.import("chrome://openpgp/content/modules/execution.jsm").EnigmailExecution;
const EnigmailLog = ChromeUtils.import("chrome://openpgp/content/modules/log.jsm").EnigmailLog;
--- a/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm
+++ b/mail/extensions/openpgp/content/modules/cryptoAPI/gnupg-keylist.jsm
@@ -1,16 +1,16 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/.
*/
/****
- Private sub-module to gnupg.js for handling key lists from GnuPG
+ Private sub-module to GnuPGCryptoAPI.jsm for handling key lists from GnuPG
****/
"use strict";
var EXPORTED_SYMBOLS = ["obtainKeyList", "createKeyObj",
"getPhotoFileFromGnuPG", "extractSignatures", "getGpgKeyData"
];
@@ -351,17 +351,17 @@ async function getPhotoFileFromGnuPG(key
* @return {Array of Object}:
* - uid
* - uidLabel
* - creationDate
* - sigList: [uid, creationDate, signerKeyId, sigType ]
*/
function extractSignatures(gpgKeyList, ignoreUnknownUid) {
- EnigmailLog.DEBUG("gnupg.js: extractSignatures\n");
+ EnigmailLog.DEBUG("GnuPGCryptoAPI.jsm: extractSignatures\n");
var listObj = {};
let havePub = false;
let currUid = "",
keyId = "",
fpr = "";
@@ -420,17 +420,17 @@ function extractSignatures(gpgKeyList, i
}
}
return listObj;
}
async function getGpgKeyData(armorKeyString) {
- EnigmailLog.DEBUG("gnupg.js: getGpgKeyData()\n");
+ EnigmailLog.DEBUG("GnuPGCryptoAPI.jsm: getGpgKeyData()\n");
if (!EnigmailGpg.getGpgFeature("supports-show-only")) {
throw "unsupported";
}
let args = EnigmailGpg.getStandardArgs(false).concat(["--no-tty", "--batch", "--no-verbose", "--with-fingerprint", "--with-colons", "--import-options", "import-show", "--dry-run", "--import"]);
let res = await EnigmailExecution.execAsync(EnigmailGpg.agentPath, args, armorKeyString);
--- a/mail/extensions/openpgp/content/modules/glodaUtils.jsm
+++ b/mail/extensions/openpgp/content/modules/glodaUtils.jsm
@@ -12,17 +12,17 @@
"use strict";
var EXPORTED_SYMBOLS = ["GlodaUtils"];
var GlodaUtils = null;
try {
// TB with omnijar
- GlodaUtils = ChromeUtils.import("resource:///modules/gloda/utils.js").GlodaUtils;
+ GlodaUtils = ChromeUtils.import("resource:///modules/gloda/GlodaUtils.jsm").GlodaUtils;
}
catch (ex) {
// "old style" TB
- GlodaUtils = ChromeUtils.import("resource://app/modules/gloda/utils.js").GlodaUtils;
+ GlodaUtils = ChromeUtils.import("resource://app/modules/gloda/GlodaUtils.jsm").GlodaUtils;
}
// We don't define the exported symbol here - that is on purpose
// The goal of this module is simply to simplify loading of the component
--- a/mail/extensions/openpgp/content/modules/stdlib/compose.jsm
+++ b/mail/extensions/openpgp/content/modules/stdlib/compose.jsm
@@ -21,17 +21,17 @@ const {
results: Cr
} = Components;
const {
MsgHdrToMimeMessage,
MimeMessage, MimeContainer,
MimeBody, MimeUnknown,
MimeMessageAttachment
-} = ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
+} = ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm");
var MailServices;
try {
MailServices = ChromeUtils.import("resource:///modules/MailServices.jsm").MailServices;
}
catch (x){
MailServices = ChromeUtils.import("resource:///modules/mailServices.js").MailServices;
--- a/mail/extensions/openpgp/content/modules/stdlib/msgHdrUtils.jsm
+++ b/mail/extensions/openpgp/content/modules/stdlib/msgHdrUtils.jsm
@@ -37,18 +37,18 @@ const nsMsgFolderFlags_Inbox = 0x0000100
const PR_WRONLY = 0x02;
const XPCOMUtils = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm").XPCOMUtils;
const {
MsgHdrToMimeMessage,
MimeMessage, MimeContainer,
MimeBody, MimeUnknown,
MimeMessageAttachment
-} = ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
-const GlodaUtils = ChromeUtils.import("resource:///modules/gloda/utils.js").GlodaUtils;
+} = ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm");
+const GlodaUtils = ChromeUtils.import("resource:///modules/gloda/GlodaUtils.jsm").GlodaUtils;
const {
fixIterator, toXPCOMArray, toArray
} =ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
const Services = ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
const EnigmailCompat = ChromeUtils.import("chrome://openpgp/content/modules/compat.jsm").EnigmailCompat;
var MailServices;
try {
@@ -341,17 +341,17 @@ function msgHdrIsNntp(msgHdr) {
* @param {nsIMsgDbHdr} msgHdr The message header
* @return {Bool}
*/
function msgHdrIsJunk(aMsgHdr) {
return aMsgHdr.getStringProperty("junkscore") == Ci.nsIJunkMailPlugin.IS_SPAM_SCORE;
}
/**
- * Recycling the HeaderHandlerBase from mimemsg.js
+ * Recycling the HeaderHandlerBase from MimeMessage.jsm
*/
function HeaderHandler(aHeaders) {
this.headers = aHeaders;
}
HeaderHandler.prototype = {
__proto__: MimeMessage.prototype.__proto__, // == HeaderHandlerBase
};
@@ -390,17 +390,17 @@ function createStreamListener(k) {
}
this._data += this._stream.read(aCount);
}
};
}
/**
* @param aMsgHdr The message header whose headers you want
- * @param k A function that takes a HeaderHandler object (see mimemsg.js).
+ * @param k A function that takes a HeaderHandler object (see MimeMessage.jsm).
* Such an object has a get function, a has function. It has a header property,
* whose keys are lowercased header names, and whose values are list of
* strings corresponding to the multiple entries found for that header.
*/
function msgHdrGetHeaders(aMsgHdr, k) {
let uri = msgHdrGetUri(aMsgHdr);
let messageService = MailServices.messenger.messageServiceFromURI(uri);
--- a/mail/extensions/openpgp/jar.mn
+++ b/mail/extensions/openpgp/jar.mn
@@ -1,15 +1,15 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
openpgp.jar:
% content openpgp %content/openpgp/
- content/openpgp/bond.js (content/bond.js)
+ content/openpgp/BondOpenPGP.jsm (content/BondOpenPGP.jsm)
content/openpgp/modules (content/modules/*.js*)
content/openpgp/modules/stdlib (content/modules/stdlib/*.js*)
content/openpgp/modules/cryptoAPI (content/modules/cryptoAPI/*.js*)
content/openpgp/strings/enigmail.properties (content/strings/enigmail.properties)
content/openpgp/strings/enigmail.dtd (content/strings/enigmail.dtd)
content/openpgp/strings/bond.dtd (content/strings/bond.dtd)
content/openpgp/ui (content/ui/*)
% skin openpgp classic/1.0 %skin/tb-mac/ os=Darwin
--- a/mail/locales/en-US/chrome/messenger/gloda.properties
+++ b/mail/locales/en-US/chrome/messenger/gloda.properties
@@ -138,17 +138,17 @@ gloda.message.attr.read.facetNameLabel=R
gloda.message.attr.repliedTo.facetNameLabel=Replied To
# LOCALIZATION NOTE (gloda.message.attr.forwarded.*): Stores whether we believe
# the user has ever forwarded the message. We normally show a little icon in
# the thread pane when this is the case.
gloda.message.attr.forwarded.facetNameLabel=Forwarded
# LOCALIZATION NOTE (gloda.mimetype.category.*.label): Map categories of MIME
-# types defined in mimeTypeCategories.js to labels.
+# types defined in MimeTypeCategories.jsm to labels.
# LOCALIZATION NOTE (gloda.mimetype.category.archives.label): Archive is
# referring to things like zip files, tar files, tar.gz files, etc.
gloda.mimetype.category.archives.label=Archives
gloda.mimetype.category.documents.label=Documents
gloda.mimetype.category.images.label=Images
# LOCALIZATION NOTE (gloda.mimetype.category.media.label): Media is meant to
# encompass both audio and video. This is because video and audio streams are
# frequently stored in the same type of container and we cannot rely on the
--- a/mail/test/browser/composition/browser_imageDisplay.js
+++ b/mail/test/browser/composition/browser_imageDisplay.js
@@ -27,17 +27,17 @@ var {
select_click_row,
} = ChromeUtils.import(
"resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
);
var { close_window } = ChromeUtils.import(
"resource://testing-common/mozmill/WindowHelpers.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var gImageFolder;
add_task(function setupModule(module) {
gImageFolder = create_folder("ImageFolder");
});
/**
--- a/mail/test/browser/folder-display/browser_messageCommandsOnMsgstore.js
+++ b/mail/test/browser/folder-display/browser_messageCommandsOnMsgstore.js
@@ -32,17 +32,17 @@ var {
var { plan_for_window_close, wait_for_window_close } = ChromeUtils.import(
"resource://testing-common/mozmill/WindowHelpers.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var statusHeader = "X-Mozilla-Status: ";
var gInbox;
var gOutbox;
var gAutoRead;
add_task(function setupModule(module) {
--- a/mail/test/browser/message-window/browser_emlSubject.js
+++ b/mail/test/browser/message-window/browser_emlSubject.js
@@ -13,17 +13,17 @@ var os = ChromeUtils.import("resource://
var { open_message_from_file } = ChromeUtils.import(
"resource://testing-common/mozmill/FolderDisplayHelpers.jsm"
);
var { close_window } = ChromeUtils.import(
"resource://testing-common/mozmill/WindowHelpers.jsm"
);
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
var { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
function check_eml_window_title(subject, eml) {
let file = new FileUtils.File(getTestFilePath(`data/${eml}`));
let msgc = open_message_from_file(file);
--- a/mail/test/browser/moz.build
+++ b/mail/test/browser/moz.build
@@ -39,26 +39,26 @@ BROWSER_CHROME_MANIFESTS += [
'utils/browser.ini',
]
DIRS += [
'shared-modules',
]
TEST_HARNESS_FILES.testing.mochitest.fakeserver += [
- '../../../mailnews/test/fakeserver/auth.js',
- '../../../mailnews/test/fakeserver/imapd.js',
- '../../../mailnews/test/fakeserver/maild.js',
- '../../../mailnews/test/fakeserver/nntpd.js',
- '../../../mailnews/test/fakeserver/pop3d.js',
- '../../../mailnews/test/fakeserver/smtpd.js',
+ '../../../mailnews/test/fakeserver/Auth.jsm',
+ '../../../mailnews/test/fakeserver/Imapd.jsm',
+ '../../../mailnews/test/fakeserver/Maild.jsm',
+ '../../../mailnews/test/fakeserver/Nntpd.jsm',
+ '../../../mailnews/test/fakeserver/Pop3d.jsm',
+ '../../../mailnews/test/fakeserver/Smtpd.jsm',
]
TEST_HARNESS_FILES.testing.mochitest.resources += [
'../../../mailnews/test/resources/asyncTestUtils.js',
'../../../mailnews/test/resources/folderEventLogHelper.js',
'../../../mailnews/test/resources/logHelper.js',
- '../../../mailnews/test/resources/messageGenerator.js',
+ '../../../mailnews/test/resources/MessageGenerator.jsm',
'../../../mailnews/test/resources/messageInjection.js',
'../../../mailnews/test/resources/messageModifier.js',
'../../../mailnews/test/resources/smimeUtils.jsm',
'../../base/test/unit/resources/viewWrapperTestUtils.js',
]
--- a/mail/test/browser/session-store/browser_sessionStore.js
+++ b/mail/test/browser/session-store/browser_sessionStore.js
@@ -39,17 +39,17 @@ var {
var {
close_window,
plan_for_new_window,
plan_for_window_close,
wait_for_new_window,
wait_for_window_close,
} = ChromeUtils.import("resource://testing-common/mozmill/WindowHelpers.jsm");
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
var { SessionStoreManager } = ChromeUtils.import(
"resource:///modules/SessionStoreManager.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var folderA, folderB;
--- a/mail/test/browser/shared-modules/FolderDisplayHelpers.jsm
+++ b/mail/test/browser/shared-modules/FolderDisplayHelpers.jsm
@@ -166,17 +166,17 @@ var frame = ChromeUtils.import("resource
var os = ChromeUtils.import("resource://testing-common/mozmill/os.jsm");
var utils = ChromeUtils.import("resource://testing-common/mozmill/utils.jsm");
// the windowHelper module
var windowHelper = ChromeUtils.import(
"resource://testing-common/mozmill/WindowHelpers.jsm"
);
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var nsMsgViewIndex_None = 0xffffffff;
var { MailConsts } = ChromeUtils.import("resource:///modules/MailConsts.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
@@ -321,17 +321,17 @@ function setupModule() {
dump("!!!!!!!!EX: " + ex);
mark_action("fdh", "fail fail marking!", [ex]);
}
});
// -- the rest of the asyncTestUtils framework (but not actually async)
load_via_src_path("resources/asyncTestUtils.js", testHelperModule);
- load_via_src_path("resources/messageGenerator.js", testHelperModule);
+ load_via_src_path("resources/MessageGenerator.jsm", testHelperModule);
load_via_src_path("resources/messageModifier.js", testHelperModule);
load_via_src_path("resources/messageInjection.js", testHelperModule);
load_via_src_path("resources/viewWrapperTestUtils.js", testHelperModule);
load_via_src_path("resources/smimeUtils.jsm", testHelperModule);
// provide super helpful folder event info (when logHelper cares)
load_via_src_path("resources/folderEventLogHelper.js", testHelperModule);
testHelperModule.registerFolderEventLogHelper();
--- a/mail/test/browser/shared-modules/MessageHelpers.jsm
+++ b/mail/test/browser/shared-modules/MessageHelpers.jsm
@@ -9,17 +9,17 @@
"use strict";
this.EXPORTED_SYMBOLS = ["to_mime_message"];
var frame = ChromeUtils.import("resource://testing-common/mozmill/frame.jsm");
var utils = ChromeUtils.import("resource://testing-common/mozmill/utils.jsm");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
/**
* Given a message header, converts it to a MimeMessage. If aCallback throws,
* the test will be marked failed. See the documentation for MsgHdrToMimeMessage
* for more details.
*/
function to_mime_message(
--- a/mail/test/browser/shared-modules/NNTPHelpers.jsm
+++ b/mail/test/browser/shared-modules/NNTPHelpers.jsm
@@ -49,21 +49,21 @@ function setupModule() {
Cu,
// fake some xpcshell stuff
_TEST_FILE: ["mozmill"],
do_throw(aMsg) {
throw new Error(aMsg);
},
};
folderDisplayHelper.load_via_src_path(
- "fakeserver/nntpd.js",
+ "fakeserver/Nntpd.jsm",
testHelperModule
);
folderDisplayHelper.load_via_src_path(
- "fakeserver/maild.js",
+ "fakeserver/Maild.jsm",
testHelperModule
);
}
setupModule();
// Sets up the NNTP daemon object for use in fake server
function setupNNTPDaemon() {
var daemon = new testHelperModule.nntpDaemon();
--- a/mailnews/base/content/folder-menupopup.js
+++ b/mailnews/base/content/folder-menupopup.js
@@ -24,17 +24,17 @@
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
/**
* Creates an element, sets attributes on it, including always setting the
* "generated" attribute to "true", and returns the element. The "generated"
* attribute is used to determine which elements to remove when clearing
* the menu.
*
--- a/mailnews/base/content/folderProps.js
+++ b/mailnews/base/content/folderProps.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* import-globals-from retention.js */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var gMsgFolder;
var gLockedPref = null;
document.addEventListener("dialogaccept", folderPropsOKButton);
// The folderPropsSink is the class that gets notified of an imap folder's properties
--- a/mailnews/base/content/virtualFolderProperties.js
+++ b/mailnews/base/content/virtualFolderProperties.js
@@ -17,17 +17,17 @@ var nsMsgSearchScope = Ci.nsMsgSearchSco
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { VirtualFolderHelper } = ChromeUtils.import(
- "resource:///modules/virtualFolderWrapper.js"
+ "resource:///modules/VirtualFolderWrapper.jsm"
);
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
document.addEventListener("dialogaccept", onOK);
--- a/mailnews/base/prefs/content/AccountManager.js
+++ b/mailnews/base/prefs/content/AccountManager.js
@@ -28,17 +28,17 @@
/* import-globals-from accountUtils.js */
/* import-globals-from am-prefs.js */
/* import-globals-from amUtils.js */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { BrowserUtils } = ChromeUtils.import(
"resource://gre/modules/BrowserUtils.jsm"
);
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { allAccountsSorted } = ChromeUtils.import(
"resource:///modules/folderUtils.jsm"
--- a/mailnews/base/prefs/content/am-identities-list.js
+++ b/mailnews/base/prefs/content/am-identities-list.js
@@ -1,14 +1,14 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var gIdentityListBox; // the root <listbox> node
var gAddButton;
var gEditButton;
--- a/mailnews/base/search/src/PeriodicFilterManager.jsm
+++ b/mailnews/base/search/src/PeriodicFilterManager.jsm
@@ -9,17 +9,17 @@
* called before the mail-startup-done notification.
*/
const EXPORTED_SYMBOLS = ["PeriodicFilterManager"];
const { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const log = Log4Moz.getConfiguredLogger(
"mail.periodicFilterManager",
Log4Moz.Level.Warn,
--- a/mailnews/base/src/MailNotificationService.jsm
+++ b/mailnews/base/src/MailNotificationService.jsm
@@ -9,17 +9,17 @@
* Logging for this module uses the TB version of log4moz. Default logging is at the Warn
* level. Other possibly interesting messages are at Error, Info and Debug. To configure, set the
* preferences "mail.notification.logging.console" (for the error console) or
* "mail.notification.logging.dump" (for stderr) to the string indicating the level you want.
*/
var EXPORTED_SYMBOLS = ["NewMailNotificationService"];
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
--- a/mailnews/base/src/MsgAsyncPrompter.jsm
+++ b/mailnews/base/src/MsgAsyncPrompter.jsm
@@ -3,17 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var EXPORTED_SYMBOLS = ["MsgAsyncPrompter"];
var { Deprecated } = ChromeUtils.import(
"resource://gre/modules/Deprecated.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
function runnablePrompter(asyncPrompter, hashKey) {
this._asyncPrompter = asyncPrompter;
this._hashKey = hashKey;
}
runnablePrompter.prototype = {
_asyncPrompter: null,
rename from mailnews/base/src/virtualFolderWrapper.js
rename to mailnews/base/src/VirtualFolderWrapper.jsm
--- a/mailnews/base/src/moz.build
+++ b/mailnews/base/src/moz.build
@@ -58,17 +58,17 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
SOURCES += ['nsMessengerOSXIntegration.mm']
EXTRA_JS_MODULES += [
'FolderLookupService.jsm',
'MailNewsCommandLineHandler.jsm',
'MailNotificationService.jsm',
'MsgAsyncPrompter.jsm',
'OAuth2Module.jsm',
- 'virtualFolderWrapper.js',
+ 'VirtualFolderWrapper.jsm',
]
LOCAL_INCLUDES += [
'/%s/dom/base' % CONFIG['mozreltopsrcdir'],
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'mail'
--- a/mailnews/base/test/unit/head_mailbase.js
+++ b/mailnews/base/test/unit/head_mailbase.js
@@ -1,20 +1,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../";
--- a/mailnews/base/test/unit/test_accountMigration.js
+++ b/mailnews/base/test/unit/test_accountMigration.js
@@ -3,17 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This tests that we don't try to reset the mail.server.server<n>.authMethod
* preference every time we run the migration code, and other migration stuff
*/
var { migrateMailnews } = ChromeUtils.import(
- "resource:///modules/mailnewsMigrator.js"
+ "resource:///modules/MailnewsMigrator.jsm"
);
/* import-globals-from ../../../test/resources/abSetup.js */
load("../../../resources/abSetup.js");
function testPermission(aURI) {
let principal = Services.scriptSecurityManager.createContentPrincipal(
aURI,
--- a/mailnews/base/test/unit/test_bug434810.js
+++ b/mailnews/base/test/unit/test_bug434810.js
@@ -10,17 +10,17 @@ function run_test() {
localAccountUtils.loadLocalMailAccount();
var rootFolder = localAccountUtils.incomingServer.rootFolder;
var msgProps = Services.strings.createBundle(
"chrome://messenger/locale/messenger.properties"
);
- var expectedFolders = ["Inbox"]; // Inbox hard-coded in localAccountUtils.js
+ var expectedFolders = ["Inbox"]; // Inbox hard-coded in LocalAccountUtils.jsm
// These two MailNews adds by default
expectedFolders.push(msgProps.GetStringFromName("outboxFolderName"));
expectedFolders.push(msgProps.GetStringFromName("trashFolderName"));
Assert.equal(rootFolder.numSubFolders, expectedFolders.length);
for (var i = 0; i < expectedFolders.length; ++i) {
Assert.ok(rootFolder.containsChildNamed(expectedFolders[i]));
--- a/mailnews/base/test/unit/test_compactFailure.js
+++ b/mailnews/base/test/unit/test_compactFailure.js
@@ -1,21 +1,21 @@
const { toXPCOMArray } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { MockFactory } = ChromeUtils.import(
- "resource://testing-common/mailnews/MockFactory.js"
+ "resource://testing-common/mailnews/MockFactory.jsm"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
var gTargetFolder;
var gUuid;
--- a/mailnews/base/test/unit/test_copyChaining.js
+++ b/mailnews/base/test/unit/test_copyChaining.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// Test of chaining copies between the same folders
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var gCopySource;
var gCopyDest;
var gMsgEnumerator;
--- a/mailnews/base/test/unit/test_copyToInvalidDB.js
+++ b/mailnews/base/test/unit/test_copyToInvalidDB.js
@@ -3,20 +3,20 @@
* or invalid
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var gMsg1;
--- a/mailnews/base/test/unit/test_detachToFile.js
+++ b/mailnews/base/test/unit/test_detachToFile.js
@@ -11,17 +11,17 @@
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
// javascript mime emitter functions
var mimeMsg = {};
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
+ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm", mimeMsg);
var tests = [startCopy, startMime, startDetach, testDetach];
function* startCopy() {
// Get a message into the local filestore.
var mailFile = do_get_file("../../../data/external-attach-test");
MailServices.copy.CopyFileMessage(
mailFile,
--- a/mailnews/base/test/unit/test_imapPump.js
+++ b/mailnews/base/test/unit/test_imapPump.js
@@ -12,25 +12,25 @@
load("../../../resources/logHelper.js");
load("../../../resources/alertTestUtils.js");
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
// IMAP pump
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
- "resource://testing-common/mailnews/IMAPpump.js"
+ "resource://testing-common/mailnews/IMAPpump.jsm"
);
var { imapMessage } = ChromeUtils.import(
- "resource://testing-common/mailnews/imapd.js"
+ "resource://testing-common/mailnews/Imapd.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { fsDebugAll } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
// Globals
// Messages to load must have CRLF line endings, that is Windows style
var gMessage = "bugmail10"; // message file used as the test message
// Definition of tests
--- a/mailnews/base/test/unit/test_jsTreeSelection.js
+++ b/mailnews/base/test/unit/test_jsTreeSelection.js
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 { JSTreeSelection } = ChromeUtils.import(
- "resource:///modules/jsTreeSelection.js"
+ "resource:///modules/JsTreeSelection.jsm"
);
var fakeView = {
rowCount: 101,
selectionChanged() {},
QueryInterface: ChromeUtils.generateQI([Ci.nsITreeView]),
};
--- a/mailnews/base/test/unit/test_junkingWhenDisabled.js
+++ b/mailnews/base/test/unit/test_junkingWhenDisabled.js
@@ -4,25 +4,25 @@
* James using test_nsMsgDBView.js as a base.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
const { JSTreeSelection } = ChromeUtils.import(
- "resource:///modules/jsTreeSelection.js"
+ "resource:///modules/JsTreeSelection.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var nsIMFNService = Ci.nsIMsgFolderNotificationService;
--- a/mailnews/base/test/unit/test_mimemaltdetach.js
+++ b/mailnews/base/test/unit/test_mimemaltdetach.js
@@ -9,17 +9,17 @@
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
// javascript mime emitter functions
var mimeMsg = {};
-ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
+ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm", mimeMsg);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var tests = [startCopy, startMime, startDetach, testDetach];
function* startCopy() {
// Get a message into the local filestore.
--- a/mailnews/base/test/unit/test_nsIFolderListener.js
+++ b/mailnews/base/test/unit/test_nsIFolderListener.js
@@ -1,21 +1,21 @@
/*
* Test that adding nsIFolderListener in js does not cause any crash.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/messageModifier.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/messageModifier.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageInjection.js");
var folderListener = {
OnItemAdded() {},
OnItemRemoved() {},
OnItemPropertyChanged() {},
OnItemIntPropertyChanged() {},
OnItemBoolPropertyChanged() {},
--- a/mailnews/base/test/unit/test_nsMsgDBView.js
+++ b/mailnews/base/test/unit/test_nsMsgDBView.js
@@ -11,25 +11,25 @@
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/abSetup.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/abSetup.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
const { JSTreeSelection } = ChromeUtils.import(
- "resource:///modules/jsTreeSelection.js"
+ "resource:///modules/JsTreeSelection.jsm"
);
// Items used to add messages to the folder
var gMessageGenerator = new MessageGenerator();
var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
var gTestFolder;
var gSiblingsMissingParentsSubject;
--- a/mailnews/base/test/unit/test_nsMsgDBView_headerValues.js
+++ b/mailnews/base/test/unit/test_nsMsgDBView_headerValues.js
@@ -2,20 +2,20 @@
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/abSetup.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/abSetup.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var SortType = Ci.nsMsgViewSortType;
var SortOrder = Ci.nsMsgViewSortOrder;
// This is an array of the actual test data. Each test datum is an array of two
// elements: the first element is the argument into a simple message generator,
--- a/mailnews/base/test/unit/test_retention.js
+++ b/mailnews/base/test/unit/test_retention.js
@@ -2,23 +2,23 @@
* Simple tests for retention settings. In particular, we'd like to make
* sure that applying retention settings works with the new code that avoids
* opening db's to apply retention settings if the folder doesn't override
* the server defaults.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessageGenerator = new MessageGenerator();
var gScenarioFactory = new MessageScenarioFactory(gMessageGenerator);
var gTestFolder;
--- a/mailnews/base/test/unit/test_searchChaining.js
+++ b/mailnews/base/test/unit/test_searchChaining.js
@@ -3,24 +3,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Test of chaining of search scopes in a search session. In particular,
// Bug 541969 made us not search an imap folder if the search scope before it
// there was an empty local folder.
// main test
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
- "resource://testing-common/mailnews/IMAPpump.js"
+ "resource://testing-common/mailnews/IMAPpump.jsm"
);
var { imapMessage } = ChromeUtils.import(
- "resource://testing-common/mailnews/imapd.js"
+ "resource://testing-common/mailnews/Imapd.jsm"
);
const { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
async function setupFolder() {
// add a single message to the imap inbox.
let messages = [];
--- a/mailnews/base/test/unit/test_testsuite_base64.js
+++ b/mailnews/base/test/unit/test_testsuite_base64.js
@@ -1,10 +1,10 @@
/**
- * Tests functions atob() and btoa() in mailnews/test/resources/mailTestUtils.js .
+ * Tests functions atob() and btoa() in mailnews/test/resources/MailTestUtils.jsm .
*
* Note:
* btoa() = base64 encode
* atob() = base64 decode
* (i.e. "binary" = plain, and "ascii" = encoded)
*/
function run_test() {
--- a/mailnews/base/test/unit/test_testsuite_fakeserverAuth.js
+++ b/mailnews/base/test/unit/test_testsuite_fakeserverAuth.js
@@ -1,19 +1,19 @@
/**
- * Tests functions in mailnews/test/fakeserver/auth.js
+ * Tests functions in mailnews/test/fakeserver/Auth.jsm
* which are responsible for the authentication in the
* fakeserver.
*
* Do NOT essentially re-code the auth schemes here,
* just check roundtrips, against static values etc..
*/
var { AuthPLAIN, AuthCRAM } = ChromeUtils.import(
- "resource://testing-common/mailnews/auth.js"
+ "resource://testing-common/mailnews/Auth.jsm"
);
var kUsername = "fred1";
var kPassword = "wilma2";
function run_test() {
authPLAIN();
authCRAMMD5();
--- a/mailnews/base/test/unit/test_testsuite_fakeserver_imapd_gmail.js
+++ b/mailnews/base/test/unit/test_testsuite_fakeserver_imapd_gmail.js
@@ -1,27 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-// Test that imapd.js fakeserver correctly emulates GMail server
+// Test that Imapd.jsm fakeserver correctly emulates GMail server
// That means X-GM-EXT-1 capability and GMail flavor XLIST
// per https://developers.google.com/google-apps/gmail/imap_extensions
// async support
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
// IMAP pump
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
- "resource://testing-common/mailnews/IMAPpump.js"
+ "resource://testing-common/mailnews/IMAPpump.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
setupIMAPPump("GMail");
// create our own handler so that we can call imapd functions directly
var handler;
--- a/mailnews/base/test/unit/test_testsuite_fakeserver_imapd_list-extended.js
+++ b/mailnews/base/test/unit/test_testsuite_fakeserver_imapd_list-extended.js
@@ -1,26 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-// Test that imapd.js fakeserver correctly implements LIST-EXTENDED imap
+// Test that Imapd.jsm fakeserver correctly implements LIST-EXTENDED imap
// extension (RFC 5258 - http://tools.ietf.org/html/rfc5258)
// async support
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
// IMAP pump
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
- "resource://testing-common/mailnews/IMAPpump.js"
+ "resource://testing-common/mailnews/IMAPpump.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
// Globals
// Dovecot is one of the servers that supports LIST-EXTENDED
setupIMAPPump("Dovecot");
--- a/mailnews/base/test/unit/test_viewSortByAddresses.js
+++ b/mailnews/base/test/unit/test_viewSortByAddresses.js
@@ -3,21 +3,21 @@
* when using a display name from the address book.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
/* import-globals-from ../../../test/resources/abSetup.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
load("../../../resources/abSetup.js");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
rename from mailnews/base/util/errUtils.js
rename to mailnews/base/util/ErrUtils.jsm
rename from mailnews/base/util/IOUtils.js
rename to mailnews/base/util/IOUtils.jsm
rename from mailnews/base/util/JXON.js
rename to mailnews/base/util/JXON.jsm
--- a/mailnews/base/util/JXON.js
+++ b/mailnews/base/util/JXON.jsm
@@ -135,71 +135,16 @@ var JXON = new (function() {
Object.freeze(vResult);
}
aCache.length = nLevelStart;
return vResult;
}
- function loadObjTree(oXMLDoc, oParentEl, oParentObj) {
- var vValue, oChild;
-
- if (
- oParentObj instanceof String ||
- oParentObj instanceof Number ||
- oParentObj instanceof Boolean
- ) {
- // Verbosity level is 0.
- oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString()));
- } else if (oParentObj.constructor === Date) {
- oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString()));
- }
-
- for (var sName in oParentObj) {
- vValue = oParentObj[sName];
- if (isFinite(sName) || vValue instanceof Function) {
- // Verbosity level is 0.
- continue;
- }
- if (sName === sValueProp) {
- if (vValue !== null && vValue !== true) {
- oParentEl.appendChild(
- oXMLDoc.createTextNode(
- vValue.constructor === Date
- ? vValue.toGMTString()
- : String(vValue)
- )
- );
- }
- } else if (sName === sAttributesProp) {
- // Verbosity level is 3.
- for (var sAttrib in vValue) {
- oParentEl.setAttribute(sAttrib, vValue[sAttrib]);
- }
- } else if (sName.charAt(0) === sAttrPref) {
- oParentEl.setAttribute(sName.slice(1), vValue);
- } else if (vValue.constructor === Array) {
- for (var nItem = 0; nItem < vValue.length; nItem++) {
- oChild = oXMLDoc.createXULElement(sName);
- loadObjTree(oXMLDoc, oChild, vValue[nItem]);
- oParentEl.appendChild(oChild);
- }
- } else {
- oChild = oXMLDoc.createXULElement(sName);
- if (vValue instanceof Object) {
- loadObjTree(oXMLDoc, oChild, vValue);
- } else if (vValue !== null && vValue !== true) {
- oChild.appendChild(oXMLDoc.createTextNode(vValue.toString()));
- }
- oParentEl.appendChild(oChild);
- }
- }
- }
-
this.build = function(
oXMLParent,
nVerbosity /* optional */,
bFreeze /* optional */,
bNesteAttributes /* optional */
) {
const _nVerb =
typeof nVerbosity === "number"
@@ -207,15 +152,9 @@ var JXON = new (function() {
: /* put here the default verbosity level: */ 1;
return createObjTree(
oXMLParent,
_nVerb,
bFreeze || false,
bNesteAttributes !== undefined ? bNesteAttributes : _nVerb === 3
);
};
-
- this.unbuild = function(oObjTree) {
- const oNewDoc = document.implementation.createDocument("", "", null);
- loadObjTree(oNewDoc, oNewDoc, oObjTree);
- return oNewDoc;
- };
})();
rename from mailnews/base/util/jsTreeSelection.js
rename to mailnews/base/util/JsTreeSelection.jsm
--- a/mailnews/base/util/jsTreeSelection.js
+++ b/mailnews/base/util/JsTreeSelection.jsm
@@ -1,18 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["JSTreeSelection"];
-var { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
-);
-
/**
* Partial nsITreeSelection implementation so that we can have nsMsgDBViews that
* exist only for message display but do not need to be backed by a full
* tree view widget. This could also hopefully be used for more xpcshell unit
* testing of the FolderDisplayWidget. It might also be useful for creating
* transient selections when right-click selection happens.
*
* Our current limitations:
rename from mailnews/base/util/mailnewsMigrator.js
rename to mailnews/base/util/MailnewsMigrator.jsm
--- a/mailnews/base/util/mailnewsMigrator.js
+++ b/mailnews/base/util/MailnewsMigrator.jsm
@@ -7,17 +7,17 @@
* current.
* This should be run at startup. It migrates as needed: each migration
* function should be written to be a no-op when the value is already migrated
* or was never used in the old version.
*/
this.EXPORTED_SYMBOLS = ["migrateMailnews"];
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var kServerPrefVersion = 1;
var kSmtpPrefVersion = 1;
var kABRemoteContentPrefVersion = 1;
var kDefaultCharsetsPrefVersion = 1;
rename from mailnews/base/util/msgDBCacheManager.js
rename to mailnews/base/util/MsgDBCacheManager.jsm
--- a/mailnews/base/util/msgDBCacheManager.js
+++ b/mailnews/base/util/MsgDBCacheManager.jsm
@@ -9,17 +9,17 @@
/* :::::::: Constants and Helpers ::::::::::::::: */
this.EXPORTED_SYMBOLS = ["msgDBCacheManager"];
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var log = Log4Moz.getConfiguredLogger("mailnews.database.dbcache");
/**
*/
var DBCACHE_INTERVAL_DEFAULT_MS = 60000; // 1 minute
/* :::::::: The Module ::::::::::::::: */
--- a/mailnews/base/util/OAuth2.jsm
+++ b/mailnews/base/util/OAuth2.jsm
@@ -4,17 +4,17 @@
/**
* Provides OAuth 2.0 authentication.
* @see RFC 6749
*/
var EXPORTED_SYMBOLS = ["OAuth2"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
Cu.importGlobalProperties(["fetch"]);
// Only allow one connecting window per endpoint.
var gConnecting = {};
/**
* Constructor for the OAuth2 object.
rename from mailnews/base/util/StringBundle.js
rename to mailnews/base/util/StringBundle.jsm
rename from mailnews/base/util/templateUtils.js
rename to mailnews/base/util/TemplateUtils.jsm
--- a/mailnews/base/util/templateUtils.js
+++ b/mailnews/base/util/TemplateUtils.jsm
@@ -4,17 +4,17 @@
var EXPORTED_SYMBOLS = ["PluralStringFormatter", "makeFriendlyDateAgo"];
var { PluralForm } = ChromeUtils.import(
"resource://gre/modules/PluralForm.jsm"
);
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
function PluralStringFormatter(aBundleURI) {
this._bundle = new StringBundle(aBundleURI);
}
PluralStringFormatter.prototype = {
get(aStringName, aReplacements, aPluralCount) {
rename from mailnews/base/util/traceHelper.js
rename to mailnews/base/util/TraceHelper.jsm
--- a/mailnews/base/util/traceHelper.js
+++ b/mailnews/base/util/TraceHelper.jsm
@@ -1,18 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["DebugTraceHelper"];
-var { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
-);
-
var SPACES = " ";
var BRIGHT_COLORS = {
red: "\x1b[1;31m",
green: "\x1b[1;32m",
yellow: "\x1b[1;33m",
blue: "\x1b[1;34m",
magenta: "\x1b[1;35m",
cyan: "\x1b[1;36m",
@@ -27,17 +23,17 @@ var DARK_COLORS = {
cyan: "\x1b[0;36m",
white: "\x1b[0;37m",
};
var STOP_COLORS = "\x1b[0m";
/**
* Example usages:
*
- * ChromeUtils.import("resource:///modules/traceHelper.js");
+ * ChromeUtils.import("resource:///modules/TraceHelper.jsm");
* var debugContext = {color: "cyan"};
* DebugTraceHelper.tracify(FolderDisplayWidget.prototype,
* "FolderDisplayWidget", /.+/, debugContext);
* DebugTraceHelper.tracify(MessageDisplayWidget.prototype,
* "MessageDisplayWidget", /.+/, debugContext);
* DebugTraceHelper.tracify(StandaloneFolderDisplayWidget.prototype,
* "StandaloneFolderDisplayWidget", /.+/, debugContext);
* DebugTraceHelper.tracify(StandaloneMessageDisplayWidget.prototype,
--- a/mailnews/base/util/moz.build
+++ b/mailnews/base/util/moz.build
@@ -47,32 +47,32 @@ SOURCES += [
'nsNewMailnewsURI.cpp',
'nsStopwatch.cpp',
'Services.cpp',
]
EXTRA_JS_MODULES += [
'ABQueryUtils.jsm',
'converterWorker.js',
- 'errUtils.js',
+ 'ErrUtils.jsm',
'folderUtils.jsm',
'hostnameUtils.jsm',
- 'IOUtils.js',
+ 'IOUtils.jsm',
'iteratorUtils.jsm',
- 'jsTreeSelection.js',
- 'JXON.js',
- 'mailnewsMigrator.js',
+ 'JsTreeSelection.jsm',
+ 'JXON.jsm',
+ 'MailnewsMigrator.jsm',
'MailServices.jsm',
'mailstoreConverter.jsm',
- 'msgDBCacheManager.js',
+ 'MsgDBCacheManager.jsm',
'OAuth2.jsm',
'OAuth2Providers.jsm',
- 'StringBundle.js',
- 'templateUtils.js',
- 'traceHelper.js',
+ 'StringBundle.jsm',
+ 'TemplateUtils.jsm',
+ 'TraceHelper.jsm',
]
LOCAL_INCLUDES += [
'/%s/netwerk/base' % CONFIG['mozreltopsrcdir']
]
FINAL_LIBRARY = 'mail'
--- a/mailnews/compose/test/unit/head_compose.js
+++ b/mailnews/compose/test/unit/head_compose.js
@@ -1,21 +1,21 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var CC = Components.Constructor;
// WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
var { getAppInfo, newAppInfo, updateAppInfo } = ChromeUtils.import(
"resource://testing-common/AppInfo.jsm"
);
@@ -34,22 +34,22 @@ load("../../../resources/abSetup.js");
// Import the smtp server scripts
var {
nsMailServer,
gThreadManager,
fsDebugNone,
fsDebugAll,
fsDebugRecv,
fsDebugRecvSend,
-} = ChromeUtils.import("resource://testing-common/mailnews/maild.js");
+} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
- "resource://testing-common/mailnews/smtpd.js"
+ "resource://testing-common/mailnews/Smtpd.jsm"
);
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
- "resource://testing-common/mailnews/auth.js"
+ "resource://testing-common/mailnews/Auth.jsm"
);
var gDraftFolder;
// Setup the daemon and server
function setupServerDaemon(handler) {
if (!handler) {
handler = function(d) {
--- a/mailnews/db/gloda/components/GlodaAutoComplete.jsm
+++ b/mailnews/db/gloda/components/GlodaAutoComplete.jsm
@@ -7,17 +7,17 @@
* use when one enters text in global search box. There are
* following types of autocomplete item: gloda-contact-chunk-richlistitem,
* gloda-fulltext-all-richlistitem, gloda-fulltext-single-richlistitem, gloda-multi-richlistitem,
* gloda-single-identity-richlistitem, gloda-single-tag-richlistitem.
*/
var EXPORTED_SYMBOLS = ["GlodaAutoComplete"];
-var { logException } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logException } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
var Gloda = null;
var GlodaUtils = null; // eslint-disable-line no-unused-vars
var MultiSuffixTree = null;
var TagNoun = null;
var FreeTagNoun = null;
function ResultRowFullText(aItem, words, typeForStyle) {
@@ -455,17 +455,17 @@ MessageTagCompleter.prototype = {
* Complete with helpful hints about full-text search
*/
function FullTextCompleter() {}
FullTextCompleter.prototype = {
complete(aResult, aSearchString) {
if (aSearchString.length < 4) {
return false;
}
- // We use code very similar to that in msg_search.js, except that we
+ // We use code very similar to that in GlodaMsgSearcher.jsm, except that we
// need to detect when we found phrases, as well as strip commas.
aSearchString = aSearchString.trim();
let terms = [];
let phraseFound = false;
while (aSearchString) {
let term = "";
if (aSearchString.startsWith('"')) {
let endIndex = aSearchString.indexOf(aSearchString[0], 1);
@@ -508,29 +508,31 @@ FullTextCompleter.prototype = {
var LOG; // eslint-disable-line no-unused-vars
function GlodaAutoComplete() {
this.wrappedJSObject = this;
try {
// set up our awesome globals!
if (Gloda === null) {
- let loadNS = ChromeUtils.import("resource:///modules/gloda/public.js");
+ let loadNS = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+ );
Gloda = loadNS.Gloda;
- loadNS = ChromeUtils.import("resource:///modules/gloda/utils.js");
+ loadNS = ChromeUtils.import("resource:///modules/gloda/GlodaUtils.jsm");
GlodaUtils = loadNS.GlodaUtils;
- loadNS = ChromeUtils.import("resource:///modules/gloda/suffixtree.js");
+ loadNS = ChromeUtils.import("resource:///modules/gloda/SuffixTree.jsm");
MultiSuffixTree = loadNS.MultiSuffixTree;
- loadNS = ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
+ loadNS = ChromeUtils.import("resource:///modules/gloda/NounTag.jsm");
TagNoun = loadNS.TagNoun;
- loadNS = ChromeUtils.import("resource:///modules/gloda/noun_freetag.js");
+ loadNS = ChromeUtils.import("resource:///modules/gloda/NounFreetag.jsm");
FreeTagNoun = loadNS.FreeTagNoun;
- loadNS = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+ loadNS = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
LOG = loadNS.Log4Moz.repository.getLogger("gloda.autocomp");
}
this.completers = [];
this.curResult = null;
this.completers.push(new FullTextCompleter()); // not async.
this.completers.push(new ContactIdentityCompleter()); // potentially async.
--- a/mailnews/db/gloda/components/MimeMessageEmitter.jsm
+++ b/mailnews/db/gloda/components/MimeMessageEmitter.jsm
@@ -40,18 +40,20 @@ var MAX_SANE_BODY_PART_SIZE = 20 * 1024;
* simplifies our life for building the part hierarchy.
* During the second pass, the libmime object model is traversed, generating
* attachment notifications for all leaf nodes. From our perspective, this
* means file attachments and embedded messages (message/rfc822). We use this
* pass to create the attachment objects proper, which we then substitute into
* the part tree we have already built.
*/
function MimeMessageEmitter() {
- this._mimeMsg = ChromeUtils.import("resource:///modules/gloda/mimemsg.js");
- this._utils = ChromeUtils.import("resource:///modules/gloda/utils.js");
+ this._mimeMsg = ChromeUtils.import(
+ "resource:///modules/gloda/MimeMessage.jsm"
+ );
+ this._utils = ChromeUtils.import("resource:///modules/gloda/GlodaUtils.jsm");
this._url = null;
this._partRE = this._utils.GlodaUtils.PART_RE;
this._outputListener = null;
this._curPart = null;
this._curAttachment = null;
--- a/mailnews/db/gloda/content/autocomplete-richlistitem.js
+++ b/mailnews/db/gloda/content/autocomplete-richlistitem.js
@@ -7,17 +7,17 @@
/* global MozXULElement, MozElements */
// Wrap in a block to prevent leaking to window scope.
{
const { Services } = ChromeUtils.import(
"resource://gre/modules/Services.jsm"
);
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
const gGlodaCompleteStrings = new StringBundle(
"chrome://messenger/locale/glodaComplete.properties"
);
/**
* The MozGlodacompleteBaseRichlistitem widget is the
* abstract base class for all the gloda autocomplete items.
--- a/mailnews/db/gloda/content/overlay.js
+++ b/mailnews/db/gloda/content/overlay.js
@@ -1,6 +1,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// get the core
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
rename from mailnews/db/gloda/modules/collection.js
rename to mailnews/db/gloda/modules/Collection.jsm
--- a/mailnews/db/gloda/modules/collection.js
+++ b/mailnews/db/gloda/modules/Collection.jsm
@@ -1,15 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaCollection", "GlodaCollectionManager"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var LOG = Log4Moz.repository.getLogger("gloda.collection");
/**
* @namespace Central registry and logic for all collections.
*
* The collection manager is a singleton that has the following tasks:
* - Let views of objects (nouns) know when their objects have changed. For
rename from mailnews/db/gloda/modules/everybody.js
rename to mailnews/db/gloda/modules/Everybody.jsm
--- a/mailnews/db/gloda/modules/everybody.js
+++ b/mailnews/db/gloda/modules/Everybody.jsm
@@ -1,26 +1,23 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = [];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-var LOG = Log4Moz.repository.getLogger("gloda.everybody");
-
const { GlodaFundAttr } = ChromeUtils.import(
- "resource:///modules/gloda/fundattr.js"
+ "resource:///modules/gloda/GlodaFundAttr.jsm"
);
GlodaFundAttr.init();
const { GlodaExplicitAttr } = ChromeUtils.import(
- "resource:///modules/gloda/explattr.js"
+ "resource:///modules/gloda/GlodaExplicitAttr.jsm"
);
GlodaExplicitAttr.init();
-ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
-ChromeUtils.import("resource:///modules/gloda/noun_freetag.js");
-ChromeUtils.import("resource:///modules/gloda/noun_mimetype.js");
-ChromeUtils.import("resource:///modules/gloda/index_msg.js");
+ChromeUtils.import("resource:///modules/gloda/NounTag.jsm");
+ChromeUtils.import("resource:///modules/gloda/NounFreetag.jsm");
+ChromeUtils.import("resource:///modules/gloda/NounMimetype.jsm");
+ChromeUtils.import("resource:///modules/gloda/IndexMsg.jsm");
const { GlodaABAttrs } = ChromeUtils.import(
- "resource:///modules/gloda/index_ab.js"
+ "resource:///modules/gloda/GlodaMsgIndexer.jsm"
);
GlodaABAttrs.init();
rename from mailnews/db/gloda/modules/facet.js
rename to mailnews/db/gloda/modules/Facet.jsm
--- a/mailnews/db/gloda/modules/facet.js
+++ b/mailnews/db/gloda/modules/Facet.jsm
@@ -3,17 +3,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This file provides faceting logic.
*/
var EXPORTED_SYMBOLS = ["FacetDriver", "FacetUtils"];
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+const { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+);
/**
* Decides the appropriate faceters for the noun type and drives the faceting
* process. This class and the faceters are intended to be reusable so that
* you only need one instance per faceting session. (Although each faceting
* pass is accordingly destructive to previous results.)
*
* Our strategy for faceting is to process one attribute at a time across all
rename from mailnews/db/gloda/modules/gloda.js
rename to mailnews/db/gloda/modules/Gloda.jsm
--- a/mailnews/db/gloda/modules/gloda.js
+++ b/mailnews/db/gloda/modules/Gloda.jsm
@@ -1,48 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["Gloda"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
const {
GlodaAttributeDBDef,
GlodaAccount,
GlodaConversation,
GlodaFolder,
GlodaMessage,
GlodaContact,
GlodaIdentity,
GlodaAttachment,
-} = ChromeUtils.import("resource:///modules/gloda/datamodel.js");
-const { GlodaDatabind } = ChromeUtils.import(
- "resource:///modules/gloda/databind.js"
-);
+} = ChromeUtils.import("resource:///modules/gloda/GlodaDataModel.jsm");
const { GlodaCollection, GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
const { whittlerRegistry, mimeMsgToContentAndMeta } = ChromeUtils.import(
- "resource:///modules/gloda/connotent.js"
+ "resource:///modules/gloda/GlodaContent.jsm"
);
const { GlodaQueryClassFactory } = ChromeUtils.import(
- "resource:///modules/gloda/query.js"
+ "resource:///modules/gloda/GlodaQueryClassFactory.jsm"
);
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
+const { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
+);
const { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/**
* @see |Gloda.BadItemContentsError|
*/
function BadItemContentsError(aMessage) {
@@ -54,20 +53,20 @@ BadItemContentsError.prototype = {
},
};
/**
* Provides the user-visible (and extension visible) global database
* functionality. There is currently a dependency/ordering
* problem in that the concept of 'gloda' also includes some logic that is
* contributed by built-in extensions, if you will. Those built-in extensions
- * (fundattr.js, explattr.js) also import this file. To avoid a circular
- * dependency, those built-in extensions are loaded by everybody.js. The
- * simplest/best solution is probably to move everybody.js to be gloda.js and
- * have it re-export only 'Gloda'. gloda.js (this file) can then move to be
+ * (fundattr.js, GlodaExplicitAttr.jsm) also import this file. To avoid a circular
+ * dependency, those built-in extensions are loaded by Everybody.jsm. The
+ * simplest/best solution is probably to move Everybody.jsm to be Gloda.jsm and
+ * have it re-export only 'Gloda'. Gloda.jsm (this file) can then move to be
* gloda_int.js (or whatever our eventual naming scheme is), which built-in
* extensions can explicitly rely upon.
*
* === Concepts
*
* == Nouns
*
* Inspired by reasonable uses of triple-stores, I have tried to leverage
@@ -95,17 +94,17 @@ BadItemContentsError.prototype = {
* Things aren't entirely as clear as they could be right now, terminology/
* concept/implementation-wise. Some work is probably still in order.
*
* === Implementation
*
* == Nouns
*
* So, we go and define the nouns that are roughly the classes in our data
- * model. Every 'class' we define in datamodel.js is a noun that gets defined
+ * model. Every 'class' we define in GlodaDataModel.jsm is a noun that gets defined
* here in the Gloda core. We provide sufficient meta-data about the noun to
* serialize/deserialize its representation from our database representation.
* Nouns do not have to be defined in this class, but can also be contributed
* by external code.
* We have a concept of 'first class' nouns versus non-first class nouns. The
* distinction is meant to be whether we can store meta-information about those
* nouns using attributes. Right now, only message are real first-class nouns,
* but we want to expand that to include contacts and eventually events and
@@ -119,18 +118,18 @@ BadItemContentsError.prototype = {
* Attributes are defined by "attribute providers" who are responsible for
* taking an instance of a first-class noun (for which they are registered)
* plus perhaps some other meta-data, and returning a list of attributes
* extracted from that noun. For now, this means messages. Attribute
* providers may create new data records as a side-effect of the indexing
* process, although we have not yet fully dealt with the problem of deleting
* these records should they become orphaned in the database due to the
* purging of a message and its attributes.
- * All of the 'core' gloda attributes are provided by the fundattr.js and
- * explattr.js providers.
+ * All of the 'core' gloda attributes are provided by the GlodaFundAttr.jsm and
+ * GlodaExplicitAttr.jsm providers.
*
* === (Notable) Future Work
*
* == Attributes
*
* Attribute mechanisms currently lack any support for 'overriding' attributes
* provided by other attribute providers. For example, the fundattr provider
* tells us who a message is 'from' based on the e-mail address present.
@@ -145,17 +144,17 @@ BadItemContentsError.prototype = {
*/
var Gloda = {
/**
* Initialize logging, the datastore (SQLite database), the core nouns and
* attributes, and the contact and identities that belong to the presumed
* current user (based on accounts).
*
* Additional nouns and the core attribute providers are initialized by the
- * everybody.js module which ensures all of those dependencies are loaded
+ * Everybody.jsm module which ensures all of those dependencies are loaded
* (and initialized).
*/
_init() {
this._initLogging();
GlodaDatastore._init(this._nounIDToDef);
this._initAttributes();
this._initMyIdentities();
},
@@ -726,17 +725,17 @@ var Gloda = {
* This attribute is stored as a fulltext column on the fulltext table for
* the noun. The attribute definition should include this value as 'special'
* and the column name that stores the table as 'specialColumnName'.
*/
kSpecialFulltext: GlodaDatastore.kSpecialFulltext,
/**
* The extensionName used for the attributes defined by core gloda plugins
- * such as fundattr.js and explattr.js.
+ * such as GlodaFundAttr.jsm and GlodaExplicitAttr.jsm.
*/
BUILT_IN: "built-in",
/**
* Special sentinel value that will cause facets to skip a noun instance
* when an attribute has this value.
*/
IGNORE_FACET: GlodaDatastore.IGNORE_FACET,
@@ -806,37 +805,37 @@ var Gloda = {
* to a good abstraction. Probably something thin around a SteelFolder or
* the like; we would contribute the functionality to easily move from a
* folder to the list of gloda messages in that folder, as well as the
* indexing preferences for that folder.
* @TODO folder noun and related abstraction
*/
NOUN_FOLDER: GlodaFolder.prototype.NOUN_ID, // 100
/**
- * All messages belong to a conversation. See datamodel.js for the
+ * All messages belong to a conversation. See GlodaDataModel.jsm for the
* definition of the GlodaConversation class.
*/
NOUN_CONVERSATION: GlodaConversation.prototype.NOUN_ID, // 101
/**
* A one-to-one correspondence with underlying (indexed) nsIMsgDBHdr
- * instances. See datamodel.js for the definition of the GlodaMessage class.
+ * instances. See GlodaDataModel.jsm for the definition of the GlodaMessage class.
*/
NOUN_MESSAGE: GlodaMessage.prototype.NOUN_ID, // 102
/**
* Corresponds to a human being, who may have multiple electronic identities
* (a la NOUN_IDENTITY). There is no requirement for association with an
* address book contact, although when the address book contact exists,
- * we want to be associated with it. See datamodel.js for the definition
+ * we want to be associated with it. See GlodaDataModel.jsm for the definition
* of the GlodaContact class.
*/
NOUN_CONTACT: GlodaContact.prototype.NOUN_ID, // 103
/**
* A single identity of a contact, who may have one or more. E-mail accounts,
* instant messaging accounts, social network site accounts, etc. are each
- * identities. See datamodel.js for the definition of the GlodaIdentity
+ * identities. See GlodaDataModel.jsm for the definition of the GlodaIdentity
* class.
*/
NOUN_IDENTITY: GlodaIdentity.prototype.NOUN_ID, // 104
/**
* An attachment to a message. A message may have many different attachments.
*/
NOUN_ATTACHMENT: GlodaAttachment.prototype.NOUN_ID, // 105
/**
@@ -846,17 +845,17 @@ var Gloda = {
/**
* Parameterized identities, for use in the from-me, to-me, cc-me optimization
* cases. Not for reuse without some thought. These nouns use the parameter
* to store the 'me' identity that we are talking about, and the value to
* store the identity of the other party. So in both the from-me and to-me
* cases involving 'me' and 'foo@bar', the 'me' identity is always stored via
* the attribute parameter, and the 'foo@bar' identity is always stored as
- * the attribute value. See fundattr.js for more information on this, but
+ * the attribute value. See GlodaFundAttr.jsm for more information on this, but
* you probably shouldn't be touching this unless you are fundattr.
*/
NOUN_PARAM_IDENTITY: 200,
/** Next Noun ID to hand out, these don't need to be persisted (for now). */
_nextNounID: 1000,
/**
@@ -1120,20 +1119,20 @@ var Gloda = {
* Maps nouns to their attribute providers to a list of the attributes they
* provide for the noun.
*/
_attrProvidersByNoun: {},
/**
* Define the core nouns (that are not defined elsewhere) and a few noun
* actions. Core nouns could be defined in other files, assuming dependency
- * issues are resolved via the everybody.js mechanism or something else.
+ * issues are resolved via the Everybody.jsm mechanism or something else.
* Right now, noun_tag defines the tag noun. If we broke more of these out,
- * we would probably want to move the 'class' code from datamodel.js, the
- * SQL table def and helper code from datastore.js (and this code) to their
+ * we would probably want to move the 'class' code from GlodaDataModel.jsm, the
+ * SQL table def and helper code from GlodaDatastore.jsm (and this code) to their
* own noun_*.js files. There are some trade-offs to be made, and I think
* we can deal with those once we start to integrate lightning/calendar and
* our noun space gets large and more heterogeneous.
*/
_initAttributes() {
this.defineNoun(
{
name: "bool",
@@ -2549,11 +2548,11 @@ try {
"Exception during Gloda init (" +
ex.fileName +
":" +
ex.lineNumber +
"): " +
ex
);
}
-/* but don't forget that we effectively depend on everybody.js too, and
+/* but don't forget that we effectively depend on Everybody.jsm too, and
currently on our importer to be importing that if they need us fully armed
and operational. */
rename from mailnews/db/gloda/modules/connotent.js
rename to mailnews/db/gloda/modules/GlodaContent.jsm
--- a/mailnews/db/gloda/modules/connotent.js
+++ b/mailnews/db/gloda/modules/GlodaContent.jsm
@@ -4,20 +4,16 @@
this.EXPORTED_SYMBOLS = [
"GlodaContent",
"whittlerRegistry",
"mimeMsgToContentAndMeta",
"mimeMsgToContentSnippetAndMeta",
];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-
-var LOG = Log4Moz.repository.getLogger("gloda.connotent");
-
/**
* Given a MimeMsg and the corresponding folder, return the GlodaContent object.
*
* @param aMimeMsg: the MimeMessage instance
* @param folder: the nsIMsgDBFolder
* @return an array containing the GlodaContent instance, and the meta dictionary
* that the Gloda content providers may have filled with useful data.
*/
rename from mailnews/db/gloda/modules/datamodel.js
rename to mailnews/db/gloda/modules/GlodaDataModel.jsm
--- a/mailnews/db/gloda/modules/datamodel.js
+++ b/mailnews/db/gloda/modules/GlodaDataModel.jsm
@@ -9,24 +9,22 @@ this.EXPORTED_SYMBOLS = [
"GlodaFolder",
"GlodaMessage",
"GlodaContact",
"GlodaIdentity",
"GlodaAttachment",
];
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
-const { MailServices } = ChromeUtils.import(
- "resource:///modules/MailServices.jsm"
-);
-
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var LOG = Log4Moz.repository.getLogger("gloda.datamodel");
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
+const { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
+);
// Make it lazy.
var gMessenger;
function getMessenger() {
if (!gMessenger) {
gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
}
return gMessenger;
rename from mailnews/db/gloda/modules/databind.js
rename to mailnews/db/gloda/modules/GlodaDatabind.jsm
--- a/mailnews/db/gloda/modules/databind.js
+++ b/mailnews/db/gloda/modules/GlodaDatabind.jsm
@@ -1,17 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaDatabind"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-
-var DBC_LOG = Log4Moz.repository.getLogger("gloda.ds.dbc");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
function GlodaDatabind(aNounDef, aDatastore) {
this._nounDef = aNounDef;
this._tableName = aNounDef.tableName;
this._tableDef = aNounDef.schema;
this._datastore = aDatastore;
this._log = Log4Moz.repository.getLogger("gloda.databind." + this._tableName);
rename from mailnews/db/gloda/modules/datastore.js
rename to mailnews/db/gloda/modules/GlodaDatastore.jsm
--- a/mailnews/db/gloda/modules/datastore.js
+++ b/mailnews/db/gloda/modules/GlodaDatastore.jsm
@@ -1,37 +1,37 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/* This file looks to Myk Melez <myk@mozilla.org>'s Mozilla Labs snowl
- * project's (https://hg.mozilla.org/labs/snowl/) modules/datastore.js
+ * project's (https://hg.mozilla.org/labs/snowl/) modules/GlodaDatastore.jsm
* for inspiration and idioms (and also a name :).
*/
this.EXPORTED_SYMBOLS = ["GlodaDatastore"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
-
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
+
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const {
GlodaAttributeDBDef,
GlodaConversation,
GlodaFolder,
GlodaMessage,
GlodaContact,
GlodaIdentity,
-} = ChromeUtils.import("resource:///modules/gloda/datamodel.js");
+} = ChromeUtils.import("resource:///modules/gloda/GlodaDataModel.jsm");
const { GlodaDatabind } = ChromeUtils.import(
- "resource:///modules/gloda/databind.js"
+ "resource:///modules/gloda/GlodaDatabind.jsm"
);
const { GlodaCollection, GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
var MIN_CACHE_SIZE = 8 * 1048576;
var MAX_CACHE_SIZE = 64 * 1048576;
var MEMSIZE_FALLBACK_BYTES = 256 * 1048576;
var PCH_LOG = Log4Moz.repository.getLogger("gloda.ds.pch");
@@ -647,36 +647,36 @@ var DB_SCHEMA_ACCEPT_LEAVE_LOW = 31,
* hand-rolled cases.
* For now, the argument can probably be made that our explicit schemas and code
* is readable/intuitive (not magic) and efficient (although generic stuff
* could also be made efficient, if slightly evil through use of eval or some
* other code generation mechanism.)
*
* === Data Model Interaction / Dependencies
*
- * Dependent on and assumes limited knowledge of the datamodel.js
- * implementations. datamodel.js actually has an implicit dependency on
+ * Dependent on and assumes limited knowledge of the GlodaDataModel.jsm
+ * implementations. GlodaDataModel.jsm actually has an implicit dependency on
* our implementation, reaching back into the datastore via the _datastore
* attribute which we pass into every instance we create.
- * We pass a reference to ourself as we create the datamodel.js instances (and
+ * We pass a reference to ourself as we create the GlodaDataModel.jsm instances (and
* they store it as _datastore) because of a half-implemented attempt to make
* it possible to live in a world where we have multiple datastores. This
* would be desirable in the cases where we are dealing with multiple SQLite
* databases. This could be because of per-account global databases or
* some other segmentation. This was abandoned when the importance of
* per-account databases was diminished following public discussion, at least
* for the short-term, but no attempted was made to excise the feature or
* preclude it. (Merely a recognition that it's too much to try and implement
* correct right now, especially because our solution might just be another
* (aggregating) layer on top of things, rather than complicating the lower
* levels.)
*
* === Object Identity / Caching
*
- * The issue of object identity is handled by integration with the collection.js
+ * The issue of object identity is handled by integration with the Collection.jsm
* provided GlodaCollectionManager. By "Object Identity", I mean that we only
* should ever have one object instance alive at a time that corresponds to
* an underlying database row in the database. Where possible we avoid
* performing database look-ups when we can check if the object is already
* present in memory; in practice, this means when we are asking for an object
* by ID. When we cannot avoid a database query, we attempt to make sure that
* we do not return a duplicate object instance, instead replacing it with the
* 'live' copy of the object. (Ideally, we would avoid any redundant
@@ -720,17 +720,17 @@ var DB_SCHEMA_ACCEPT_LEAVE_LOW = 31,
* attributes. Say a plugin exists that extracts recipes from messages and
* relates them via an attribute. To do so, it must create new recipe rows
* in its own table as new recipes are discovered. No automatic mechanism
* will purge recipes as their source messages are purged, nor does any
* event-driven mechanism explicitly inform the plugin. (It could infer
* such an event from the indexing/attribute-providing process, or poll the
* states of attributes to accomplish this, but that is not desirable.) This
* needs to be addressed, and may be best addressed at layers above
- * datastore.js.
+ * GlodaDatastore.jsm.
* @namespace
*/
var GlodaDatastore = {
_log: null,
/* see Gloda's documentation for these constants */
kSpecialNotAtAll: 0,
kSpecialColumn: 16,
@@ -902,17 +902,17 @@ var GlodaDatastore = {
messageLocation: ["folderID", "messageKey"],
headerMessageID: ["headerMessageID"],
conversationID: ["conversationID"],
date: ["date"],
deleted: ["deleted"],
},
// note: if reordering the columns, you need to change this file's
- // row-loading logic, msg_search.js's ranking usages and also the
+ // row-loading logic, GlodaMsgSearcher.jsm's ranking usages and also the
// column saturations in nsGlodaRankerFunction
fulltextColumns: [
["body", "TEXT"],
["subject", "TEXT"],
["attachmentNames", "TEXT"],
["author", "TEXT"],
["recipients", "TEXT"],
],
rename from mailnews/db/gloda/modules/explattr.js
rename to mailnews/db/gloda/modules/GlodaExplicitAttr.jsm
--- a/mailnews/db/gloda/modules/explattr.js
+++ b/mailnews/db/gloda/modules/GlodaExplicitAttr.jsm
@@ -6,30 +6,27 @@
* This file provides the "explicit attribute" provider for messages. It is
* concerned with attributes that are the result of user actions. For example,
* whether a message is starred (flagged), message tags, whether it is
* read/unread, etc.
*/
this.EXPORTED_SYMBOLS = ["GlodaExplicitAttr"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
-const { TagNoun } = ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
+const { TagNoun } = ChromeUtils.import("resource:///modules/gloda/NounTag.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-var EXT_BUILTIN = "built-in";
-
/**
* @namespace Explicit attribute provider. Indexes/defines attributes that are
* explicitly a result of user action. This dubiously includes marking a
* message as read.
*/
var GlodaExplicitAttr = {
providerName: "gloda.explattr",
strings: new StringBundle("chrome://messenger/locale/gloda.properties"),
rename from mailnews/db/gloda/modules/fundattr.js
rename to mailnews/db/gloda/modules/GlodaFundAttr.jsm
--- a/mailnews/db/gloda/modules/fundattr.js
+++ b/mailnews/db/gloda/modules/GlodaFundAttr.jsm
@@ -1,32 +1,31 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaFundAttr"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
-const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+const { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
);
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
const { GlodaAttachment } = ChromeUtils.import(
- "resource:///modules/gloda/datamodel.js"
+ "resource:///modules/gloda/GlodaDataModel.jsm"
);
-const { MimeType, MimeTypeNoun } = ChromeUtils.import(
- "resource:///modules/gloda/noun_mimetype.js"
+const { MimeTypeNoun } = ChromeUtils.import(
+ "resource:///modules/gloda/NounMimetype.jsm"
);
const { GlodaContent } = ChromeUtils.import(
- "resource:///modules/gloda/connotent.js"
+ "resource:///modules/gloda/GlodaContent.jsm"
);
/**
* @namespace The Gloda Fundamental Attribute provider is a special attribute
* provider; it provides attributes that the rest of the providers should be
* able to assume exist. Also, it may end up accessing things at a lower level
* than most extension providers should do. In summary, don't mimic this code
* unless you won't complain when your code breaks.
rename from mailnews/db/gloda/modules/indexer.js
rename to mailnews/db/gloda/modules/GlodaIndexer.jsm
--- a/mailnews/db/gloda/modules/indexer.js
+++ b/mailnews/db/gloda/modules/GlodaIndexer.jsm
@@ -7,30 +7,27 @@
* indexing with a very explicit message indexing implementation. As gloda
* will eventually want to index more than just messages, the message-specific
* things should ideally lose their special hold on this file. This will
* benefit readability/size as well.
*/
this.EXPORTED_SYMBOLS = ["GlodaIndexer", "IndexingJob"];
-const { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
+const { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
);
-const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
const { GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
/**
* @class Capture the indexing batch concept explicitly.
*
* @param aJobType The type of thing we are indexing. Current choices are:
* "folder" and "message". Previous choices included "account". The indexer
* currently knows too much about these; they should be de-coupled.
@@ -416,19 +413,19 @@ var GlodaIndexer = {
this.enabled = false;
GlodaDatastore.shutdown();
},
/**
* The list of indexers registered with us. If you are a core gloda indexer
* (you ship with gloda), then you can import this file directly and should
- * make sure your indexer is imported in 'everybody.js' in the right order.
- * If you are not core gloda, then you should import 'public.js' and only
- * then should you import 'indexer.js' to get at GlodaIndexer.
+ * make sure your indexer is imported in 'Everybody.jsm' in the right order.
+ * If you are not core gloda, then you should import 'GlodaPublic.jsm' and only
+ * then should you import 'GlodaIndexer.jsm' to get at GlodaIndexer.
*/
_indexers: [],
/**
* Register an indexer with the Gloda indexing mechanism.
*
* @param aIndexer.name The name of your indexer.
* @param aIndexer.enable Your enable function. This will be called during
* the call to registerIndexer if Gloda indexing is already enabled. If
@@ -1487,11 +1484,11 @@ var GlodaIndexer = {
this.suppressIndexing = false;
}
} else if (aTopic == "quit-application") {
// shutdown fallback
this._shutdown();
}
},
};
-// we used to initialize here; now we have public.js do it for us after the
+// we used to initialize here; now we have GlodaPublic.jsm do it for us after the
// indexers register themselves so we know about all our built-in indexers
// at init-time.
rename from mailnews/db/gloda/modules/index_ab.js
rename to mailnews/db/gloda/modules/GlodaMsgIndexer.jsm
--- a/mailnews/db/gloda/modules/index_ab.js
+++ b/mailnews/db/gloda/modules/GlodaMsgIndexer.jsm
@@ -1,29 +1,25 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaABIndexer", "GlodaABAttrs"];
const { GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
-const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
-);
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
const { GlodaIndexer, IndexingJob } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { FreeTagNoun } = ChromeUtils.import(
- "resource:///modules/gloda/noun_freetag.js"
+ "resource:///modules/gloda/NounFreetag.jsm"
);
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var GlodaABIndexer = {
_log: null,
name: "index_ab",
rename from mailnews/db/gloda/modules/msg_search.js
rename to mailnews/db/gloda/modules/GlodaMsgSearcher.jsm
--- a/mailnews/db/gloda/modules/msg_search.js
+++ b/mailnews/db/gloda/modules/GlodaMsgSearcher.jsm
@@ -1,16 +1,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaMsgSearcher"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+const { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+);
/**
* How much time boost should a 'score point' amount to? The authoritative,
* incontrivertible answer, across all time and space, is a week.
* Note that gloda stores timestamps as PRTimes for no exceedingly good
* reason.
*/
var FUZZSCORE_TIMESTAMP_FACTOR = 1000 * 1000 * 60 * 60 * 24 * 7;
rename from mailnews/db/gloda/modules/public.js
rename to mailnews/db/gloda/modules/GlodaPublic.jsm
--- a/mailnews/db/gloda/modules/public.js
+++ b/mailnews/db/gloda/modules/GlodaPublic.jsm
@@ -1,27 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["Gloda"];
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
/* nothing to import, just run some code */ ChromeUtils.import(
- "resource:///modules/gloda/everybody.js"
+ "resource:///modules/gloda/Everybody.jsm"
);
const { GlodaIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
// initialize the indexer! (who was actually imported as a nested dep by the
-// things everybody.js imported.) We waited until now so it could know about
+// things Everybody.jsm imported.) We waited until now so it could know about
// its indexers.
GlodaIndexer._init();
const { GlodaMsgIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/index_msg.js"
+ "resource:///modules/gloda/IndexMsg.jsm"
);
/**
* Expose some junk
*/
function proxy(aSourceObj, aSourceAttr, aDestObj, aDestAttr) {
aDestObj[aDestAttr] = function(...aArgs) {
return aSourceObj[aSourceAttr](...aArgs);
rename from mailnews/db/gloda/modules/query.js
rename to mailnews/db/gloda/modules/GlodaQueryClassFactory.jsm
--- a/mailnews/db/gloda/modules/query.js
+++ b/mailnews/db/gloda/modules/GlodaQueryClassFactory.jsm
@@ -2,17 +2,17 @@
* 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/. */
this.EXPORTED_SYMBOLS = ["GlodaQueryClassFactory"];
// GlodaDatastore has some constants we need, and oddly enough, there was no
// load dependency preventing us from doing this.
const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
/**
* @class Query class core; each noun gets its own sub-class where attributes
* have helper methods bound.
*
* @param aOptions A dictionary of options. Current legal options are:
* - noMagic: Indicates that the noun's dbQueryJoinMagic should be ignored.
rename from mailnews/db/gloda/modules/dbview.js
rename to mailnews/db/gloda/modules/GlodaSyntheticView.jsm
--- a/mailnews/db/gloda/modules/dbview.js
+++ b/mailnews/db/gloda/modules/GlodaSyntheticView.jsm
@@ -6,21 +6,16 @@
* This file is charged with providing you a way to have a pretty gloda-backed
* nsIMsgDBView.
*/
this.EXPORTED_SYMBOLS = ["GlodaSyntheticView"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
-const { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
-);
-
/**
* Create a synthetic view suitable for passing to |FolderDisplayWidget.show|.
* You must pass a query, collection, or conversation in.
*
* @param {GlodaQuery} [aArgs.query] A gloda query to run.
* @param {GlodaCollection} [aArgs.collection] An already-populated collection
* to display. Do not call getCollection on a query and hand us that. We
* will not register ourselves as a listener and things will not work.
rename from mailnews/db/gloda/modules/utils.js
rename to mailnews/db/gloda/modules/GlodaUtils.jsm
rename from mailnews/db/gloda/modules/index_msg.js
rename to mailnews/db/gloda/modules/IndexMsg.jsm
--- a/mailnews/db/gloda/modules/index_msg.js
+++ b/mailnews/db/gloda/modules/IndexMsg.jsm
@@ -9,45 +9,44 @@
* indexing with a very explicit message indexing implementation. As gloda
* will eventually want to index more than just messages, the message-specific
* things should ideally lose their special hold on this file. This will
* benefit readability/size as well.
*/
this.EXPORTED_SYMBOLS = ["GlodaMsgIndexer"];
-const { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
-);
const { fixIterator } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
-
-const { GlodaUtils } = ChromeUtils.import("resource:///modules/gloda/utils.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
+
+const { GlodaUtils } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaUtils.jsm"
+);
const { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
const { GlodaContact, GlodaFolder } = ChromeUtils.import(
- "resource:///modules/gloda/datamodel.js"
+ "resource:///modules/gloda/GlodaDataModel.jsm"
);
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
const { GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
const { GlodaIndexer, IndexingJob } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
const { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
// Cr does not have mailnews error codes!
var NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE = 0x80550005;
var GLODA_MESSAGE_ID_PROPERTY = "gloda-id";
/**
* Message header property to track dirty status; one of
@@ -76,17 +75,16 @@ var GLODA_BAD_MESSAGE_ID = 2;
* event-driven indexing will still treat such messages as unindexed (and
* unindexable) until an indexing sweep picks them up.
*/
var GLODA_OLD_BAD_MESSAGE_ID = 1;
var GLODA_FIRST_VALID_MESSAGE_ID = 32;
var JUNK_SCORE_PROPERTY = "junkscore";
var JUNK_SPAM_SCORE_STR = Ci.nsIJunkMailPlugin.IS_SPAM_SCORE.toString();
-var JUNK_HAM_SCORE_STR = Ci.nsIJunkMailPlugin.IS_HAM_SCORE.toString();
/**
* The processing flags that tell us that a message header has not yet been
* reported to us via msgsClassified. If it has one of these flags, it is
* still being processed.
*/
var NOT_YET_REPORTED_PROCESSING_FLAGS =
Ci.nsMsgProcessingFlags.NotReportedClassified |
@@ -3393,30 +3391,30 @@ var GlodaMsgIndexer = {
// associated with the id is still exactly the same. It is conceivable
// that there are cases where this is not true.
}
if (aMimeMsg) {
let bodyPlain = aMimeMsg.coerceBodyToPlaintext(aMsgHdr.folder);
if (bodyPlain) {
curMsg._bodyLines = bodyPlain.split(/\r?\n/);
- // curMsg._content gets set by fundattr.js
+ // curMsg._content gets set by GlodaFundAttr.jsm
}
}
// Mark the message as new (for the purposes of fulltext insertion)
if (insertFulltext) {
curMsg._isNew = true;
}
curMsg._subject = aMsgHdr.mime2DecodedSubject;
curMsg._attachmentNames = attachmentNames;
- // curMsg._indexAuthor gets set by fundattr.js
- // curMsg._indexRecipients gets set by fundattr.js
+ // curMsg._indexAuthor gets set by GlodaFundAttr.jsm
+ // curMsg._indexRecipients gets set by GlodaFundAttr.jsm
// zero the notability so everything in grokNounItem can just increment
curMsg.notability = 0;
yield aCallbackHandle.pushAndGo(
Gloda.grokNounItem(
curMsg,
{ header: aMsgHdr, mime: aMimeMsg, bodyLines: curMsg._bodyLines },
rename from mailnews/db/gloda/modules/log4moz.js
rename to mailnews/db/gloda/modules/Log4moz.jsm
--- a/mailnews/db/gloda/modules/log4moz.js
+++ b/mailnews/db/gloda/modules/Log4moz.jsm
@@ -1,24 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["Log4Moz"];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var MODE_RDONLY = 0x01;
var MODE_WRONLY = 0x02;
var MODE_CREATE = 0x08;
var MODE_APPEND = 0x10;
-var MODE_TRUNCATE = 0x20;
var PERMS_FILE = parseInt("0644", 8);
-var PERMS_DIRECTORY = parseInt("0755", 8);
var ONE_BYTE = 1;
var ONE_KILOBYTE = 1024 * ONE_BYTE;
var ONE_MEGABYTE = 1024 * ONE_KILOBYTE;
var DEFAULT_NETWORK_TIMEOUT_DELAY = 5;
var CDATA_START = "<![CDATA[";
rename from mailnews/db/gloda/modules/mimemsg.js
rename to mailnews/db/gloda/modules/MimeMessage.jsm
--- a/mailnews/db/gloda/modules/mimemsg.js
+++ b/mailnews/db/gloda/modules/MimeMessage.jsm
@@ -7,21 +7,16 @@ this.EXPORTED_SYMBOLS = [
"MimeMessage",
"MimeContainer",
"MimeBody",
"MimeUnknown",
"MimeMessageAttachment",
];
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const { XPCOMUtils } = ChromeUtils.import(
- "resource://gre/modules/XPCOMUtils.jsm"
-);
-
-var EMITTER_MIME_CODE = "application/x-js-mime-message";
/**
* The URL listener is surplus because the CallbackStreamListener ends up
* getting the same set of events, effectively.
*/
var dumbUrlListener = {
OnStartRunningUrl(aUrl) {},
OnStopRunningUrl(aUrl, aExitCode) {},
rename from mailnews/db/gloda/modules/mimeTypeCategories.js
rename to mailnews/db/gloda/modules/MimeTypeCategories.jsm
rename from mailnews/db/gloda/modules/noun_freetag.js
rename to mailnews/db/gloda/modules/NounFreetag.jsm
--- a/mailnews/db/gloda/modules/noun_freetag.js
+++ b/mailnews/db/gloda/modules/NounFreetag.jsm
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["FreeTag", "FreeTagNoun"];
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
function FreeTag(aTagName) {
this.name = aTagName;
}
FreeTag.prototype = {
toString() {
return this.name;
rename from mailnews/db/gloda/modules/noun_mimetype.js
rename to mailnews/db/gloda/modules/NounMimetype.jsm
--- a/mailnews/db/gloda/modules/noun_mimetype.js
+++ b/mailnews/db/gloda/modules/NounMimetype.jsm
@@ -1,21 +1,21 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["MimeType", "MimeTypeNoun"];
const { StringBundle } = ChromeUtils.import(
- "resource:///modules/StringBundle.js"
+ "resource:///modules/StringBundle.jsm"
);
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var LOG = Log4Moz.repository.getLogger("gloda.noun.mimetype");
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
var CategoryStringMap = {};
/**
* Mime type abstraction that exists primarily so we can map mime types to
* integer id's.
*
* Instances of this class should only be retrieved via |MimeTypeNoun|; no one
@@ -133,21 +133,21 @@ var MimeTypeNoun = {
this._loadMimeTypes();
},
/**
* A map from MIME type to category name.
*/
_mimeTypeToCategory: {},
/**
- * Load the contents of mimeTypeCategories.js and populate
+ * Load the contents of MimeTypeCategories.jsm and populate
*/
_loadCategoryMapping() {
let { MimeCategoryMapping } = ChromeUtils.import(
- "resource:///modules/gloda/mimeTypeCategories.js"
+ "resource:///modules/gloda/MimeTypeCategories.jsm"
);
let mimeTypeToCategory = this._mimeTypeToCategory;
function procMapObj(aSubTree, aCategories) {
for (let key in aSubTree) {
let value = aSubTree[key];
// Add this category to our nested categories list. Use concat since
rename from mailnews/db/gloda/modules/noun_tag.js
rename to mailnews/db/gloda/modules/NounTag.jsm
--- a/mailnews/db/gloda/modules/noun_tag.js
+++ b/mailnews/db/gloda/modules/NounTag.jsm
@@ -3,17 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
this.EXPORTED_SYMBOLS = ["TagNoun"];
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-const { Gloda } = ChromeUtils.import("resource:///modules/gloda/gloda.js");
+const { Gloda } = ChromeUtils.import("resource:///modules/gloda/Gloda.jsm");
/**
* @namespace Tag noun provider.
*/
var TagNoun = {
name: "tag",
clazz: Ci.nsIMsgTag,
usesParameter: true,
rename from mailnews/db/gloda/modules/suffixtree.js
rename to mailnews/db/gloda/modules/SuffixTree.jsm
--- a/mailnews/db/gloda/modules/suffixtree.js
+++ b/mailnews/db/gloda/modules/SuffixTree.jsm
@@ -31,23 +31,16 @@ function MultiSuffixTree(aStrings, aItem
* @constructor
*/
function State(aStartIndex, aEndIndex, aSuffix) {
this.start = aStartIndex;
this.end = aEndIndex;
this.suffix = aSuffix;
}
-var dump;
-if (dump === undefined) {
- dump = function(a) {
- print(a.slice(0, -1));
- };
-}
-
/**
* Since objects are basically hash-tables anyways, we simply create an
* attribute whose name is the first letter of the edge string. (So, the
* edge string can conceptually be a multi-letter string, but since we would
* split it were there any ambiguity, it's okay to just use the single letter.)
* This avoids having to update the attribute name or worry about tripping our
* implementation up.
*/
@@ -379,26 +372,8 @@ dump(" bailing! (bail was: " + bail + "
let nextIndent = aIndent + " ";
let keys = Object.keys(aState).filter(c => c.length == 1);
for (let key of keys) {
this.dump(aState[key], nextIndent, key);
}
},
};
MultiSuffixTree.prototype = SuffixTree.prototype;
-
-function examplar() {
- let names = [
- "AndrewSmith",
- "AndrewJones",
- "MarkSmith",
- "BryanClark",
- "MarthaJones",
- "DavidAscher",
- "DanMosedale",
- "DavidBienvenu",
- "JanetDavis",
- "JosephBryant",
- ];
- let b = new MultiSuffixTree(names, names);
- b.dump();
- dump(b.findMatches("rya") + "\n");
-}
--- a/mailnews/db/gloda/modules/moz.build
+++ b/mailnews/db/gloda/modules/moz.build
@@ -1,32 +1,32 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
EXTRA_JS_MODULES.gloda += [
- 'collection.js',
- 'connotent.js',
- 'databind.js',
- 'datamodel.js',
- 'datastore.js',
- 'dbview.js',
- 'everybody.js',
- 'explattr.js',
- 'facet.js',
- 'fundattr.js',
- 'gloda.js',
- 'index_ab.js',
- 'index_msg.js',
- 'indexer.js',
- 'log4moz.js',
- 'mimemsg.js',
- 'mimeTypeCategories.js',
- 'msg_search.js',
- 'noun_freetag.js',
- 'noun_mimetype.js',
- 'noun_tag.js',
- 'public.js',
- 'query.js',
- 'suffixtree.js',
- 'utils.js',
+ 'Collection.jsm',
+ 'Everybody.jsm',
+ 'Facet.jsm',
+ 'Gloda.jsm',
+ 'GlodaContent.jsm',
+ 'GlodaDatabind.jsm',
+ 'GlodaDataModel.jsm',
+ 'GlodaDatastore.jsm',
+ 'GlodaExplicitAttr.jsm',
+ 'GlodaFundAttr.jsm',
+ 'GlodaIndexer.jsm',
+ 'GlodaMsgIndexer.jsm',
+ 'GlodaMsgSearcher.jsm',
+ 'GlodaPublic.jsm',
+ 'GlodaQueryClassFactory.jsm',
+ 'GlodaSyntheticView.jsm',
+ 'GlodaUtils.jsm',
+ 'IndexMsg.jsm',
+ 'Log4moz.jsm',
+ 'MimeMessage.jsm',
+ 'MimeTypeCategories.jsm',
+ 'NounFreetag.jsm',
+ 'NounMimetype.jsm',
+ 'NounTag.jsm',
+ 'SuffixTree.jsm',
]
--- a/mailnews/db/gloda/test/unit/base_gloda_content.js
+++ b/mailnews/db/gloda/test/unit/base_gloda_content.js
@@ -1,35 +1,35 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/*
- * Tests the operation of the GlodaContent (in connotent.js) and its exposure
+ * Tests the operation of the GlodaContent (in GlodaContent.jsm) and its exposure
* via Gloda.getMessageContent. This may also be implicitly tested by indexing
* and fulltext query tests (on messages), but the buck stops here for the
* content stuff.
*
* Currently, we just test quoting removal and that the content turns out right.
* We do not actually verify that the quoted blocks are correct (aka we might
* screw up eating the greater-than signs). (We have no known consumers who
* care about the quoted blocks.)
*/
/* import-globals-from resources/glodaTestHelper.js */
load("resources/glodaTestHelper.js");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
// we need to be able to get at GlodaFundAttr to check the number of whittler
// invocations
var { GlodaFundAttr } = ChromeUtils.import(
- "resource:///modules/gloda/fundattr.js"
+ "resource:///modules/gloda/GlodaFundAttr.jsm"
);
/* ===== Data ===== */
var messageInfos = [
{
name: "no quoting",
bode: [
[true, "I like hats"],
--- a/mailnews/db/gloda/test/unit/base_index_messages.js
+++ b/mailnews/db/gloda/test/unit/base_index_messages.js
@@ -391,17 +391,17 @@ function verify_attachment_flag(smsg, gm
Assert.equal(gmsg.attachmentNames.length, 0);
Assert.equal(gmsg.attachmentInfos.length, 0);
Assert.equal(
false,
gmsg.folderMessage.flags & Ci.nsMsgMessageFlags.Attachment
);
}
}
-/* ===== Fundamental Attributes (per fundattr.js) ===== */
+/* ===== Fundamental Attributes (per GlodaFundAttr.jsm) ===== */
/**
* Save the synthetic message created in test_attributes_fundamental for the
* benefit of test_attributes_fundamental_from_disk.
*/
var fundamentalSyntheticMessage;
var fundamentalFolderHandle;
/**
@@ -414,18 +414,18 @@ var fundamentalGlodaMsgAttachmentUrls;
* Save the resulting gloda message id corresponding to the
* fundamentalSyntheticMessage so we can use it to query the message from disk.
*/
var fundamentalGlodaMessageId;
/**
* Test that we extract the 'fundamental attributes' of a message properly
* 'Fundamental' in this case is talking about the attributes defined/extracted
- * by gloda's fundattr.js and perhaps the core message indexing logic itself
- * (which show up as kSpecial* attributes in fundattr.js anyways.)
+ * by gloda's GlodaFundAttr.jsm and perhaps the core message indexing logic itself
+ * (which show up as kSpecial* attributes in GlodaFundAttr.jsm anyways.)
*/
function* test_attributes_fundamental() {
// create a synthetic message with attachment
let smsg = msgGen.makeMessage({
name: "test message",
bodyPart: new SyntheticPartMultiMixed([
new SyntheticPartLeaf({ body: "I like cheese!" }),
msgGen.makeMessage({ body: { body: "I like wine!" } }), // that's one attachment
@@ -610,20 +610,20 @@ function test_attributes_fundamental_fro
* @param aGlodaMessageLists This should be [[theGlodaMessage]].
*/
function verify_attributes_fundamental_from_disk(aGlodaMessage) {
// return the message id for test_attributes_fundamental_from_disk's benefit
verify_attributes_fundamental(fundamentalSyntheticMessage, aGlodaMessage);
return aGlodaMessage.headerMessageID;
}
-/* ===== Explicit Attributes (per explattr.js) ===== */
+/* ===== Explicit Attributes (per GlodaExplicitAttr.jsm) ===== */
/**
- * Test the attributes defined by explattr.js.
+ * Test the attributes defined by GlodaExplicitAttr.jsm.
*/
function* test_attributes_explicit() {
let [, msgSet] = make_folder_with_sets([{ count: 1 }]);
yield wait_for_message_injection();
yield wait_for_gloda_indexer(msgSet, { augment: true });
let gmsg = msgSet.glodaMessages[0];
// -- Star
--- a/mailnews/db/gloda/test/unit/head_gloda.js
+++ b/mailnews/db/gloda/test/unit/head_gloda.js
@@ -1,10 +1,10 @@
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../../";
// glodaTestHelper.js does all the rest of the imports
--- a/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
+++ b/mailnews/db/gloda/test/unit/resources/glodaTestHelper.js
@@ -26,39 +26,39 @@ var { Services } = ChromeUtils.import("r
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// Import the main scripts that mailnews tests need to set up and tear down
/* import-globals-from ../../../../../test/resources/abSetup.js */
/* import-globals-from ../../../../../test/resources/logHelper.js */
/* import-globals-from ../../../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../../../test/resources/messageModifier.js */
/* import-globals-from ../../../../../test/resources/messageInjection.js */
/* import-globals-from ../../../../../test/resources/folderEventLogHelper.js */
load("../../../../resources/abSetup.js");
load("../../../../resources/logHelper.js");
load("../../../../resources/asyncTestUtils.js");
-load("../../../../resources/messageGenerator.js");
+load("../../../../resources/MessageGenerator.jsm");
load("../../../../resources/messageModifier.js");
load("../../../../resources/messageInjection.js");
load("../../../../resources/folderEventLogHelper.js");
// register this before gloda gets a chance to do anything so that
registerFolderEventLogHelper();
/* exported scenarios */
// Create a message generator
var msgGen = (gMessageGenerator = new MessageGenerator());
// Create a message scenario generator using that message generator
var scenarios = new MessageScenarioFactory(msgGen);
-var { logObject } = ChromeUtils.import("resource:///modules/errUtils.js");
+var { logObject } = ChromeUtils.import("resource:///modules/ErrUtils.jsm");
/**
* Create a 'me' identity of "me@localhost" for the benefit of Gloda. At the
* time of this writing, Gloda only initializes Gloda.myIdentities and
* Gloda.myContact at startup with no event-driven updates. As such, this
* function needs to be called prior to gloda startup.
*/
function createMeIdentity() {
@@ -94,39 +94,39 @@ var environ = Cc["@mozilla.org/process/e
for (let { envVar, prefName } of ENVIRON_MAPPINGS) {
if (environ.exists(envVar)) {
Services.prefs.setCharPref(prefName, environ.get(envVar));
}
}
/* exported IndexingJob, GlodaFolder, TagNoun */
// -- Import our modules
-var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+var { Gloda } = ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
var { GlodaIndexer, IndexingJob } = ChromeUtils.import(
- "resource:///modules/gloda/indexer.js"
+ "resource:///modules/gloda/GlodaIndexer.jsm"
);
var { GlodaMsgIndexer } = ChromeUtils.import(
- "resource:///modules/gloda/index_msg.js"
+ "resource:///modules/gloda/IndexMsg.jsm"
);
var { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
var { GlodaCollectionManager } = ChromeUtils.import(
- "resource:///modules/gloda/collection.js"
+ "resource:///modules/gloda/Collection.jsm"
);
var { GlodaFolder, GlodaMessage } = ChromeUtils.import(
- "resource:///modules/gloda/datamodel.js"
+ "resource:///modules/gloda/GlodaDataModel.jsm"
);
-var { TagNoun } = ChromeUtils.import("resource:///modules/gloda/noun_tag.js");
+var { TagNoun } = ChromeUtils.import("resource:///modules/gloda/NounTag.jsm");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
// -- Add a logger listener that throws when we give it a warning/error.
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
var throwingAppender = new Log4Moz.ThrowingAppender(do_throw);
throwingAppender.level = Log4Moz.Level.Warn;
Log4Moz.repository.rootLogger.addAppender(throwingAppender);
var LOG = Log4Moz.repository.getLogger("gloda.test");
/* exported GLODA_BAD_MESSAGE_ID, GLODA_OLD_BAD_MESSAGE_ID */
// index_msg does not export this, so we need to provide it.
@@ -1282,17 +1282,17 @@ function sqlRun(sql) {
return false;
}
/* exported wait_for_gloda_db_flush */
/**
* Resume execution when the db has run all the async statements whose execution
* was queued prior to this call. We trigger a commit to accomplish this,
* although this could also be accomplished without a commit. (Though we would
- * have to reach into datastore.js and get at the raw connection or extend
+ * have to reach into GlodaDatastore.jsm and get at the raw connection or extend
* datastore to provide a way to accomplish this.)
*/
function wait_for_gloda_db_flush() {
// we already have a mechanism to do this by forcing a commit. arguably,
// it would be better to use a mechanism that does not induce an fsync.
var savedDepth = GlodaDatastore._transactionDepth;
if (!savedDepth) {
GlodaDatastore._beginTransaction();
--- a/mailnews/db/gloda/test/unit/test_corrupt_database.js
+++ b/mailnews/db/gloda/test/unit/test_corrupt_database.js
@@ -32,17 +32,17 @@ Services.prefs.setBoolPref("mailnews.dat
// We'll start with this datastore ID, and make sure it gets overwritten
// when the index is rebuilt.
var kDatastoreIDPref = "mailnews.database.global.datastore.id";
var kOriginalDatastoreID = "47e4bad6-fedc-4931-bf3f-d2f4146ac63e";
Services.prefs.setCharPref(kDatastoreIDPref, kOriginalDatastoreID);
// -- Add a logger listener that throws when we give it a warning/error.
-var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+var { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
/**
* Count the type of each severity level observed.
*/
function CountingAppender() {
this._name = "CountingAppender";
this.counts = {};
}
@@ -99,28 +99,30 @@ function test_corrupt_databases_get_repo
ostream.write(fileContents, fileContents.length);
ostream.close();
// - reset counts in preparation of gloda init
countingAppender.reset();
// - init gloda, get warnings
mark_sub_test_start("init gloda");
- var { Gloda } = ChromeUtils.import("resource:///modules/gloda/public.js");
+ var { Gloda } = ChromeUtils.import(
+ "resource:///modules/gloda/GlodaPublic.jsm"
+ );
mark_sub_test_start("gloda inited, checking");
mark_action("actual", "Counting appender counts", [countingAppender.counts]);
// we expect 2 warnings
Assert.equal(countingAppender.getCountForLevel(Log4Moz.Level.Warn), 2);
// and no errors
Assert.equal(countingAppender.getCountForLevel(Log4Moz.Level.Error), 0);
// - make sure the datastore has an actual database
let { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
// Make sure that the datastoreID was overwritten
Assert.notEqual(Gloda.datastoreID, kOriginalDatastoreID);
// And for good measure, make sure that the pref was also overwritten
let currentDatastoreID = Services.prefs.getCharPref(kDatastoreIDPref);
Assert.notEqual(currentDatastoreID, kOriginalDatastoreID);
// We'll also ensure that the Gloda.datastoreID matches the one stashed
--- a/mailnews/db/gloda/test/unit/test_fts3_tokenizer.js
+++ b/mailnews/db/gloda/test/unit/test_fts3_tokenizer.js
@@ -5,17 +5,17 @@
/*
* This test file recycles part of test_intl.js. What we do is insert into the
* fulltext index two messages:
* - one has tokens 'aa' and 'bbb',
* - one is from a previous test and has CJK characters in it.
*
* We want to test that the behavior of the tokenizer is as expected (namely,
* that it drops two-letter tokens unless they're CJK bigrams), and that
- * msg_search.js properly drops two-letter tokens (unless CJK) from the search
+ * GlodaMsgSearcher.jsm properly drops two-letter tokens (unless CJK) from the search
* terms to avoid issuing a query that will definitely return no results.
*/
/* import-globals-from resources/glodaTestHelper.js */
load("resources/glodaTestHelper.js");
/* ===== Tests ===== */
@@ -150,20 +150,20 @@ function* test_fulltextsearch(aPhrase) {
let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);
query.bodyMatches(searchPhrase.body);
queryExpect(query, searchPhrase.match ? aPhrase.resultList : []);
yield false; // queryExpect is async
}
}
var { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
+ "resource:///modules/gloda/GlodaMsgSearcher.jsm"
);
var { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
/**
* Pass a query string to the GlodaMsgSearcher, run the corresponding SQL query,
* and check the resulted count is what we want.
*
* Use like so:
* yield msgSearchExpectCount(1, "I like cheese");
--- a/mailnews/db/gloda/test/unit/test_gloda_content_imap_offline.js
+++ b/mailnews/db/gloda/test/unit/test_gloda_content_imap_offline.js
@@ -1,11 +1,11 @@
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
- * Tests the operation of the GlodaContent (in connotent.js) and its exposure
+ * Tests the operation of the GlodaContent (in GlodaContent.jsm) and its exposure
* via Gloda.getMessageContent for IMAP messages that are offline.
*/
/* import-globals-from base_gloda_content.js */
load("base_gloda_content.js");
function run_test() {
configure_message_injection({ mode: "imap", offline: true });
--- a/mailnews/db/gloda/test/unit/test_gloda_content_local.js
+++ b/mailnews/db/gloda/test/unit/test_gloda_content_local.js
@@ -1,11 +1,11 @@
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
- * Tests the operation of the GlodaContent (in connotent.js) and its exposure
+ * Tests the operation of the GlodaContent (in GlodaContent.jsm) and its exposure
* via Gloda.getMessageContent for local messages.
*/
/* import-globals-from base_gloda_content.js */
load("base_gloda_content.js");
function run_test() {
configure_message_injection({ mode: "local" });
--- a/mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+++ b/mailnews/db/gloda/test/unit/test_mime_attachments_size.js
@@ -9,34 +9,34 @@
/*
* Do not include glodaTestHelper because we do not want gloda loaded and it
* adds a lot of runtime overhead which makes certain debugging strategies like
* using chronicle-recorder impractical.
*/
/* import-globals-from ../../../../test/resources/logHelper.js */
/* import-globals-from ../../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../../test/resources/messageModifier.js */
/* import-globals-from ../../../../test/resources/messageInjection.js */
load("../../../../resources/logHelper.js");
load("../../../../resources/asyncTestUtils.js");
-load("../../../../resources/messageGenerator.js");
+load("../../../../resources/MessageGenerator.jsm");
load("../../../../resources/messageModifier.js");
load("../../../../resources/messageInjection.js");
/* exported scenarios */
// Create a message generator
var msgGen = (gMessageGenerator = new MessageGenerator());
// Create a message scenario generator using that message generator
var scenarios = new MessageScenarioFactory(msgGen);
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
var htmlText = "<html><head></head><body>I am HTML! Woo! </body></html>";
var partHtml = new SyntheticPartLeaf(htmlText, {
contentType: "text/html",
});
--- a/mailnews/db/gloda/test/unit/test_mime_emitter.js
+++ b/mailnews/db/gloda/test/unit/test_mime_emitter.js
@@ -14,41 +14,41 @@
/*
* Do not include glodaTestHelper because we do not want gloda loaded and it
* adds a lot of runtime overhead which makes certain debugging strategies like
* using chronicle-recorder impractical.
*/
/* import-globals-from ../../../../test/resources/logHelper.js */
/* import-globals-from ../../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../../test/resources/messageModifier.js */
/* import-globals-from ../../../../test/resources/messageInjection.js */
load("../../../../resources/logHelper.js");
load("../../../../resources/asyncTestUtils.js");
-load("../../../../resources/messageGenerator.js");
+load("../../../../resources/MessageGenerator.jsm");
load("../../../../resources/messageModifier.js");
load("../../../../resources/messageInjection.js");
/* exported scenarios */
// Create a message generator
var msgGen = (gMessageGenerator = new MessageGenerator());
// Create a message scenario generator using that message generator
var scenarios = new MessageScenarioFactory(msgGen);
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
// While we're at it, we'll also test the correctness of the GlodaAttachment
// representation, esp. its "I just need the part information to rebuild the
// URLs" claim.
var { GlodaFundAttr } = ChromeUtils.import(
- "resource:///modules/gloda/fundattr.js"
+ "resource:///modules/gloda/GlodaFundAttr.jsm"
);
var partText = new SyntheticPartLeaf("I am text! Woo!");
var partHtml = new SyntheticPartLeaf(
"<html><head></head><body>I am HTML! Woo! </body></html>",
{
contentType: "text/html",
}
@@ -705,16 +705,16 @@ var tests = [
test_part12_not_an_attachment,
];
var gInbox;
function run_test() {
registerCleanupFunction(function() {
let { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
GlodaDatastore.shutdown();
});
// use mbox injection because the fake server chokes sometimes right now
gInbox = configure_message_injection({ mode: "local" });
async_run_tests(tests);
}
--- a/mailnews/db/gloda/test/unit/test_msg_search.js
+++ b/mailnews/db/gloda/test/unit/test_msg_search.js
@@ -1,14 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
/*
- * Test msg_search.js our heuristic-based fulltext search mechanism. Things we
+ * Test GlodaMsgSearcher.jsm our heuristic-based fulltext search mechanism. Things we
* generally want to verify:
* - fulltext weighting by where the match happened works.
* - static interestingness impacts things appropriately.
*
* Our general strategy is to create two messages each with a unique string
* placed in controlled places and whatever intentional message manipulation
* is required to set things up. Then we query using a GlodaMsgSearcher with
* the limit set to 1. Only the message we expect should come back.
@@ -37,17 +37,17 @@ function unique_string() {
String.fromCharCode(97 + (Math.floor(uval / 26) % 26)) +
String.fromCharCode(97 + (uval % 26)) +
"aa";
return s;
}
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { GlodaMsgSearcher } = ChromeUtils.import(
- "resource:///modules/gloda/msg_search.js"
+ "resource:///modules/gloda/GlodaMsgSearcher.jsm"
);
/**
* Wrap the construction of a GlodaMsgSearcher with a limit of 1 and feed it to
* queryExpect.
*
* @param aFulltextStr The fulltext query string which GlodaMsgSearcher will
* parse.
--- a/mailnews/db/gloda/test/unit/test_noun_mimetype.js
+++ b/mailnews/db/gloda/test/unit/test_noun_mimetype.js
@@ -8,17 +8,17 @@
* is the easiest solution. (Don't you hate it when the right thing to do is
* also the easy thing to do?)
*/
/* import-globals-from resources/glodaTestHelper.js */
load("resources/glodaTestHelper.js");
var { MimeTypeNoun } = ChromeUtils.import(
- "resource:///modules/gloda/noun_mimetype.js"
+ "resource:///modules/gloda/NounMimetype.jsm"
);
/* ===== Tests ===== */
var passResults = [];
var curPassResults;
/**
* Setup a new 'pass' by nuking the MimeTypeNoun's state if it has any. The
--- a/mailnews/db/gloda/test/unit/test_nuke_migration.js
+++ b/mailnews/db/gloda/test/unit/test_nuke_migration.js
@@ -51,16 +51,16 @@ Services.prefs.setBoolPref(
// yes to debug output
Services.prefs.setBoolPref("mailnews.database.global.logging.dump", true);
function run_test() {
// - make the old database
make_out_of_date_database();
// - tickle gloda
- // public.js loads gloda.js which self-initializes and initializes the datastore
- ChromeUtils.import("resource:///modules/gloda/public.js");
+ // GlodaPublic.jsm loads Gloda.jsm which self-initializes and initializes the datastore
+ ChromeUtils.import("resource:///modules/gloda/GlodaPublic.jsm");
let { GlodaDatastore } = ChromeUtils.import(
- "resource:///modules/gloda/datastore.js"
+ "resource:///modules/gloda/GlodaDatastore.jsm"
);
Assert.notEqual(GlodaDatastore.asyncConnection, null);
}
--- a/mailnews/db/gloda/test/unit/test_smime_mimemsg_representation.js
+++ b/mailnews/db/gloda/test/unit/test_smime_mimemsg_representation.js
@@ -3,31 +3,31 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Test that S/MIME messages are properly displayed and that the MimeMessage
* representation is correct.
*/
/* import-globals-from ../../../../test/resources/logHelper.js */
/* import-globals-from ../../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../../test/resources/messageModifier.js */
/* import-globals-from ../../../../test/resources/messageInjection.js */
load("../../../../resources/logHelper.js");
load("../../../../resources/asyncTestUtils.js");
-load("../../../../resources/messageGenerator.js");
+load("../../../../resources/MessageGenerator.jsm");
load("../../../../resources/messageModifier.js");
load("../../../../resources/messageInjection.js");
var msgGen = (gMessageGenerator = new MessageGenerator());
var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
function initNSS() {
// Copy the NSS database files over.
let profile = FileUtils.getDir("ProfD", []);
let files = ["cert9.db", "key4.db", "secmod.db"];
let directory = do_get_file("../../../../data/db-tinderbox-invalid");
for (let f of files) {
--- a/mailnews/db/msgdb/test/unit/head_maildb.js
+++ b/mailnews/db/msgdb/test/unit/head_maildb.js
@@ -1,20 +1,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
registerCleanupFunction(function() {
--- a/mailnews/db/msgdb/test/unit/test_filter_enumerator.js
+++ b/mailnews/db/msgdb/test/unit/test_filter_enumerator.js
@@ -1,10 +1,10 @@
-/* import-globals-from ../../../../test/resources/messageGenerator.js */
-load("../../../../resources/messageGenerator.js");
+/* import-globals-from ../../../../test/resources/MessageGenerator.jsm */
+load("../../../../resources/MessageGenerator.jsm");
var gMessages = [];
const kSetCount = 13;
const kNumExpectedMatches = 10;
function setupGlobals() {
localAccountUtils.loadLocalMailAccount();
--- a/mailnews/db/msgdb/test/unit/test_maildb.js
+++ b/mailnews/db/msgdb/test/unit/test_maildb.js
@@ -1,15 +1,15 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test suite for msg database functions.
*/
-/* import-globals-from ../../../../test/resources/messageGenerator.js */
-load("../../../../resources/messageGenerator.js");
+/* import-globals-from ../../../../test/resources/MessageGenerator.jsm */
+load("../../../../resources/MessageGenerator.jsm");
var dbService;
var gTestFolder;
var gCurTestNum = 0;
var kNumTestMessages = 10;
var gTestArray = [
function test_db_open() {
--- a/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
+++ b/mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js
@@ -1,20 +1,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
function getSpec(aFileName) {
--- a/mailnews/extensions/mdn/test/unit/head_mdn.js
+++ b/mailnews/extensions/mdn/test/unit/head_mdn.js
@@ -1,17 +1,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var CC = Components.Constructor;
// Ensure the profile directory is set up
do_get_profile();
registerCleanupFunction(function() {
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -1,17 +1,17 @@
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
this.EXPORTED_SYMBOLS = ["Feed", "FeedItem", "FeedParser", "FeedUtils"];
/* eslint-disable-next-line no-unused-vars */
-const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/log4moz.js");
+const { Log4Moz } = ChromeUtils.import("resource:///modules/gloda/Log4moz.jsm");
const { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
const { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
const { jsmime } = ChromeUtils.import("resource:///modules/jsmime.jsm");
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
--- a/mailnews/extensions/newsblog/content/newsblogOverlay.js
+++ b/mailnews/extensions/newsblog/content/newsblogOverlay.js
@@ -1,16 +1,16 @@
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// This global is for SeaMonkey compatibility.
var gShowFeedSummary;
--- a/mailnews/extensions/newsblog/test/unit/head_feeds.js
+++ b/mailnews/extensions/newsblog/test/unit/head_feeds.js
@@ -1,20 +1,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
let { Feed, FeedItem, FeedParser, FeedUtils } = ChromeUtils.import(
"resource:///modules/FeedUtils.jsm"
);
let { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
// Set up local web server to serve up test files.
--- a/mailnews/imap/test/unit/head_server.js
+++ b/mailnews/imap/test/unit/head_server.js
@@ -7,23 +7,23 @@ if (typeof gDEPTH == "undefined") {
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
- "resource://testing-common/mailnews/IMAPpump.js"
+ "resource://testing-common/mailnews/IMAPpump.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
var CC = Components.Constructor;
// WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
@@ -38,22 +38,22 @@ do_get_profile();
// Import fakeserver
var {
nsMailServer,
gThreadManager,
fsDebugNone,
fsDebugAll,
fsDebugRecv,
fsDebugRecvSend,
-} = ChromeUtils.import("resource://testing-common/mailnews/maild.js");
+} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var imapd = {};
-ChromeUtils.import("resource://testing-common/mailnews/imapd.js", imapd);
+ChromeUtils.import("resource://testing-common/mailnews/Imapd.jsm", imapd);
var { imapDaemon, imapMessage } = imapd;
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
- "resource://testing-common/mailnews/auth.js"
+ "resource://testing-common/mailnews/Auth.jsm"
);
function makeServer(daemon, infoString, otherProps) {
if (infoString in imapd.configurations) {
return makeServer(
daemon,
imapd.configurations[infoString].join(","),
otherProps
--- a/mailnews/imap/test/unit/test_autosync_date_constraints.js
+++ b/mailnews/imap/test/unit/test_autosync_date_constraints.js
@@ -1,19 +1,19 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test autosync date constraints
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gMsgImapInboxFolder;
// Adds some messages directly to a mailbox (eg new mail)
function addMessagesToServer(messages, mailbox) {
// Create the imapMessages and store them on the mailbox
messages.forEach(function(message) {
let dataUri = "data:text/plain," + message.toMessageString();
--- a/mailnews/imap/test/unit/test_compactOfflineStore.js
+++ b/mailnews/imap/test/unit/test_compactOfflineStore.js
@@ -6,21 +6,21 @@
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/alertTestUtils.js");
// Globals
var gRootFolder;
var gImapInboxOfflineStoreSize;
var gMsgFile1 = do_get_file("../../../data/bugmail10");
var gMsgFile2 = do_get_file("../../../data/bugmail11");
--- a/mailnews/imap/test/unit/test_converterImap.js
+++ b/mailnews/imap/test/unit/test_converterImap.js
@@ -10,21 +10,21 @@ var { Log } = ChromeUtils.import("resour
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/alertTestUtils.js");
var log = Log.repository.getLogger("MailStoreConverter");
var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
// Globals
var gMsgFile1 = do_get_file("../../../data/bugmail10");
--- a/mailnews/imap/test/unit/test_copyThenMove.js
+++ b/mailnews/imap/test/unit/test_copyThenMove.js
@@ -1,19 +1,19 @@
// This file extends test_imapFolderCopy.js to test message
// moves from a local folder to an IMAP folder.
//
// Original Author: Kent James <kent@caspia.com>
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var gEmptyLocal1, gEmptyLocal2;
var gLastKey;
var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
--- a/mailnews/imap/test/unit/test_dontStatNoSelect.js
+++ b/mailnews/imap/test/unit/test_dontStatNoSelect.js
@@ -1,18 +1,18 @@
// This file tests that checking folders for new mail with STATUS
// doesn't try to STAT noselect folders.
var gServer, gImapServer;
var gIMAPInbox;
var gFolder2Mailbox;
var gFolder1, gFolder2;
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
// async support
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
--- a/mailnews/imap/test/unit/test_downloadOffline.js
+++ b/mailnews/imap/test/unit/test_downloadOffline.js
@@ -1,18 +1,18 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test to ensure that downloadAllForOffline works correctly with imap folders
* and returns success.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gFileName = "bug460636";
var gMsgFile = do_get_file("../../../data/" + gFileName);
var tests = [setup, downloadAllForOffline, verifyDownloaded, teardownIMAPPump];
async function setup() {
setupIMAPPump();
--- a/mailnews/imap/test/unit/test_filterCustomHeaders.js
+++ b/mailnews/imap/test/unit/test_filterCustomHeaders.js
@@ -10,16 +10,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
// IMAP pump
+var { IMAPPump, setupIMAPPump, teardownIMAPPump } = ChromeUtils.import(
+ "resource://testing-common/mailnews/IMAPpump.jsm"
+);
+
setupIMAPPump();
// Definition of tests
var tests = [setupTest, checkFilterResults, endTest];
function run_test() {
// Create a test filter.
--- a/mailnews/imap/test/unit/test_imapAttachmentSaves.js
+++ b/mailnews/imap/test/unit/test_imapAttachmentSaves.js
@@ -3,24 +3,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Tests imap save and detach attachments.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// javascript mime emitter functions
var mimeMsg = {};
-ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
+ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm", mimeMsg);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// IMAP pump
var kAttachFileName = "bob.txt";
--- a/mailnews/imap/test/unit/test_imapAutoSync.js
+++ b/mailnews/imap/test/unit/test_imapAutoSync.js
@@ -20,19 +20,19 @@
// IMAP pump
/* import-globals-from ../../../test/resources/logHelper.js */
load("../../../resources/logHelper.js");
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/asyncTestUtils.js");
/* import-globals-from ../../../test/resources/alertTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/alertTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// Globals
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
setupIMAPPump();
--- a/mailnews/imap/test/unit/test_imapChunks.js
+++ b/mailnews/imap/test/unit/test_imapChunks.js
@@ -1,14 +1,14 @@
/*
* Test bug 92111 - imap download-by-chunks doesn't download complete file if the
* server lies about rfc822.size (known to happen for Exchange and gmail)
*/
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var gIMAPDaemon, gServer, gIMAPIncomingServer, gSavedMsgFile;
var gIMAPService = Cc[
"@mozilla.org/messenger/messageservice;1?type=imap"
].getService(Ci.nsIMsgMessageService);
var gFileName = "bug92111";
--- a/mailnews/imap/test/unit/test_imapCopyTimeout.js
+++ b/mailnews/imap/test/unit/test_imapCopyTimeout.js
@@ -6,21 +6,21 @@
// an imap message. The move is done as an offline operation and then
// played back, to copy what the apps do.
Services.prefs.setIntPref("mailnews.tcptimeout", 2);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// IMAP pump
// Globals
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
--- a/mailnews/imap/test/unit/test_imapFlagChange.js
+++ b/mailnews/imap/test/unit/test_imapFlagChange.js
@@ -1,20 +1,20 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test to ensure that imap flag changes made from a different profile/machine
* are stored in db.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gMessage;
var gSecondFolder;
var gSynthMessage;
var tests = [
setup,
function* switchAwayFromInbox() {
--- a/mailnews/imap/test/unit/test_imapFolderCopy.js
+++ b/mailnews/imap/test/unit/test_imapFolderCopy.js
@@ -1,18 +1,18 @@
// This file tests the folder copying with IMAP. In particular, we're
// going to test copying local folders to imap servers, but other tests
// could be added.
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gEmptyLocal1, gEmptyLocal2, gEmptyLocal3, gNotEmptyLocal4;
var { toXPCOMArray } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
--- a/mailnews/imap/test/unit/test_imapHdrChunking.js
+++ b/mailnews/imap/test/unit/test_imapHdrChunking.js
@@ -3,20 +3,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Tests imap msg header download chunking
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// javascript mime emitter functions
// IMAP pump
--- a/mailnews/imap/test/unit/test_imapHdrStreaming.js
+++ b/mailnews/imap/test/unit/test_imapHdrStreaming.js
@@ -5,20 +5,20 @@
* because that's not implemented yet, and it's unclear if anyone will want it.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
// IMAP pump
setupIMAPPump();
var gMsgFile1 = do_get_file("../../../data/bugmail10");
--- a/mailnews/imap/test/unit/test_imapHighWater.js
+++ b/mailnews/imap/test/unit/test_imapHighWater.js
@@ -6,21 +6,21 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/alertTestUtils.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gIMAPDaemon, gServer, gIMAPIncomingServer;
var gIMAPInbox;
var gFolder1, gRootFolder;
// Adds some messages directly to a mailbox (eg new mail)
function addMessagesToServer(messages, mailbox) {
--- a/mailnews/imap/test/unit/test_imapMove.js
+++ b/mailnews/imap/test/unit/test_imapMove.js
@@ -5,19 +5,19 @@
// This tests that we use IMAP move if the IMAP server supports it.
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/* import-globals-from ../../../test/resources/logHelper.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gFolder1;
var tests = [setupCUSTOM1, startTest, doMove, testMove, teardownIMAPPump];
function setupCUSTOM1() {
setupIMAPPump("CUSTOM1");
Services.prefs.setBoolPref(
--- a/mailnews/imap/test/unit/test_imapProxy.js
+++ b/mailnews/imap/test/unit/test_imapProxy.js
@@ -3,18 +3,18 @@
// Test that IMAP over a SOCKS proxy works.
var { NetworkTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/NetworkTestUtils.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var server, daemon, incomingServer;
const PORT = 143;
add_task(async function setup() {
// Disable new mail notifications
Services.prefs.setBoolPref("mail.biff.play_sound", false);
--- a/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
+++ b/mailnews/imap/test/unit/test_imapStoreMsgOffline.js
@@ -8,20 +8,20 @@
* - Message with mix of attachment types.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessageGenerator = new MessageGenerator();
var gMsgFile1 = do_get_file("../../../data/bugmail10");
var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
var gMsgFile2 = do_get_file("../../../data/image-attach-test");
--- a/mailnews/imap/test/unit/test_largeOfflineStore.js
+++ b/mailnews/imap/test/unit/test_largeOfflineStore.js
@@ -1,20 +1,20 @@
/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test to ensure that downloadAllForOffline works correctly for large imap
* stores, i.e., over 4 GiB.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
var gOfflineStoreSize;
--- a/mailnews/imap/test/unit/test_listClosesDB.js
+++ b/mailnews/imap/test/unit/test_listClosesDB.js
@@ -1,17 +1,17 @@
// This file tests that listing folders on startup because we're not using
// subscription doesn't leave db's open.
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gSub3;
var tests = [setup, updateInbox, checkCachedDBForFolder, teardown];
function* setup() {
setupIMAPPump();
--- a/mailnews/imap/test/unit/test_mailboxes.js
+++ b/mailnews/imap/test/unit/test_mailboxes.js
@@ -1,18 +1,18 @@
/**
* Tests basic mailbox handling of IMAP, like discovery, rename and empty folder.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// The following folder names are not pure ASCII and will be MUTF-7 encoded.
const folderName1 = "I18N box\u00E1"; // I18N boxá
const folderName2 = "test \u00E4"; // test ä
function* setup() {
setupIMAPPump();
--- a/mailnews/imap/test/unit/test_offlinePlayback.js
+++ b/mailnews/imap/test/unit/test_offlinePlayback.js
@@ -6,30 +6,30 @@
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var gSecondFolder, gThirdFolder;
var gSynthMessage1, gSynthMessage2;
// the message id of bugmail10
var gMsgId1 = "200806061706.m56H6RWT004933@mrapp54.mozilla.org";
var gOfflineManager;
var tests = [
setupIMAPPump,
function serverParms() {
var { fsDebugAll } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
IMAPPump.server.setDebugLevel(fsDebugAll);
},
setup,
function prepareToGoOffline() {
let rootFolder = IMAPPump.incomingServer.rootFolder;
gSecondFolder = rootFolder
--- a/mailnews/imap/test/unit/test_offlineStoreLocking.js
+++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js
@@ -1,21 +1,21 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test to ensure that code that writes to the imap offline store deals
* with offline store locking correctly.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/alertTestUtils.js");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
// Globals
var gIMAPTrashFolder, gMsgImapInboxFolder;
--- a/mailnews/imap/test/unit/test_partsOnDemand.js
+++ b/mailnews/imap/test/unit/test_partsOnDemand.js
@@ -6,24 +6,24 @@
* Tests that you can stream a message without the attachments. Tests the
* MsgHdrToMimeMessage API that exposes this.
*/
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
Services.prefs.setIntPref("mail.imap.mime_parts_on_demand_threshold", 1000);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// javascript mime emitter functions
var mimeMsg = {};
-ChromeUtils.import("resource:///modules/gloda/mimemsg.js", mimeMsg);
+ChromeUtils.import("resource:///modules/gloda/MimeMessage.jsm", mimeMsg);
var gSecondMsg;
// IMAP pump
setupIMAPPump();
var tests = [
--- a/mailnews/imap/test/unit/test_saveTemplate.js
+++ b/mailnews/imap/test/unit/test_saveTemplate.js
@@ -10,20 +10,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
// IMAP pump
setupIMAPPump();
var tests = [loadImapMessage, saveAsTemplate, endTest];
// load and update a message in the imap fake server
--- a/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
+++ b/mailnews/imap/test/unit/test_stopMovingToLocalFolder.js
@@ -7,20 +7,20 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
setupIMAPPump();
function stop_server() {
IMAPPump.incomingServer.closeCachedConnections();
IMAPPump.server.stop();
let thread = gThreadManager.currentThread;
while (thread.hasPendingEvents()) {
--- a/mailnews/imap/test/unit/test_syncChanges.js
+++ b/mailnews/imap/test/unit/test_syncChanges.js
@@ -2,20 +2,20 @@
/*
* Test to ensure that changes made from a different profile/machine
* are synced correctly. In particular, we're checking that emptying out
* an imap folder on the server makes us delete all the headers from our db.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
var gMessage;
var gSecondFolder;
var gSynthMessage;
var tests = [
setup,
function* switchAwayFromInbox() {
--- a/mailnews/import/test/unit/resources/mock_windows_reg_factory.js
+++ b/mailnews/import/test/unit/resources/mock_windows_reg_factory.js
@@ -1,10 +1,10 @@
const { MockFactory } = ChromeUtils.import(
- "resource://testing-common/mailnews/MockFactory.js"
+ "resource://testing-common/mailnews/MockFactory.jsm"
);
var gUuid;
function MockWindowsRegKey(registryData) {
this._registryData = registryData;
}
--- a/mailnews/import/test/unit/test_becky_filters.js
+++ b/mailnews/import/test/unit/test_becky_filters.js
@@ -1,10 +1,10 @@
const { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
function run_test() {
localAccountUtils.loadLocalMailAccount();
// Due to the import code using nsIAbManager off the main thread, we need
// to ensure that it is initialized before we start the main test.
MailServices.ab;
--- a/mailnews/jsaccount/test/unit/head_jsaccount.js
+++ b/mailnews/jsaccount/test/unit/head_jsaccount.js
@@ -8,20 +8,20 @@ var CC = Components.Constructor;
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
// Load the test components.
do_load_manifest("resources/testComponents.manifest");
// Ensure the profile directory is set up.
do_get_profile();
registerCleanupFunction(function() {
--- a/mailnews/local/test/unit/head_maillocal.js
+++ b/mailnews/local/test/unit/head_maillocal.js
@@ -1,56 +1,56 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var test = null;
// WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
var { getAppInfo, newAppInfo, updateAppInfo } = ChromeUtils.import(
"resource://testing-common/AppInfo.jsm"
);
updateAppInfo();
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../";
// Import the pop3 server scripts
-/* import-globals-from ../../../test/fakeserver/maild.js */
-/* import-globals-from ../../../test/fakeserver/auth.js */
-/* import-globals-from ../../../test/fakeserver/pop3d.js */
+/* import-globals-from ../../../test/fakeserver/Maild.jsm */
+/* import-globals-from ../../../test/fakeserver/Auth.jsm */
+/* import-globals-from ../../../test/fakeserver/Pop3d.jsm */
var {
nsMailServer,
gThreadManager,
fsDebugNone,
fsDebugAll,
fsDebugRecv,
fsDebugRecvSend,
-} = ChromeUtils.import("resource://testing-common/mailnews/maild.js");
+} = ChromeUtils.import("resource://testing-common/mailnews/Maild.jsm");
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
- "resource://testing-common/mailnews/auth.js"
+ "resource://testing-common/mailnews/Auth.jsm"
);
var {
pop3Daemon,
POP3_RFC1939_handler,
POP3_RFC2449_handler,
POP3_RFC5034_handler,
-} = ChromeUtils.import("resource://testing-common/mailnews/pop3d.js");
+} = ChromeUtils.import("resource://testing-common/mailnews/Pop3d.jsm");
// 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 extraProps = {};
function createHandler(d) {
var handler = new POP3_RFC5034_handler(d);
--- a/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
+++ b/mailnews/local/test/unit/test_nsIMsgLocalMailFolder.js
@@ -1,15 +1,15 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* Test suite for local folder functions.
*/
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var { toXPCOMArray } = ChromeUtils.import(
"resource:///modules/iteratorUtils.jsm"
);
/**
* Bug 66763
* Test deletion of a folder with a name already existing in Trash.
--- a/mailnews/local/test/unit/test_nsIMsgParseMailMsgState.js
+++ b/mailnews/local/test/unit/test_nsIMsgParseMailMsgState.js
@@ -1,13 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var MSG_LINEBREAK = "\r\n";
function run_test() {
localAccountUtils.loadLocalMailAccount();
test_parse_headers_without_crash("./data/mailformed_recipients.eml");
test_parse_headers_without_crash("./data/mailformed_subject.eml");
--- a/mailnews/local/test/unit/test_over2GBMailboxes.js
+++ b/mailnews/local/test/unit/test_over2GBMailboxes.js
@@ -1,14 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* Test of accessing over 2 GiB local folder. */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
-load("../../../resources/messageGenerator.js");
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
+load("../../../resources/MessageGenerator.jsm");
var bugmail10 = do_get_file("../../../data/bugmail10");
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
var gLocalInboxSize;
--- a/mailnews/local/test/unit/test_over4GBMailboxes.js
+++ b/mailnews/local/test/unit/test_over4GBMailboxes.js
@@ -18,21 +18,21 @@
* - compactOver4GiB
* - CompactListener_compactOver4GiB
* - compactUnder4GiB
* - CompactListener_compactUnder4GiB
*/
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/POP3pump.js */
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/POP3pump.js");
Services.prefs.setCharPref(
"mail.serverDefaultStoreContractID",
"@mozilla.org/msgstore/berkeleystore;1"
);
// If we're running out of memory parsing the folder, lowering the
--- a/mailnews/local/test/unit/test_pop3PasswordFailure.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure.js
@@ -7,22 +7,22 @@
* - Check cancel does what it should do.
* - Re-initiate connection, this time select enter new password, check that
* we get a new password prompt and can enter the password.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
/* import-globals-from ../../../test/resources/passwordStorage.js */
-/* import-globals-from ../../../test/resources/mailTestUtils.js */
+/* import-globals-from ../../../test/resources/MailTestUtils.jsm */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/alertTestUtils.js");
load("../../../resources/passwordStorage.js");
-load("../../../resources/mailTestUtils.js");
+load("../../../resources/MailTestUtils.jsm");
load("../../../resources/asyncTestUtils.js");
var server;
var daemon;
var incomingServer;
var attempt = 0;
var kUserName = "testpop3";
--- a/mailnews/local/test/unit/test_pop3PasswordFailure2.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure2.js
@@ -8,22 +8,22 @@
* - Re-initiate connection, this time select enter new password, check that
* we get a new password prompt and can enter the password.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
/* import-globals-from ../../../test/resources/passwordStorage.js */
-/* import-globals-from ../../../test/resources/mailTestUtils.js */
+/* import-globals-from ../../../test/resources/MailTestUtils.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
load("../../../resources/passwordStorage.js");
-load("../../../resources/mailTestUtils.js");
+load("../../../resources/MailTestUtils.jsm");
var server;
var daemon;
var incomingServer;
var attempt = 0;
var logins;
var kUserName = "testpop3";
--- a/mailnews/local/test/unit/test_pop3PasswordFailure3.js
+++ b/mailnews/local/test/unit/test_pop3PasswordFailure3.js
@@ -10,22 +10,22 @@
* - Re-initiate connection, this time select enter new password, check that
* we get a new password prompt and can enter the password.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
/* import-globals-from ../../../test/resources/passwordStorage.js */
-/* import-globals-from ../../../test/resources/mailTestUtils.js */
+/* import-globals-from ../../../test/resources/MailTestUtils.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
load("../../../resources/passwordStorage.js");
-load("../../../resources/mailTestUtils.js");
+load("../../../resources/MailTestUtils.jsm");
var server;
var daemon;
var incomingServer;
var attempt = 0;
var logins;
var kUserName = "testpop3";
--- a/mailnews/local/test/unit/test_pop3ServerBrokenCRAMFail.js
+++ b/mailnews/local/test/unit/test_pop3ServerBrokenCRAMFail.js
@@ -11,17 +11,17 @@ test = "Server which advertises CRAM-MD5
var expectedTransaction = [
"AUTH",
"CAPA",
"AUTH CRAM-MD5",
"AUTH PLAIN",
"STAT",
];
-const kStateAuthNeeded = 1; // the same value as in pop3d.js
+const kStateAuthNeeded = 1; // the same value as in Pop3d.jsm
var urlListener = {
OnStartRunningUrl(url) {},
OnStopRunningUrl(url, result) {
try {
Assert.equal(result, 0);
var transaction = server.playTransaction();
--- a/mailnews/local/test/unit/test_saveMessage.js
+++ b/mailnews/local/test/unit/test_saveMessage.js
@@ -1,13 +1,13 @@
/*
* Test bug 460636 - Saving message in local folder as .EML removes starting dot in all lines, and ignores line if single dot only line.
*/
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var MSG_LINEBREAK = "\r\n";
var dot = do_get_file("data/dot");
var saveFile = Services.dirsvc.get("TmpD", Ci.nsIFile);
saveFile.append(dot.leafName + ".eml");
saveFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
function run_test() {
--- a/mailnews/local/test/unit/test_undoDelete.js
+++ b/mailnews/local/test/unit/test_undoDelete.js
@@ -7,21 +7,21 @@ var gMsg1;
var gMessages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
var gMsgWindow;
var gCurTestNum;
var gMsgId1;
var gTestFolder;
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/messageModifier.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/asyncTestUtils.js");
load("../../../resources/messageModifier.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageInjection.js");
var gTestArray = [
function deleteMessage() {
let msgToDelete = mailTestUtils.firstMsgHdr(gTestFolder);
gMsgId1 = msgToDelete.messageId;
gMessages.appendElement(msgToDelete);
gTestFolder.deleteMessages(
--- a/mailnews/mapi/test/unit/head_mapi.js
+++ b/mailnews/mapi/test/unit/head_mapi.js
@@ -3,28 +3,28 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { ctypes } = ChromeUtils.import("resource:///modules/ctypes.jsm");
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
// Ensure the profile directory is set up.
do_get_profile();
// Import fakeserver
var { nsMailServer } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
var { smtpDaemon, SMTP_RFC2821_handler } = ChromeUtils.import(
- "resource://testing-common/mailnews/smtpd.js"
+ "resource://testing-common/mailnews/Smtpd.jsm"
);
var SMTP_PORT = 1024 + 120;
var POP3_PORT = 1024 + 121;
// Setup the daemon and server
function setupServerDaemon(handler) {
if (!handler) {
--- a/mailnews/mime/test/unit/head_mime.js
+++ b/mailnews/mime/test/unit/head_mime.js
@@ -9,17 +9,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { mailTestUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/mailTestUtils.js"
+ "resource://testing-common/mailnews/MailTestUtils.jsm"
);
var { PromiseTestUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/PromiseTestUtils.jsm"
);
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
var CC = Components.Constructor;
--- a/mailnews/mime/test/unit/test_alternate_p7m_handling.js
+++ b/mailnews/mime/test/unit/test_alternate_p7m_handling.js
@@ -1,22 +1,22 @@
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var { MsgHdrToMimeMessage } = ChromeUtils.import(
- "resource:///modules/gloda/mimemsg.js"
+ "resource:///modules/gloda/MimeMessage.jsm"
);
// Create a message generator
var gMessageGenerator = new MessageGenerator();
var p7mAttachment = "dGhpcyBpcyBub3QgYSByZWFsIHMvbWltZSBwN20gZW50aXR5";
// create a message with a p7m attachment
--- a/mailnews/mime/test/unit/test_attachment_size.js
+++ b/mailnews/mime/test/unit/test_attachment_size.js
@@ -3,23 +3,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This test creates some messages with attachments of different types and
* checks that libmime reports the expected size for each of them.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
// Somehow we hit the blocklist service, and that needs appInfo defined
const { updateAppInfo } = ChromeUtils.import(
"resource://testing-common/AppInfo.jsm"
);
updateAppInfo();
--- a/mailnews/mime/test/unit/test_badContentType.js
+++ b/mailnews/mime/test/unit/test_badContentType.js
@@ -7,20 +7,20 @@
* type reported in bug 659355.
* Adapted from test_attachment_size.js
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Create a message generator
var gMessageGenerator = new MessageGenerator();
--- a/mailnews/mime/test/unit/test_hidden_attachments.js
+++ b/mailnews/mime/test/unit/test_hidden_attachments.js
@@ -3,23 +3,23 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This test creates some messages with attachments of different types and
* checks that libmime emits (or doesn't emit) the attachments as appropriate.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Create a message generator
var gMessageGenerator = new MessageGenerator();
--- a/mailnews/mime/test/unit/test_message_attachment.js
+++ b/mailnews/mime/test/unit/test_message_attachment.js
@@ -5,20 +5,20 @@
/**
* This test verifies that we generate proper attachment filenames.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Create a message generator
var msgGen = (gMessageGenerator = new MessageGenerator());
--- a/mailnews/mime/test/unit/test_mimeStreaming.js
+++ b/mailnews/mime/test/unit/test_mimeStreaming.js
@@ -2,19 +2,19 @@
* 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/. */
/**
* This test iterates over the test files in gTestFiles, and streams
* each as a message and makes sure the streaming doesn't assert or crash.
*/
const { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
var gTestFiles = ["../../../data/bug505221", "../../../data/bug513543"];
var gMsgEnumerator;
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
var gUrlListener = {
--- a/mailnews/mime/test/unit/test_parser.js
+++ b/mailnews/mime/test/unit/test_parser.js
@@ -3,17 +3,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This file is used to test the mime parser implemented in JS, mostly by means
// of creating custom emitters and verifying that the methods on that emitter
// are called in the correct order. This also tests that the various
// HeaderParser methods are run correctly.
const { MimeParser } = ChromeUtils.import("resource:///modules/mimeParser.jsm");
-var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.jsm");
// Utility method to compare objects
function compare_objects(real, expected) {
// real is a Map; convert it into an object for uneval purposes
if (typeof real == "object") {
var newreal = {};
for (let [k, v] of real) {
newreal[k] = v;
--- a/mailnews/mime/test/unit/test_rfc822_body.js
+++ b/mailnews/mime/test/unit/test_rfc822_body.js
@@ -3,23 +3,23 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This test verifies that we emit a message/rfc822 body part as an attachment
* whether or not mail.inline_attachments is true.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Create a message generator
var msgGen = (gMessageGenerator = new MessageGenerator());
--- a/mailnews/mime/test/unit/test_smime_decrypt.js
+++ b/mailnews/mime/test/unit/test_smime_decrypt.js
@@ -18,20 +18,20 @@ var { SmimeUtils } = ChromeUtils.import(
"resource://testing-common/mailnews/smimeUtils.jsm"
);
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
let gCertValidityResult = 0;
/**
* @implements nsICertVerificationCallback
*/
--- a/mailnews/mime/test/unit/test_text_attachment.js
+++ b/mailnews/mime/test/unit/test_text_attachment.js
@@ -3,23 +3,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* This test verifies that we don't display text attachments inline
* when mail.inline_attachments is false.
*/
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
-/* import-globals-from ../../../test/resources/messageGenerator.js */
+/* import-globals-from ../../../test/resources/MessageGenerator.jsm */
/* import-globals-from ../../../test/resources/messageModifier.js */
/* import-globals-from ../../../test/resources/messageInjection.js */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
-load("../../../resources/messageGenerator.js");
+load("../../../resources/MessageGenerator.jsm");
load("../../../resources/messageModifier.js");
load("../../../resources/messageInjection.js");
var gMessenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
// Create a message generator
var gMessageGenerator = new MessageGenerator();
--- a/mailnews/moz.build
+++ b/mailnews/moz.build
@@ -63,27 +63,27 @@ if CONFIG['MOZ_MOVEMAIL'] and not (
DEFINES['MOZ_MOVEMAIL'] = True
DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
JAR_MANIFESTS += ['jar.mn']
TESTING_JS_MODULES.mailnews += [
- 'test/fakeserver/auth.js',
- 'test/fakeserver/imapd.js',
- 'test/fakeserver/maild.js',
- 'test/fakeserver/nntpd.js',
- 'test/fakeserver/pop3d.js',
- 'test/fakeserver/smtpd.js',
- 'test/resources/IMAPpump.js',
- 'test/resources/localAccountUtils.js',
- 'test/resources/mailTestUtils.js',
- 'test/resources/messageGenerator.js',
- 'test/resources/MockFactory.js',
+ 'test/fakeserver/Auth.jsm',
+ 'test/fakeserver/Imapd.jsm',
+ 'test/fakeserver/Maild.jsm',
+ 'test/fakeserver/Nntpd.jsm',
+ 'test/fakeserver/Pop3d.jsm',
+ 'test/fakeserver/Smtpd.jsm',
+ 'test/resources/IMAPpump.jsm',
+ 'test/resources/LocalAccountUtils.jsm',
+ 'test/resources/MailTestUtils.jsm',
+ 'test/resources/MessageGenerator.jsm',
+ 'test/resources/MockFactory.jsm',
'test/resources/NetworkTestUtils.jsm',
'test/resources/PromiseTestUtils.jsm',
'test/resources/smimeUtils.jsm',
]
if 'comm' in CONFIG['MOZ_BUILD_APP']:
test_harness_base = TEST_HARNESS_FILES.xpcshell.comm
else:
--- a/mailnews/news/test/unit/head_server_setup.js
+++ b/mailnews/news/test/unit/head_server_setup.js
@@ -1,17 +1,17 @@
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
var { localAccountUtils } = ChromeUtils.import(
- "resource://testing-common/mailnews/localAccountUtils.js"
+ "resource://testing-common/mailnews/LocalAccountUtils.jsm"
);
var test = null;
// WebApps.jsm called by ProxyAutoConfig (PAC) requires a valid nsIXULAppInfo.
var { getAppInfo, newAppInfo, updateAppInfo } = ChromeUtils.import(
"resource://testing-common/AppInfo.jsm"
);
@@ -19,26 +19,26 @@ updateAppInfo();
// Ensure the profile directory is set up
do_get_profile();
var gDEPTH = "../../../../";
// Import the servers
var { fsDebugAll, gThreadManager, nsMailServer } = ChromeUtils.import(
- "resource://testing-common/mailnews/maild.js"
+ "resource://testing-common/mailnews/Maild.jsm"
);
var {
newsArticle,
NNTP_Giganews_handler,
NNTP_RFC2980_handler,
NNTP_RFC4643_extension,
NNTP_RFC977_handler,
nntpDaemon,
-} = ChromeUtils.import("resource://testing-common/mailnews/nntpd.js");
+} = ChromeUtils.import("resource://testing-common/mailnews/Nntpd.jsm");
var kSimpleNewsArticle =
"From: John Doe <john.doe@example.com>\n" +
"Date: Sat, 24 Mar 1990 10:59:24 -0500\n" +
"Newsgroups: test.subscribe.simple\n" +
"Subject: H2G2 -- What does it mean?\n" +
"Message-ID: <TSS1@nntp.invalid>\n" +
"\n" +
--- a/mailnews/news/test/unit/test_bug540288.js
+++ b/mailnews/news/test/unit/test_bug540288.js
@@ -1,12 +1,12 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* Tests that an empty cache entry doesn't return an empty message for news. */
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
var server;
var localserver;
var streamListener = {
_data: "",
--- a/mailnews/news/test/unit/test_getNewsMessage.js
+++ b/mailnews/news/test/unit/test_getNewsMessage.js
@@ -5,17 +5,17 @@
* - DisplayMessage for a newsgroup message
* - Downloading a single message and checking content in stream is correct.
*/
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
var server;
var localserver;
var streamListener = {
_data: "",
--- a/mailnews/news/test/unit/test_nntpContentLength.js
+++ b/mailnews/news/test/unit/test_nntpContentLength.js
@@ -6,17 +6,17 @@
*
* ***** END LICENSE BLOCK ***** */
/*
* Test content length for the news protocol. This focuses on necko URLs
* that are run externally.
*/
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
var server;
var localserver;
function run_test() {
server = makeServer(NNTP_RFC977_handler, daemon);
server.start();
--- a/mailnews/news/test/unit/test_nntpGroupPassword.js
+++ b/mailnews/news/test/unit/test_nntpGroupPassword.js
@@ -1,14 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
* Authentication tests for NNTP (based on RFC4643).
*/
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
add_task(async function() {
await Services.logins.initializationPromise;
daemon.groupCredentials = {
"test.subscribe.empty": ["group1", "pass1"],
"test.filter": ["group2", "pass2"],
--- a/mailnews/news/test/unit/test_nntpPassword.js
+++ b/mailnews/news/test/unit/test_nntpPassword.js
@@ -4,17 +4,17 @@
*
* Note: Logins for newsgroup servers for 1.8 were stored with either the
* default port or the SSL default port. Nothing else!
*/
/* import-globals-from ../../../test/resources/passwordStorage.js */
load("../../../resources/passwordStorage.js");
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
add_task(async function() {
// Prepare files for passwords (generated by a script in bug 1018624).
await setupForPassword("signons-mailnews1.8.json");
var server = makeServer(NNTP_RFC4643_extension, daemon);
server.start();
--- a/mailnews/news/test/unit/test_nntpPassword2.js
+++ b/mailnews/news/test/unit/test_nntpPassword2.js
@@ -9,17 +9,17 @@
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
/* import-globals-from ../../../test/resources/passwordStorage.js */
load("../../../resources/passwordStorage.js");
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
add_task(async function() {
let server = makeServer(NNTP_RFC4643_extension, daemon);
server.start();
// These preferences set up a local news server that has had its hostname
// and username changed from the original settings. We can't do this by
--- a/mailnews/news/test/unit/test_nntpPasswordFailure.js
+++ b/mailnews/news/test/unit/test_nntpPasswordFailure.js
@@ -9,22 +9,22 @@
* we get a new password prompt and can enter the password.
*/
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
/* import-globals-from ../../../test/resources/logHelper.js */
/* import-globals-from ../../../test/resources/asyncTestUtils.js */
/* import-globals-from ../../../test/resources/alertTestUtils.js */
/* import-globals-from ../../../test/resources/passwordStorage.js */
-/* import-globals-from ../../../test/resources/mailTestUtils.js */
+/* import-globals-from ../../../test/resources/MailTestUtils.jsm */
load("../../../resources/logHelper.js");
load("../../../resources/asyncTestUtils.js");
load("../../../resources/alertTestUtils.js");
load("../../../resources/passwordStorage.js");
-load("../../../resources/mailTestUtils.js");
+load("../../../resources/MailTestUtils.jsm");
var server;
var daemon;
var incomingServer;
var folder;
var attempt = 0;
var logins;
--- a/mailnews/news/test/unit/test_server.js
+++ b/mailnews/news/test/unit/test_server.js
@@ -1,22 +1,22 @@
// Protocol tests for NNTP. These actually aren't too important, but their main
// purpose is to make sure that maild is working properly and to provide
-// examples for how using maild. They also help make sure that I coded nntpd.js
+// examples for how using maild. They also help make sure that I coded Nntpd.jsm
// right, both logically and for RFC compliance.
// TODO:
// * We need to hook up mochitest,
// * TLS negotiation.
-// The basic daemon to use for testing nntpd.js implementations
+// The basic daemon to use for testing Nntpd.jsm implementations
var daemon = setupNNTPDaemon();
// NNTP SERVER TESTS
// -----------------
-// Functions in order as defined in nntpd.js. Each function tests the URLs
+// Functions in order as defined in Nntpd.jsm. Each function tests the URLs
// that are located over the implementation of nsNNTPProtocol::LoadURL and
// added in bug 400331. Furthermore, they are tested in rough order as they
// would be expected to be used in a session. If more URL types are modified,
// please add a corresponding type to the following tests.
// When adding new servers, only test the commands that become different for
// each specified server, to keep down redudant tests.
function testRFC977() {
rename from mailnews/test/fakeserver/auth.js
rename to mailnews/test/fakeserver/Auth.jsm
rename from mailnews/test/fakeserver/imapd.js
rename to mailnews/test/fakeserver/Imapd.jsm
--- a/mailnews/test/fakeserver/imapd.js
+++ b/mailnews/test/fakeserver/Imapd.jsm
@@ -59,17 +59,17 @@ var EXPORTED_SYMBOLS = [
// + Synchronization: On certain synchronizing commands, the daemon will call
// | a synchronizing function to allow manipulating code the chance to
// | perform various (potentially expensive) actions.
// + Messages: A message is represented internally as an annotated URI.
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { MimeParser } = ChromeUtils.import("resource:///modules/mimeParser.jsm");
var { AuthPLAIN, AuthLOGIN, AuthCRAM } = ChromeUtils.import(
- "resource://testing-common/mailnews/auth.js"
+ "resource://testing-common/mailnews/Auth.jsm"
);
function imapDaemon(flags, syncFunc) {
this._flags = flags;
this.namespaces = [];
this.idResponse = "NIL";
this.root = new imapMailbox("", null, { type: IMAP_NAMESPACE_PERSONAL });
@@ -487,39 +487,37 @@ imapMessage.prototype = {
var mimePartNum = this._partMap[partNum][0];
MimeParser.parseSync(this.getText(), emitter, {
pruneat: mimePartNum,
bodyformat: "raw",
});
return body;
},
};
+
// IMAP FLAGS
// If you don't specify any flag, no flags are set.
-/**
- * This flag represents whether or not the daemon is case-insensitive.
- */
-var IMAP_FLAG_CASE_INSENSITIVE = 1;
+
/**
* This flag represents whether or not CREATE hierarchies need a delimiter.
*
* If this flag is off, <tt>CREATE a<br />CREATE a/b</tt> fails where
* <tt>CREATE a/<br />CREATE a/b</tt> would succeed (assuming the delimiter is
* '/').
*/
var IMAP_FLAG_NEEDS_DEL