# HG changeset patch # User Jorg K # Date 1518219487 -3600 # Node ID 13506ae35338ac22f05c00a7c2f99f44546ea61a # Parent 76b667315a940fe992099227708001d1dee94fb6 Bug 1399756 - remove trailing spaces from JS/JSM files in mailnews/. rs=white-space-only [skip-blame] diff --git a/mailnews/addrbook/content/abDragDrop.js b/mailnews/addrbook/content/abDragDrop.js --- a/mailnews/addrbook/content/abDragDrop.js +++ b/mailnews/addrbook/content/abDragDrop.js @@ -324,21 +324,21 @@ var abDirTreeObserver = { onToggleOpenState: function() { }, onCycleHeader: function(colID, elt) { }, - + onCycleCell: function(row, colID) { }, - + onSelectionChanged: function() { }, onPerformAction: function(action) { }, diff --git a/mailnews/addrbook/content/abMailListDialog.js b/mailnews/addrbook/content/abMailListDialog.js --- a/mailnews/addrbook/content/abMailListDialog.js +++ b/mailnews/addrbook/content/abMailListDialog.js @@ -221,17 +221,17 @@ function OnLoadNewMailList() } function EditListOKButton() { //edit mailing list in database if (GetListValue(gEditList, false)) { if (gListCard) { - // modify the list card (for the results pane) from the mailing list + // modify the list card (for the results pane) from the mailing list gListCard.displayName = gEditList.dirName; gListCard.lastName = gEditList.dirName; gListCard.setProperty("NickName", gEditList.listNickName); gListCard.setProperty("Notes", gEditList.description); } NotifySaveListeners(gEditList); gEditList.editMailListToDatabase(gListCard); @@ -304,17 +304,17 @@ function OnLoadEditList() // the display, the value of the textbox inside the new row isn't inherited into the input - // the first row then appears to be duplicated at the end although it is actually empty. // see awAppendNewRow which copies first row and clears it setTimeout(AppendLastRow, 0); NotifyLoadListeners(gEditList); } function AppendLastRow() -{ +{ AppendNewRowAndSetFocus(); awFitDummyRows(1); // focus on first name var listName = document.getElementById('ListName'); if (listName) listName.focus(); } @@ -427,17 +427,17 @@ function awAppendNewRow(setFocus) if (body && listitem1) { var nextDummy = awGetNextDummyRow(); var newNode = listitem1.cloneNode(true); if (nextDummy) body.replaceChild(newNode, nextDummy); else body.appendChild(newNode); - + top.MAX_RECIPIENTS++; var input = newNode.getElementsByTagName(awInputElementName()); if (input && input.length == 1) { input[0].setAttribute("value", ""); input[0].setAttribute("id", "addressCol1#" + top.MAX_RECIPIENTS); diff --git a/mailnews/addrbook/content/abResultsPane.js b/mailnews/addrbook/content/abResultsPane.js --- a/mailnews/addrbook/content/abResultsPane.js +++ b/mailnews/addrbook/content/abResultsPane.js @@ -215,17 +215,17 @@ function GetSelectedAbCards() abView.selection.getRangeAt(i, start, end); for (let j = start.value; j <= end.value; ++j) { // avoid inserting null element into the list. GetRangeAt() may be buggy. let tmp = abView.getCardFromRow(j); if (tmp) { cards.push(tmp); - } + } } } return cards; } // XXX todo // an optimization might be to make this return // the selected ranges, which would be faster diff --git a/mailnews/addrbook/prefs/content/pref-directory-add.js b/mailnews/addrbook/prefs/content/pref-directory-add.js --- a/mailnews/addrbook/prefs/content/pref-directory-add.js +++ b/mailnews/addrbook/prefs/content/pref-directory-add.js @@ -41,17 +41,17 @@ function Startup() document.getElementById("download").accessKey = gReplicationBundle.getString("downloadButton.accesskey"); if ("arguments" in window && window.arguments[0]) { gCurrentDirectory = window.arguments[0].selectedDirectory; try { fillSettings(); } catch (ex) { - dump("pref-directory-add.js:Startup(): fillSettings() exception: " + dump("pref-directory-add.js:Startup(): fillSettings() exception: " + ex + "\n"); } let oldListName = gCurrentDirectory.dirName; document.title = gReplicationBundle.getFormattedString("directoryTitleEdit", [oldListName]); // Only set up the download button for online/offline status toggling // if the pref isn't locked to disable the button. @@ -68,17 +68,17 @@ function Startup() document.title = gReplicationBundle.getString("directoryTitleNew"); fillDefaultSettings(); // Don't add observer here as it doesn't make any sense. } } function onUnload() { - if ("arguments" in window && + if ("arguments" in window && window.arguments[0] && !Services.prefs.prefIsLocked(gCurrentDirectory.dirPrefId + ".disable_button_download")) { // Remove the observer that we put in on dialog startup Services.obs.removeObserver(ldapOfflineObserver, "network:offline-status-changed"); } } @@ -93,17 +93,17 @@ var progressListener = { "replicationStarted" : "changesStarted"); gDownloadInProgress = true; document.getElementById("download").label = gReplicationBundle.getString("cancelDownloadButton"); document.getElementById("download").accessKey = gReplicationBundle.getString("cancelDownloadButton.accesskey"); } - + if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) { EndDownload(aStatus); } }, onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) { gProgressText.value = gReplicationBundle.getFormattedString("currentCount", [aCurSelfProgress]); @@ -114,18 +114,18 @@ var progressListener = { onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) { }, onSecurityChange: function(aWebProgress, aRequest, state) { }, QueryInterface : function(iid) { - if (iid.equals(Ci.nsIWebProgressListener) || - iid.equals(Ci.nsISupportsWeakReference) || + if (iid.equals(Ci.nsIWebProgressListener) || + iid.equals(Ci.nsISupportsWeakReference) || iid.equals(Ci.nsISupports)) return this; throw Cr.NS_NOINTERFACE; } }; function DownloadNow() { @@ -149,17 +149,17 @@ function DownloadNow() } } else { gReplicationCancelled = true; try { gReplicationService.cancelReplication(gCurrentDirectory.dirPrefId); } catch (ex) { // XXX todo - // perhaps replication hasn't started yet? This can happen if you hit cancel after attempting to replication when offline + // perhaps replication hasn't started yet? This can happen if you hit cancel after attempting to replication when offline dump("unexpected failure while cancelling. ex=" + ex + "\n"); } } } function EndDownload(aStatus) { document.getElementById("download").label = @@ -174,17 +174,17 @@ function EndDownload(aStatus) gDownloadInProgress = false; gProgressText.value = gReplicationBundle.getString(aStatus ? "replicationSucceeded" : gReplicationCancelled ? "replicationCancelled" : "replicationFailed"); } -// fill the settings panel with the data from the preferences. +// fill the settings panel with the data from the preferences. // function fillSettings() { document.getElementById("description").value = gCurrentDirectory.dirName; if (gCurrentDirectory instanceof Ci.nsIAbLDAPDirectory) { var ldapUrl = gCurrentDirectory.lDAPURL; @@ -198,17 +198,17 @@ function fillSettings() switch(ldapUrl.scope) { case Ci.nsILDAPURL.SCOPE_ONELEVEL: sub.radioGroup.selectedItem = document.getElementById("one"); break; default: sub.radioGroup.selectedItem = sub; break; } - + var sasl = document.getElementById("saslMechanism"); switch (gCurrentDirectory.saslMechanism) { case "GSSAPI": sasl.selectedItem = document.getElementById("GSSAPI"); break; default: sasl.selectedItem = document.getElementById("Simple"); break; @@ -346,33 +346,33 @@ function onAccept() theDirectory.maxHits = results; theDirectory.authDn = document.getElementById("login").value; theDirectory.saslMechanism = saslMechanism; window.opener.gNewServer = description; // set window.opener.gUpdate to true so that LDAP Directory Servers // dialog gets updated - window.opener.gUpdate = true; + window.opener.gUpdate = true; } else { var addressBookBundle = document.getElementById("bundle_addressBook"); Services.prompt.alert(window, document.title, addressBookBundle.getString(errorValue)); return false; } } catch (outer) { dump("Internal error in pref-directory-add.js:onAccept() " + outer + "\n"); } return true; } function onCancel() -{ +{ window.opener.gUpdate = false; } // called by Help button in platform overlay function doHelpButton() { openHelp("mail-ldap-properties"); diff --git a/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js b/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js --- a/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js +++ b/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js @@ -240,17 +240,17 @@ nsAbLDAPAutoCompleteSearch.prototype = { this._timer.init(this, 60000, Ci.nsITimer.TYPE_ONE_SHOT); var args = Cc["@mozilla.org/addressbook/directory/query-arguments;1"] .createInstance(Ci.nsIAbDirectoryQueryArguments); var filterTemplate = this._book.getStringValue("autoComplete.filterTemplate", ""); - // Use default value when preference is not set or it contains empty string + // Use default value when preference is not set or it contains empty string if (!filterTemplate) filterTemplate = "(|(cn=%v1*%v2-*)(mail=%v1*%v2-*)(sn=%v1*%v2-*))"; // Create filter from filter template and search string var ldapSvc = Cc["@mozilla.org/network/ldap-service;1"] .getService(Ci.nsILDAPService); var filter = ldapSvc.createFilter(1024, filterTemplate, "", "", "", aSearchString); if (!filter) diff --git a/mailnews/addrbook/test/unit/test_notifications.js b/mailnews/addrbook/test/unit/test_notifications.js --- a/mailnews/addrbook/test/unit/test_notifications.js +++ b/mailnews/addrbook/test/unit/test_notifications.js @@ -96,17 +96,17 @@ function run_test() { mailList.listNickName = "test"; mailList.description = "testdescription"; // For mailing list addition, we expect 2 results, one for the card, one // for the directory abListener.maxResults = 2; AB.addMailList(mailList); - + do_check_eq(abListener.result.length, 2); do_check_eq(abListener.result[0][0], "onItemAdded"); do_check_eq(abListener.result[0][1], AB); do_check_eq(abListener.result[1][0], "onItemAdded"); do_check_eq(abListener.result[1][1], AB); // Now verify the card and the directory card = abListener.result[0][2].QueryInterface(Ci.nsIAbCard); diff --git a/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js b/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js --- a/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js +++ b/mailnews/addrbook/test/unit/test_nsAbAutoCompleteSearch5.js @@ -1,12 +1,12 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This suite ensures that we can correctly read and re-set the popularity - * indexes on a + * indexes on a */ var ACR = Ci.nsIAutoCompleteResult; var results = [ { email: "d ", dirName: kPABData.dirName }, { email: "di ", dirName: kPABData.dirName }, { email: "dis ", dirName: kPABData.dirName }, { email: "disp ", dirName: kPABData.dirName }, diff --git a/mailnews/base/content/dateFormat.js b/mailnews/base/content/dateFormat.js --- a/mailnews/base/content/dateFormat.js +++ b/mailnews/base/content/dateFormat.js @@ -116,17 +116,17 @@ function initializeSearchDateFormat() } function convertPRTimeToString(tm) { var time = new Date(); // PRTime is in microseconds, JavaScript time is in milliseconds // so divide by 1000 when converting time.setTime(tm / 1000); - + return convertDateToString(time); } function convertDateToString(time) { initializeSearchDateFormat(); var year = time.getFullYear(); diff --git a/mailnews/base/content/jsTreeView.js b/mailnews/base/content/jsTreeView.js --- a/mailnews/base/content/jsTreeView.js +++ b/mailnews/base/content/jsTreeView.js @@ -224,12 +224,12 @@ PROTO_TREE_VIEW.prototype = { this.toggleOpenState(i); } }, QueryInterface: function QueryInterface(aIID) { if (aIID.equals(Ci.nsITreeView) || aIID.equals(Ci.nsISupports)) return this; - + throw Cr.NS_ERROR_NO_INTERFACE; } }; diff --git a/mailnews/base/content/markByDate.js b/mailnews/base/content/markByDate.js --- a/mailnews/base/content/markByDate.js +++ b/mailnews/base/content/markByDate.js @@ -111,17 +111,17 @@ function markInDatabase( lower, upper ) value = searchTerm.value; value.attrib = nsMsgSearchAttrib.Date; value.date = lower; searchTerm.value = value; searchTerms.appendElement( searchTerm, false ); } var filterEnumerator = messageDatabase.getFilterEnumerator( searchTerms ); - + if ( filterEnumerator ) { var keepGoing; var numMatches = {}; do { keepGoing = messageDatabase.nextMatchingHdrs(filterEnumerator, 0, 0, headers, numMatches); } diff --git a/mailnews/base/content/msgFolderPickerOverlay.js b/mailnews/base/content/msgFolderPickerOverlay.js --- a/mailnews/base/content/msgFolderPickerOverlay.js +++ b/mailnews/base/content/msgFolderPickerOverlay.js @@ -6,31 +6,31 @@ Cu.import("resource:///modules/MailUtils.js"); var gMessengerBundle; // call this from dialog onload() to set the menu item to the correct value function MsgFolderPickerOnLoad(pickerID) { var uri = null; - try { + try { uri = window.arguments[0].preselectedURI; } catch (ex) { uri = null; } if (uri) { //dump("on loading, set titled button to " + uri + "\n"); // verify that the value we are attempting to // pre-flight the menu with is valid for this // picker type var msgfolder = MailUtils.getFolderForURI(uri, true); - if (!msgfolder) return; + if (!msgfolder) return; var verifyFunction = null; switch (pickerID) { case "msgNewFolderPicker": verifyFunction = msgfolder.canCreateSubfolders; break; case "msgRenameFolderPicker": @@ -46,23 +46,23 @@ function MsgFolderPickerOnLoad(pickerID) } } } function PickedMsgFolder(selection,pickerID) { var selectedUri = selection.getAttribute('id'); SetFolderPicker(selectedUri,pickerID); -} +} function SetFolderPickerElement(uri, picker) { var msgfolder = MailUtils.getFolderForURI(uri, true); - if (!msgfolder) + if (!msgfolder) return; var selectedValue = null; var serverName; if (msgfolder.isServer) selectedValue = msgfolder.name; else { diff --git a/mailnews/base/content/msgPrintEngine.js b/mailnews/base/content/msgPrintEngine.js --- a/mailnews/base/content/msgPrintEngine.js +++ b/mailnews/base/content/msgPrintEngine.js @@ -143,17 +143,17 @@ function InitPrintEngineWindow() /* Tell the nsIPrintEngine object what window is rendering the email */ printEngine.setWindow(window); /* hide the printEngine window. see bug #73995 */ /* See if we got arguments. * Window was opened via window.openDialog. Copy argument - * and perform compose initialization + * and perform compose initialization */ if ( window.arguments && window.arguments[0] != null ) { var numSelected = window.arguments[0]; var uriArray = window.arguments[1]; var statusFeedback = window.arguments[2]; if (window.arguments[3]) { printEngine.doPrintPreview = window.arguments[3]; @@ -175,19 +175,19 @@ function InitPrintEngineWindow() } printEngine.setStatusFeedback(statusFeedback); printEngine.setStartupPPObserver(gStartupPPObserver); if (numSelected > 0) { printEngine.setPrintURICount(numSelected); for (var i = 0; i < numSelected; i++) { - printEngine.addPrintURI(uriArray[i]); + printEngine.addPrintURI(uriArray[i]); //dump(uriArray[i] + "\n"); - } + } } } } function ClearPrintEnginePane() { if (window.frames["content"].location.href != "about:blank") window.frames["content"].location.href = "about:blank"; diff --git a/mailnews/base/content/msgSynchronize.js b/mailnews/base/content/msgSynchronize.js --- a/mailnews/base/content/msgSynchronize.js +++ b/mailnews/base/content/msgSynchronize.js @@ -86,17 +86,17 @@ function selectOnLoad() gMsgWindow = Cc["@mozilla.org/messenger/msgwindow;1"] .createInstance(Ci.nsIMsgWindow); gMsgWindow.domWindow = window; gMsgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL; gSynchronizeTree = document.getElementById('synchronizeTree'); SortSynchronizePane('folderNameCol', '?folderTreeNameSort'); -} +} function SortSynchronizePane(column, sortKey) { var node = FindInWindow(window, column); if(!node) { dump('Couldnt find sort column\n'); return; } @@ -154,29 +154,29 @@ function onSynchronizeClick(event) var imapFolder = folderResource.QueryInterface(Ci.nsIMsgImapMailFolder); if (imapFolder) { imapFolder.performExpand(gMsgWindow); } } } } else { - if (col.value.id == "syncCol") { + if (col.value.id == "syncCol") { UpdateNode(GetFolderResource(gSynchronizeTree, row.value), row.value); } } } function onSynchronizeTreeKeyPress(event) { // for now, only do something on space key if (event.charCode != KeyEvent.DOM_VK_SPACE) return; - var treeSelection = gSynchronizeTree.view.selection; + var treeSelection = gSynchronizeTree.view.selection; for (var i=0;i Array -> createAccount -> finishAccount - + For accounts coming from the ISP setup: * RDF -> Array -> pageData -> Array -> createAccount -> finishAccount - - for "unfinished accounts" + + for "unfinished accounts" * account -> Array -> pageData -> Array -> finishAccount - + Where: pageData - the actual pages coming out of the Widget State Manager RDF - the ISP datasource Array - associative array of attributes, that very closely resembles the nsIMsgAccount/nsIMsgIncomingServer/nsIMsgIdentity structure createAccount() - creates an account from the above Array - finishAccount() - fills an existing account with data from the above Array + finishAccount() - fills an existing account with data from the above Array */ -/* +/* the account wizard path is something like: - + accounttype -> identity -> server -> login -> accname -> done \-> newsserver ----/ where the accounttype determines which path to take (server vs. newsserver) */ Cu.import("resource:///modules/mailServices.js"); @@ -71,17 +71,17 @@ function onAccountWizardLoad() { if ("testingIspServices" in this) { if ("SetCustomizedWizardDimensions" in this && testingIspServices()) { SetCustomizedWizardDimensions(); } } /* We are checking here for the callback argument */ if (window.arguments && window.arguments[0]) { - if(window.arguments[0].okCallback ) + if(window.arguments[0].okCallback ) { //dump("There is okCallback"); top.okCallback = window.arguments[0].okCallback; } } checkForInvalidAccounts(); @@ -96,24 +96,24 @@ function onAccountWizardLoad() { // Set default value for global inbox checkbox var checkGlobalInbox = document.getElementById("deferStorage"); try { checkGlobalInbox.checked = Services.prefs.getBoolPref("mail.accountwizard.deferstorage"); } catch(e) {} } -function onCancel() +function onCancel() { if ("ActivationOnCancel" in this && ActivationOnCancel()) return false; var firstInvalidAccount = getFirstInvalidAccount(); var closeWizard = true; - // if the user cancels the the wizard when it pops up because of + // if the user cancels the the wizard when it pops up because of // an invalid account (example, a webmail account that activation started) // we just force create it by setting some values and calling the FinishAccount() // see bug #47521 for the full discussion if (firstInvalidAccount) { var pageData = GetPageData(); // set the fullName if it doesn't exist if (!pageData.identity.fullName || !pageData.identity.fullName.value) { setPageData(pageData, "identity", "fullName", ""); @@ -134,78 +134,78 @@ function onCancel() // if the length of the account list is less than 1, there are no accounts if (MailServices.accounts.accounts.length < 1) { let confirmMsg = gPrefsBundle.getString("cancelWizard"); let confirmTitle = gPrefsBundle.getString("accountWizard"); let result = Services.prompt.confirmEx(window, confirmTitle, confirmMsg, (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) + (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1), gPrefsBundle.getString('WizardExit'), - gPrefsBundle.getString('WizardContinue'), + gPrefsBundle.getString('WizardContinue'), null, null, {value:0}); if (result == 1) closeWizard = false; } if(top.okCallback && closeWizard) { var state = false; top.okCallback(state); } } return closeWizard; } -function FinishAccount() +function FinishAccount() { try { var pageData = GetPageData(); var accountData= gCurrentAccountData; - + if (!accountData) { accountData = new Object; // Time to set the smtpRequiresUsername attribute if (!serverIsNntp(pageData)) accountData.smtpRequiresUsername = true; } - + // we may need local folders before account is "Finished" // if it's a pop3 account which defers to Local Folders. verifyLocalFoldersAccount(); PageDataToAccountData(pageData, accountData); FixupAccountDataForIsp(accountData); - + // we might be simply finishing another account if (!gCurrentAccount) gCurrentAccount = createAccount(accountData); // transfer all attributes from the accountdata finishAccount(gCurrentAccount, accountData); - + setupCopiesAndFoldersServer(gCurrentAccount, getCurrentServerIsDeferred(pageData), accountData); if (gCurrentAccount.incomingServer.canBeDefaultServer) EnableCheckMailAtStartUpIfNeeded(gCurrentAccount); if (!document.getElementById("downloadMsgs").hidden) { // skip the default biff, we will load messages manually if needed window.opener.gLoadStartFolder = false; if (document.getElementById("downloadMsgs").checked) { window.opener.gNewAccountToLoad = gCurrentAccount; // load messages for new POP account } } // in case we crash, force us a save of the prefs file NOW try { MailServices.accounts.saveAccountInfo(); - } + } catch (ex) { dump("Error saving account info: " + ex + "\n"); } window.close(); if(top.okCallback) { var state = true; //dump("finish callback"); @@ -223,23 +223,23 @@ function AccountDataToPageData(accountDa { if (!accountData) { dump("null account data! clearing..\n"); // handle null accountData as if it were an empty object // so that we clear-out any old pagedata from a // previous accountdata. The trick is that // with an empty object, accountData.identity.slot is undefined, // so this will clear out the prefill data in setPageData - + accountData = new Object; accountData.incomingServer = new Object; accountData.identity = new Object; accountData.smtp = new Object; } - + var server = accountData.incomingServer; if (server.type == undefined) { // clear out the old server data //setPageData(pageData, "accounttype", "mailaccount", undefined); // setPageData(pageData, "accounttype", "newsaccount", undefined); setPageData(pageData, "server", "servertype", undefined); setPageData(pageData, "server", "hostname", undefined); @@ -276,17 +276,17 @@ function AccountDataToPageData(accountDa identity = accountData.identities.queryElementAt(0, Ci.nsIMsgIdentity); dump("this is an account, id= " + identity + "\n"); } setPageData(pageData, "identity", "email", identity.email || ""); setPageData(pageData, "identity", "fullName", identity.fullName || ""); var smtp; - + if (accountData.smtp) { smtp = accountData.smtp; setPageData(pageData, "server", "smtphostname", smtp.hostname); setPageData(pageData, "login", "smtpusername", smtp.username); } } // take data from each page of pageData and dump it into accountData @@ -298,17 +298,17 @@ function PageDataToAccountData(pageData, if (!accountData.incomingServer) accountData.incomingServer = new Object; if (!accountData.smtp) accountData.smtp = new Object; if (!accountData.pop3) accountData.pop3 = new Object; if (!accountData.imap) accountData.imap = new Object; - + var identity = accountData.identity; var server = accountData.incomingServer; var smtp = accountData.smtp; var pop3 = accountData.pop3; var imap = accountData.imap; if (pageData.identity.email) identity.email = pageData.identity.email.value; @@ -384,28 +384,28 @@ function PageDataToAccountData(pageData, } // given an accountData structure, create an account // (but don't fill in any fields, that's for finishAccount() function createAccount(accountData) { // Retrieve the server (data) from the account data. var server = accountData.incomingServer; - + // for news, username is always null var username = (server.type == "nntp") ? null : server.username; dump("MailServices.accounts.createIncomingServer(" + username + ", " + server.hostName + ", " + server.type + ")\n"); // Create a (actual) server. server = MailServices.accounts.createIncomingServer(username, server.hostName, server.type); dump("MailServices.accounts.createAccount()\n"); // Create an account. let account = MailServices.accounts.createAccount(); - + // only create an identity for this account if we really have one // (use the email address as a check) if (accountData.identity && accountData.identity.email) { dump("MailServices.accounts.createIdentity()\n"); // Create an identity. let identity = MailServices.accounts.createIdentity(); @@ -424,17 +424,17 @@ function createAccount(accountData) // Set the new account to use the new server. account.incomingServer = server; server.valid = true; return account; } // given an accountData structure, copy the data into the // given account, incoming server, and so forth -function finishAccount(account, accountData) +function finishAccount(account, accountData) { if (accountData.incomingServer) { var destServer = account.incomingServer; var srcServer = accountData.incomingServer; copyObjectToInterface(destServer, srcServer, true); // see if there are any protocol-specific attributes @@ -454,44 +454,44 @@ function finishAccount(account, accountD if (IID) { destProtocolServer = destServer.QueryInterface(IID); srcProtocolServer = srcServer["ServerType-" + srcServer.type]; dump("Copying over " + srcServer.type + "-specific data\n"); copyObjectToInterface(destProtocolServer, srcProtocolServer, false); } } - + account.incomingServer.valid=true; // hack to cause an account loaded notification now the server is valid account.incomingServer = account.incomingServer; } // copy identity info var destIdentity = account.identities.length ? account.identities.queryElementAt(0, nsIMsgIdentity) : null; if (destIdentity) // does this account have an identity? - { + { if (accountData.identity && accountData.identity.email) { // fixup the email address if we have a default domain var emailArray = accountData.identity.email.split('@'); if (emailArray.length < 2 && accountData.domain) { accountData.identity.email += '@' + accountData.domain; } copyObjectToInterface(destIdentity, accountData.identity, true); destIdentity.valid=true; } /** * If signature file need to be set, get the path to the signature file. * Signature files, if exist, are placed under default location. Get - * default files location for messenger using directory service. Signature + * default files location for messenger using directory service. Signature * file name should be extracted from the account data to build the complete * path for signature file. Once the path is built, set the identity's signature pref. */ if (destIdentity.attachSignature) { var sigFileName = accountData.signatureFileName; let sigFile = MailServices.mailSession.getDataFilesDir("messenger"); sigFile.append(sigFileName); @@ -520,17 +520,17 @@ function finishAccount(account, accountD if (this.FinishAccountHook != undefined) { FinishAccountHook(accountData.domain); } } // Helper method used by copyObjectToInterface which attempts to set dest[attribute] as a generic // attribute on the xpconnect object, src. -// This routine skips any attribute that begins with ServerType- +// This routine skips any attribute that begins with ServerType- function setGenericAttribute(dest, src, attribute) { if (!(attribute.toLowerCase().startsWith("servertype-")) && src[attribute]) { switch (typeof src[attribute]) { case "string": dest.setUnicharAttribute(attribute, src[attribute]); @@ -547,50 +547,50 @@ function setGenericAttribute(dest, src, } } } // copy over all attributes from dest into src that already exist in src // the assumption is that src is an XPConnect interface full of attributes // @param useGenericFallback if we can't set an attribute directly on src, then fall back // and try setting it generically. This assumes that src supports setIntAttribute, setUnicharAttribute -// and setBoolAttribute. -function copyObjectToInterface(dest, src, useGenericFallback) +// and setBoolAttribute. +function copyObjectToInterface(dest, src, useGenericFallback) { if (!dest) return; if (!src) return; var attribute; - for (attribute in src) + for (attribute in src) { if (dest.__lookupSetter__(attribute)) { if (dest[attribute] != src[attribute]) dest[attribute] = src[attribute]; - } + } else if (useGenericFallback) // fall back to setting the attribute generically setGenericAttribute(dest, src, attribute); } // for each attribute in src we want to copy } // check if there already is a "Local Folders" // if not, create it. -function verifyLocalFoldersAccount() +function verifyLocalFoldersAccount() { var localMailServer = null; try { localMailServer = MailServices.accounts.localFoldersServer; } catch (ex) { // dump("exception in findserver: " + ex + "\n"); localMailServer = null; } try { - if (!localMailServer) + if (!localMailServer) { // dump("Creating local mail account\n"); // creates a copy of the identity you pass in MailServices.accounts.createLocalMailAccount(); try { localMailServer = MailServices.accounts.localFoldersServer; } catch (ex) { @@ -613,21 +613,21 @@ function setupCopiesAndFoldersServer(acc if (server.type == "rss" || account.identities.length == 0) return false; let identity = account.identities.queryElementAt(0, Ci.nsIMsgIdentity); // For this server, do we default the folder prefs to this server, or to the "Local Folders" server // If it's deferred, we use the local folders account. var defaultCopiesAndFoldersPrefsToServer = !accountIsDeferred && server.defaultCopiesAndFoldersPrefsToServer; var copiesAndFoldersServer = null; - if (defaultCopiesAndFoldersPrefsToServer) + if (defaultCopiesAndFoldersPrefsToServer) { copiesAndFoldersServer = server; } - else + else { if (!MailServices.accounts.localFoldersServer) { dump("error! we should have a local mail server at this point\n"); return false; } copiesAndFoldersServer = MailServices.accounts.localFoldersServer; } @@ -661,22 +661,22 @@ function setDefaultCopiesAndFoldersPrefs // // this makes the assumption that the server's draft, stationery fcc folder // are at the top level (ie subfolders of the root folder.) this works // because we happen to be doing things that way, and if the user changes // that, it will work because to change the folder, it must be in rdf, // coming from the folder cache, in the worst case. var msgFolder = rootFolder.QueryInterface(Ci.nsIMsgFolder); - /** + /** * When a new account is created, folders 'Sent', 'Drafts' - * and 'Templates' are not created then, but created on demand at runtime. - * But we do need to present them as possible choices in the Copies and Folders - * UI. To do that, folder URIs have to be created and stored in the prefs file. - * So, if there is a need to build special folders, append the special folder + * and 'Templates' are not created then, but created on demand at runtime. + * But we do need to present them as possible choices in the Copies and Folders + * UI. To do that, folder URIs have to be created and stored in the prefs file. + * So, if there is a need to build special folders, append the special folder * names and create right URIs. */ var folderDelim = "/"; /* we use internal names known to everyone like Sent, Templates and Drafts */ /* if folder names were already given in isp rdf, we use them, otherwise we use internal names known to everyone like Sent, Templates and Drafts */ @@ -742,31 +742,31 @@ function checkForInvalidAccounts() dump("Invalid account: Got " + accountData + "\n"); // account -> accountData -> pageData accountData = AccountToAccountData(firstInvalidAccount, accountData); } else { accountData = getPreConfigDataForAccount(firstInvalidAccount); } - + AccountDataToPageData(accountData, pageData); gCurrentAccountData = accountData; setupWizardPanels(); // Set the page index to identity page. document.documentElement.pageIndex = 1; } } -// Transfer all invalid account information to AccountData. Also, get those special -// preferences (not associated with any interfaces but preconfigurable via prefs or rdf files) -// like whether not the smtp server associated with this account requires -// a user name (mail.identity..smtpRequiresUsername) and the choice of skipping +// Transfer all invalid account information to AccountData. Also, get those special +// preferences (not associated with any interfaces but preconfigurable via prefs or rdf files) +// like whether not the smtp server associated with this account requires +// a user name (mail.identity..smtpRequiresUsername) and the choice of skipping // panels (mail.identity..wizardSkipPanels). function getPreConfigDataForAccount(account) { var accountData = new Object; accountData = new Object; accountData.incomingServer = new Object; accountData.identity = new Object; accountData.smtp = new Object; @@ -785,17 +785,17 @@ function getPreConfigDataForAccount(acco var smtpRequiresUsername = false; var smtpRequiresPrefStr = "mail.identity." + identity.key + ".smtpRequiresUsername"; smtpRequiresUsername = Services.prefs.getBoolPref(smtpRequiresPrefStr); accountData.smtpRequiresUsername = smtpRequiresUsername; } } catch(ex) { - // reached here as special identity pre-configuration prefs + // reached here as special identity pre-configuration prefs // (wizardSkipPanels, smtpRequiresUsername) are not defined. } return accountData; } function AccountToAccountData(account, defaultAccountData) { @@ -832,49 +832,49 @@ function setPageData(pageData, tag, slot function serverIsNntp(pageData) { if (pageData.accounttype.newsaccount) return pageData.accounttype.newsaccount.value; return false; } function getUsernameFromEmail(aEmail, aEnsureDomain) { - var username = aEmail.substr(0, aEmail.indexOf("@")); + var username = aEmail.substr(0, aEmail.indexOf("@")); if (aEnsureDomain && gCurrentAccountData && gCurrentAccountData.domain) - username += '@' + gCurrentAccountData.domain; + username += '@' + gCurrentAccountData.domain; return username; } function getCurrentUserName(pageData) { var userName = ""; if (pageData.login) { if (pageData.login.username) { userName = pageData.login.username.value; } } if (userName == "") { var email = pageData.identity.email.value; - userName = getUsernameFromEmail(email, false); + userName = getUsernameFromEmail(email, false); } return userName; } function getCurrentServerType(pageData) { var servertype = "pop3"; // hopefully don't resort to default! if (serverIsNntp(pageData)) servertype = "nntp"; else if (pageData.server && pageData.server.servertype) servertype = pageData.server.servertype.value; return servertype; } function getCurrentServerIsDeferred(pageData) { - var serverDeferred = false; + var serverDeferred = false; if (getCurrentServerType(pageData) == "pop3" && pageData.server && pageData.server.deferStorage) serverDeferred = pageData.server.deferStorage.value; return serverDeferred; } function getCurrentHostname(pageData) { if (serverIsNntp(pageData)) @@ -891,17 +891,17 @@ function GetPageData() return gPageData; } function PrefillAccountForIsp(ispName) { dump("AccountWizard.prefillAccountForIsp(" + ispName + ")\n"); var ispData = getIspDefaultsForUri(ispName); - + var pageData = GetPageData(); if (!ispData) { SetCurrentAccountData(null); return; } // prefill the rest of the wizard @@ -927,17 +927,17 @@ function FixupAccountDataForIsp(accountD // The identity might not have an email address, which is what the rest of // this function is looking for. if (!email) return; // fix up the username if (!accountData.incomingServer.username) - accountData.incomingServer.username = + accountData.incomingServer.username = getUsernameFromEmail(email, accountData.incomingServerUserNameRequiresDomain); if (!accountData.smtp.username && accountData.smtpRequiresUsername) { // fix for bug #107953 // if incoming hostname is same as smtp hostname // use the server username (instead of the email username) if (accountData.smtp.hostname == accountData.incomingServer.hostName && @@ -962,31 +962,31 @@ function onFlush() { /** If there are no default accounts.. * this is will be the new default, so enable * check for mail at startup */ function EnableCheckMailAtStartUpIfNeeded(newAccount) { // Check if default account exists and if that account is alllowed to be - // a default account. If no such account, make this one as the default account - // and turn on the new mail check at startup for the current account - if (!(gDefaultAccount && gDefaultAccount.incomingServer.canBeDefaultServer)) { + // a default account. If no such account, make this one as the default account + // and turn on the new mail check at startup for the current account + if (!(gDefaultAccount && gDefaultAccount.incomingServer.canBeDefaultServer)) { MailServices.accounts.defaultAccount = newAccount; newAccount.incomingServer.loginAtStartUp = true; newAccount.incomingServer.downloadOnBiff = true; } } -function SetSmtpRequiresUsernameAttribute(accountData) +function SetSmtpRequiresUsernameAttribute(accountData) { // If this is the default server, time to set the smtp user name // Set the generic attribute for requiring user name for smtp to true. // ISPs can override the pref via rdf files. - if (!(gDefaultAccount && gDefaultAccount.incomingServer.canBeDefaultServer)) { + if (!(gDefaultAccount && gDefaultAccount.incomingServer.canBeDefaultServer)) { accountData.smtpRequiresUsername = true; } } function setNextPage(currentPageId, nextPageId) { var currentPage = document.getElementById(currentPageId); currentPage.next = nextPageId; } diff --git a/mailnews/base/prefs/content/accountUtils.js b/mailnews/base/prefs/content/accountUtils.js --- a/mailnews/base/prefs/content/accountUtils.js +++ b/mailnews/base/prefs/content/accountUtils.js @@ -51,17 +51,17 @@ function showMailIntegrationDialog() { try { var shellService = Cc["@mozilla.org/suite/shell-service;1"] .getService(nsIShellService); var appTypesCheck = shellService.shouldBeDefaultClientFor & (nsIShellService.MAIL | nsIShellService.NEWS); // show the default client dialog only if we have at least one account, - // if we should check for the default client, and we want to check if we are + // if we should check for the default client, and we want to check if we are // the default for mail/news and are not the default client for mail/news if (appTypesCheck && shellService.shouldCheckDefaultClient && !shellService.isDefaultClient(true, appTypesCheck)) window.openDialog("chrome://communicator/content/defaultClientDialog.xul", "DefaultClient", "modal,centerscreen,chrome,resizable=no"); } catch (ex) {} } @@ -255,38 +255,38 @@ function MsgAccountManager(selectPage, a window.openDialog("chrome://messenger/content/AccountManager.xul", "AccountManager", "chrome,centerscreen,modal,titlebar,resizable", { server: aServer, selectPage: selectPage }); } } -function loadInboxForNewAccount() +function loadInboxForNewAccount() { // gNewAccountToLoad is set in the final screen of the Account Wizard if a POP account // was created, the download messages box is checked, and the wizard was opened from the 3pane if (gNewAccountToLoad) { var rootMsgFolder = gNewAccountToLoad.incomingServer.rootMsgFolder; const kInboxFlag = Ci.nsMsgFolderFlags.Inbox; var inboxFolder = rootMsgFolder.getFolderWithFlags(kInboxFlag); SelectFolder(inboxFolder.URI); window.focus(); setTimeout(MsgGetMessage, 0); gNewAccountToLoad = null; } } // returns true if we migrated - it knows this because 4.x did not have the -// pref mailnews.quotingPrefs.version, so if it's not set, we're either +// pref mailnews.quotingPrefs.version, so if it's not set, we're either // migrating from 4.x, or a much older version of Mozilla. function migrateGlobalQuotingPrefs(allIdentities) { // if reply_on_top and auto_quote exist then, if non-default - // migrate and delete, if default just delete. + // migrate and delete, if default just delete. var reply_on_top = 0; var auto_quote = true; var quotingPrefs = 0; var migrated = false; try { quotingPrefs = Services.prefs.getIntPref("mailnews.quotingPrefs.version"); } catch (ex) {} diff --git a/mailnews/base/prefs/content/am-help.js b/mailnews/base/prefs/content/am-help.js --- a/mailnews/base/prefs/content/am-help.js +++ b/mailnews/base/prefs/content/am-help.js @@ -3,69 +3,69 @@ * 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/. */ /** * Key value pairs to derive the tag based on the page loaded. * Each key is the page loaded when user clicks on one of the items on * the accounttree of the AccountManager window. * Value is a tag that is preset which will be used to display - * context sensitive help. + * context sensitive help. */ var pageTagPairs = { "chrome://messenger/content/am-main.xul": "mail_account_identity", "chrome://messenger/content/am-server.xul": "mail", "chrome://messenger/content/am-copies.xul": "mail_copies", "chrome://messenger/content/am-addressing.xul": "mail_addressing_settings", "chrome://messenger/content/am-junk.xul": "mail-account-junk", "chrome://messenger/content/am-offline.xul": "mail-offline-accounts", "chrome://messenger/content/am-smtp.xul": "mail_smtp", "chrome://messenger/content/am-smime.xul": "mail_security_settings", "chrome://messenger/content/am-serverwithnoidentities.xul": "mail_local_folders_settings", "chrome://messenger/content/am-mdn.xul": "mail-account-receipts", -} +} -function doHelpButton() +function doHelpButton() { // Get the URI of the page loaded in the AccountManager's content frame. var pageSourceURI = contentFrame.location.href; // Get the help tag corresponding to the page loaded. var helpTag = pageTagPairs[pageSourceURI]; // If the help tag is generic or offline, check if there is a need to set tags per server type if ((helpTag == "mail") || (helpTag == "mail-offline-accounts")) { // Get server type, as we may need to set help tags per server type for some pages var serverType = GetServerType(); - + /** - * Check the page to be loaded. Following pages needed to be presented with the + * Check the page to be loaded. Following pages needed to be presented with the * help content that is based on server type. For any pages with such requirement * do add comments here about the page and a new case statement for pageSourceURI * switch. * - server settings ("chrome://messenger/content/am-server.xul") * - offline/diskspace settings ("chrome://messenger/content/am-offline.xul") - */ + */ switch (pageSourceURI) { case "chrome://messenger/content/am-server.xul": helpTag = "mail_server_" + serverType; break; case "chrome://messenger/content/am-offline.xul": helpTag = "mail_offline_" + serverType; break; default : break; } } - if ( helpTag ) - openHelp(helpTag); + if ( helpTag ) + openHelp(helpTag); else - openHelp('mail'); + openHelp('mail'); } /** * Get server type of the seleted item */ function GetServerType() { var serverType = null; diff --git a/mailnews/base/prefs/content/am-main.js b/mailnews/base/prefs/content/am-main.js --- a/mailnews/base/prefs/content/am-main.js +++ b/mailnews/base/prefs/content/am-main.js @@ -13,17 +13,17 @@ function onInit(aPageId, aServerId) if(accountName.value) titleValue = defaultTitle+" - <"+accountName.value+">"; else titleValue = defaultTitle; title.setAttribute("title",titleValue); document.title = titleValue; - setupSignatureItems(); + setupSignatureItems(); } function onPreInit(account, accountValues) { loadSMTPServerList(); } function manageIdentities() diff --git a/mailnews/base/prefs/content/am-offline.js b/mailnews/base/prefs/content/am-offline.js --- a/mailnews/base/prefs/content/am-offline.js +++ b/mailnews/base/prefs/content/am-offline.js @@ -7,19 +7,19 @@ Cu.import("resource:///modules/iteratorU var gIncomingServer; var gServerType; var gImapIncomingServer; var gPref = null; var gLockedPref = null; var gOfflineMap = null; // map of folder URLs to offline flags -function onInit(aPageId, aServerId) +function onInit(aPageId, aServerId) { - onLockPreference(); + onLockPreference(); // init values here initServerSettings(); initRetentionSettings(); initDownloadSettings(); initOfflineSettings(); onCheckItem("offline.notDownloadMin", "offline.notDownload"); @@ -139,17 +139,17 @@ function onPreInit(account, accountValue var applyToFlaggedCheckbox = document.getElementById("retention.applyToFlagged"); applyToFlaggedCheckbox.setAttribute("hidden", "true"); } } } function onClickSelect() { - + top.window.openDialog("chrome://messenger/content/msgSelectOffline.xul", "", "centerscreen,chrome,modal,titlebar,resizable=yes"); return true; } /** * Handle updates to the Autosync */ @@ -249,18 +249,18 @@ function disableIfLocked( prefstrArray ) } } // Disables xul elements that have associated preferences locked. function onLockPreference() { var isDownloadLocked = false; var isGetNewLocked = false; - var initPrefString = "mail.server"; - var finalPrefString; + var initPrefString = "mail.server"; + var finalPrefString; // This panel does not use the code in AccountManager.js to handle // the load/unload/disable. keep in mind new prefstrings and changes // to code in AccountManager, and update these as well. var allPrefElements = [ { prefstring:"limit_offline_message_size", id:"offline.notDownload"}, { prefstring:"limit_offline_message_size", id:"autosync.notDownload"}, { prefstring:"max_size", id:"offline.notDownloadMin"}, @@ -276,17 +276,17 @@ function onLockPreference() { prefstring:"disable_button.selectFolder", id:"selectNewsgroupsButton"}, { prefstring:"disable_button.selectFolder", id:"selectImapFoldersButton"} ]; finalPrefString = initPrefString + "." + gIncomingServer.key + "."; gPref = Services.prefs.getBranch(finalPrefString); disableIfLocked( allPrefElements ); -} +} function onCheckItem(changeElementId, checkElementId) { var element = document.getElementById(changeElementId); var checked = document.getElementById(checkElementId).checked; if(checked && !gLockedPref[checkElementId] ) { element.removeAttribute("disabled"); } diff --git a/mailnews/base/prefs/content/am-server-advanced.js b/mailnews/base/prefs/content/am-server-advanced.js --- a/mailnews/base/prefs/content/am-server-advanced.js +++ b/mailnews/base/prefs/content/am-server-advanced.js @@ -26,17 +26,17 @@ function getLocalFoldersAccount() .FindAccountForServer(MailServices.accounts.localFoldersServer); } function onLoad() { var prettyName = gServerSettings.serverPrettyName; if (prettyName) - document.getElementById("serverPrettyName").value = + document.getElementById("serverPrettyName").value = document.getElementById("bundle_prefs") .getFormattedString("forAccount", [prettyName]); if (gServerSettings.serverType == "imap") { document.getElementById("pop3Panel").hidden = true; } else if (gServerSettings.serverType == "pop3") diff --git a/mailnews/base/prefs/content/aw-accname.js b/mailnews/base/prefs/content/aw-accname.js --- a/mailnews/base/prefs/content/aw-accname.js +++ b/mailnews/base/prefs/content/aw-accname.js @@ -1,16 +1,16 @@ /* -*- 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 gPrefsBundle; -function acctNamePageValidate() +function acctNamePageValidate() { var accountname = document.getElementById("prettyName").value; var canAdvance = accountname ? true : false; // Check if this accountname already exists. If so, return false so that // user can enter a different unique account name. if (canAdvance && accountNameExists(accountname)) canAdvance = false; @@ -23,25 +23,25 @@ function acctNamePageUnload() { // fix for bug #255473 // allow for multiple RSS accounts. // if our isp.rdf file defines "wizardAutoGenerateUniqueHostname" // we generate a unique hostname until we have one that doesn't exist // for RSS accounts, in rss.rdf, userName, hostName and serverType // default to the same thing, so we need to do this to allow for // multiple RSS accounts. Note, they can all have the same pretty name. - if (gCurrentAccountData && - gCurrentAccountData.wizardAutoGenerateUniqueHostname) + if (gCurrentAccountData && + gCurrentAccountData.wizardAutoGenerateUniqueHostname) { var serverType = parent.getCurrentServerType(pageData); var userName = parent.getCurrentUserName(pageData); var hostName = parent.getCurrentHostname(pageData); var hostNamePref = hostName; var i = 2; - while (parent.AccountExists(userName, hostName, serverType)) + while (parent.AccountExists(userName, hostName, serverType)) { // If "Feeds" exists, try "Feeds-2", then "Feeds-3", etc. hostName = hostNamePref + "-" + i; i++; } setPageData(pageData, "server", "hostname", hostName); } @@ -58,16 +58,16 @@ function acctNamePageInit() var accountNameInput = document.getElementById("prettyName"); if (accountNameInput.value=="") { var pageData = parent.GetPageData(); var type = parent.getCurrentServerType(pageData); var accountName; if (gCurrentAccountData && gCurrentAccountData.wizardAccountName) accountName = gCurrentAccountData.wizardAccountName; - else if (type == "nntp") + else if (type == "nntp") accountName = pageData.newsserver.hostname.value; else accountName = pageData.identity.email.value; accountNameInput.value = accountName; } acctNamePageValidate(); } diff --git a/mailnews/base/prefs/content/aw-accounttype.js b/mailnews/base/prefs/content/aw-accounttype.js --- a/mailnews/base/prefs/content/aw-accounttype.js +++ b/mailnews/base/prefs/content/aw-accounttype.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/. */ -function setAccountTypeData() +function setAccountTypeData() { var rg = document.getElementById("acctyperadio"); var selectedItemId = rg.selectedItem.id; var mail = selectedItemId == "mailaccount"; var news = selectedItemId == "newsaccount"; var pageData = parent.GetPageData(); setPageData(pageData, "accounttype", "mailaccount", mail); @@ -31,17 +31,17 @@ function setupWizardPanels() { if ("testingIspServices" in this) { if ("SetPageMappings" in this && testingIspServices()) { SetPageMappings(document.documentElement.currentPage.id, "done"); } } } var pageData = parent.GetPageData(); - + // We default this to false, even though we could set it to true if we // are going to display the page. However as the accname page will set // it to true for us, we'll just default it to false and not work it out // twice. setPageData(pageData, "accname", "userset", false); // If we need to skip wizardpanels, set the wizard to jump to the // summary page i.e., last page. Otherwise, set the flow based @@ -53,17 +53,17 @@ function setupWizardPanels() { } catch(ex) {} // "done" is the only required panel for all accounts. We used to require an identity panel but not anymore. // initialize wizardPanels with the optional mail/news panels var wizardPanels, i; var isMailAccount = pageData.accounttype.mailaccount; var isNewsAccount = pageData.accounttype.newsaccount; if (skipPanels == "true") // Support old syntax of true/false for wizardSkipPanels - wizardPanels = new Array("identitypage"); + wizardPanels = new Array("identitypage"); else if (isMailAccount && isMailAccount.value) wizardPanels = new Array("identitypage", "incomingpage", "outgoingpage", "accnamepage"); else if (isNewsAccount && isNewsAccount.value) wizardPanels = new Array("identitypage", "newsserver", "accnamepage"); else { // An account created by an extension and XUL overlays var button = document.getElementById("acctyperadio").selectedItem; wizardPanels = button.value.split(/ *, */); } diff --git a/mailnews/base/prefs/content/aw-done.js b/mailnews/base/prefs/content/aw-done.js --- a/mailnews/base/prefs/content/aw-done.js +++ b/mailnews/base/prefs/content/aw-done.js @@ -25,37 +25,37 @@ function donePageInit() { cancelButton.setAttribute("disabled", true); setPageData(pageData, "identity", "email", gEmailAddress); setPageData(pageData, "identity", "fullName", gUserFullName); setPageData(pageData, "login", "username", gScreenName); } } } - + gPrefsBundle = document.getElementById("bundle_prefs"); - var showMailServerDetails = true; + var showMailServerDetails = true; if (currentAccountData) { // find out if we need to hide server details - showMailServerDetails = currentAccountData.showServerDetailsOnWizardSummary; + showMailServerDetails = currentAccountData.showServerDetailsOnWizardSummary; // Change the username field description to email field label in aw-identity if (currentAccountData.emailIDFieldTitle) setUserNameDescField(currentAccountData.emailIDFieldTitle); } // Find out if we need to hide details for incoming servers var hideIncoming = (gCurrentAccountData && gCurrentAccountData.wizardHideIncoming); var email = ""; if (pageData.identity && pageData.identity.email) { // fixup the email email = pageData.identity.email.value; - if (email.split('@').length < 2 && - currentAccountData && + if (email.split('@').length < 2 && + currentAccountData && currentAccountData.domain) email += "@" + currentAccountData.domain; } setDivTextFromForm("identity.email", email); var userName=""; if (pageData.login && pageData.login.username) userName = pageData.login.username.value; @@ -68,27 +68,27 @@ function donePageInit() { // Hide the "username" field if we don't want to show information // on the incoming server. setDivTextFromForm("server.username", hideIncoming ? null : userName); var smtpUserName=""; if (pageData.login && pageData.login.smtpusername) smtpUserName = pageData.login.smtpusername.value; if (!smtpUserName && email) - smtpUserName = getUsernameFromEmail(email, currentAccountData && + smtpUserName = getUsernameFromEmail(email, currentAccountData && currentAccountData.smtpUserNameRequiresDomain); setDivTextFromForm("smtpServer.username", smtpUserName); if (pageData.accname && pageData.accname.prettyName) { // If currentAccountData has a pretty name (e.g. news link or from // isp data) only set the user name with the pretty name if the // pretty name originally came from ispdata - if ((currentAccountData && + if ((currentAccountData && currentAccountData.incomingServer.prettyName) && - (pageData.ispdata && + (pageData.ispdata && pageData.ispdata.supplied && pageData.ispdata.supplied.value)) { // Get the polished account name - if the user has modified the // account name then use that, otherwise use the userName. pageData.accname.prettyName.value = gPrefsBundle.getFormattedString("accountName", [currentAccountData.incomingServer.prettyName, @@ -97,37 +97,37 @@ function donePageInit() { // else just use the default supplied name setDivTextFromForm("account.name", pageData.accname.prettyName.value); } else { setDivTextFromForm("account.name", ""); } // Show mail servers (incoming&outgoing) details - // based on current account data. ISP can set + // based on current account data. ISP can set // rdf value of literal showServerDetailsOnWizardSummary // to false to hide server details if (showMailServerDetails && !serverIsNntp(pageData)) { var incomingServerName=""; if (pageData.server && pageData.server.hostname) { incomingServerName = pageData.server.hostname.value; - if (!incomingServerName && - currentAccountData && + if (!incomingServerName && + currentAccountData && currentAccountData.incomingServer.hostname) incomingServerName = currentAccountData.incomingServer.hostName; } // Hide the incoming server name field if the user specified // wizardHideIncoming in the ISP defaults file setDivTextFromForm("server.name", hideIncoming ? null : incomingServerName); setDivTextFromForm("server.port", pageData.server.port ? pageData.server.port.value : null); var incomingServerType=""; if (pageData.server && pageData.server.servertype) { incomingServerType = pageData.server.servertype.value; - if (!incomingServerType && - currentAccountData && + if (!incomingServerType && + currentAccountData && currentAccountData.incomingServer.type) incomingServerType = currentAccountData.incomingServer.type; } setDivTextFromForm("server.type", incomingServerType.toUpperCase()); var smtpServerName=""; if (pageData.server && pageData.server.smtphostname) { let smtpServer = MailServices.smtp.defaultServer; @@ -176,17 +176,17 @@ function hideShowDownloadMsgsUI(isPop) if (isPop) { if (!Services.io.offline) { if (window.opener.location.href == "chrome://messenger/content/messenger.xul") { downloadMsgs.hidden = false; return; } } } - + // else hide it downloadMsgs.hidden = true; } function setDivTextFromForm(divid, value) { // collapse the row if the div has no value var div = document.getElementById(divid); diff --git a/mailnews/base/prefs/content/aw-identity.js b/mailnews/base/prefs/content/aw-identity.js --- a/mailnews/base/prefs/content/aw-identity.js +++ b/mailnews/base/prefs/content/aw-identity.js @@ -38,17 +38,17 @@ function identityPageUnload() var name = document.getElementById("fullName").value; let email = document.getElementById("email").value.trim(); setPageData(pageData, "identity", "fullName", name); setPageData(pageData, "identity", "email", email); return true; } -// This is for the case when the code appends the domain +// This is for the case when the code appends the domain // unnecessarily. // This simply gets rid of "@domain" from "foo@domain" function fixPreFilledEmail() { var emailElement = document.getElementById("email"); var email = emailElement.value; var emailArray = email.split('@'); @@ -64,32 +64,32 @@ function fixPreFilledEmail() /** * This function checks for common illegal characters. * It shouldn't be too strict, since we do more extensive tests later. */ function emailNameIsLegal(aString) { return aString && !/[^!-?A-~]/.test(aString); -} +} function emailNameAndDomainAreLegal(aString) { return /^[!-?A-~]+\@[A-Za-z0-9.-]+$/.test(aString); } function identityPageInit() { gCurrentDomain = null; gPrefsBundle = document.getElementById("bundle_prefs"); clearEmailTextItems(); setEmailDescriptionText(); checkForDomain(); - checkForFullName(); - checkForEmail(); + checkForFullName(); + checkForEmail(); fixPreFilledEmail(); identityPageValidate(); } function clearEmailTextItems() { var emailDescText = document.getElementById("emailDescText"); @@ -97,32 +97,32 @@ function clearEmailTextItems() emailDescText.firstChild.remove(); var postEmailText = document.getElementById("postEmailText"); postEmailText.setAttribute("value", ""); postEmailText.hidden = true; } // Use email example data that ISP has provided. ISP data, if avaialble -// for the choice user has made, will be read into CurrentAccountData. -// Default example data from properties will be used when the info is missing. +// for the choice user has made, will be read into CurrentAccountData. +// Default example data from properties will be used when the info is missing. function setEmailDescriptionText() { var emailDescText = document.getElementById("emailDescText"); var emailFieldLabel = document.getElementById("emailFieldLabel"); var currentAccountData = parent.gCurrentAccountData; - + var displayText = null; var emailFieldLabelData = null; - var setDefaultEmailDescStrings = true; + var setDefaultEmailDescStrings = true; // Set the default field label emailFieldLabel.setAttribute("value", gPrefsBundle.getString("emailFieldText")); - // Get values for customized data from current account + // Get values for customized data from current account if (currentAccountData) { var emailProvider = currentAccountData.emailProviderName; var sampleEmail = currentAccountData.sampleEmail; var sampleUserName = currentAccountData.sampleUserName; var emailIDDesc = currentAccountData.emailIDDescription; var emailIDTitle = currentAccountData.emailIDFieldTitle; @@ -139,34 +139,34 @@ function setEmailDescriptionText() sampleEmail, sampleUserName]); // Set emailfield label emailFieldLabelData = emailIDTitle; emailFieldLabel.setAttribute("value", emailFieldLabelData); // Need to display customized data. Turn off default settings. - setDefaultEmailDescStrings = false; + setDefaultEmailDescStrings = false; } } if (setDefaultEmailDescStrings) { // Check for obtained values and set with default values if needed - var username = gPrefsBundle.getString("exampleEmailUserName"); - var domain = gPrefsBundle.getString("exampleEmailDomain"); + var username = gPrefsBundle.getString("exampleEmailUserName"); + var domain = gPrefsBundle.getString("exampleEmailDomain"); displayText = gPrefsBundle.getFormattedString("defaultEmailText", [username, domain]); } // Create a text nodes with text to be displayed var emailDescTextNode = document.createTextNode(displayText); - // Display the dynamically generated text for email description + // Display the dynamically generated text for email description emailDescText.appendChild(emailDescTextNode); } // retrieve the current domain from the parent wizard window, // and update the UI to add the @domain static text function checkForDomain() { var accountData = parent.gCurrentAccountData; @@ -188,25 +188,25 @@ function checkForFullName() { name.value = userInfo.fullname; } catch (ex) { // dump ("checkForFullName failed: " + ex + "\n"); } } } -function checkForEmail() +function checkForEmail() { var email = document.getElementById("email"); var pageData = parent.GetPageData(); if (pageData && pageData.identity && pageData.identity.email) { email.value = pageData.identity.email.value; } if (email.value=="") { try { var userInfo = Cc["@mozilla.org/userinfo;1"].getService(Ci.nsIUserInfo); email.value = userInfo.emailAddress; } catch (ex) { - // dump ("checkForEmail failed: " + ex + "\n"); + // dump ("checkForEmail failed: " + ex + "\n"); } } } diff --git a/mailnews/base/prefs/content/aw-incoming.js b/mailnews/base/prefs/content/aw-incoming.js --- a/mailnews/base/prefs/content/aw-incoming.js +++ b/mailnews/base/prefs/content/aw-incoming.js @@ -70,47 +70,47 @@ function incomingPageInit() { var newsServer = document.getElementById("newsServer"); var pageData = parent.GetPageData(); try { newsServer.value = pageData.newsserver.hostname.value; } catch (ex){} } - + gHideIncoming = false; if (gCurrentAccountData && gCurrentAccountData.wizardHideIncoming) gHideIncoming = true; - + var incomingServerbox = document.getElementById("incomingServerbox"); var serverTypeBox = document.getElementById("serverTypeBox"); if (incomingServerbox && serverTypeBox) { if (gHideIncoming) { incomingServerbox.setAttribute("hidden", "true"); serverTypeBox.setAttribute("hidden", "true"); } else { incomingServerbox.removeAttribute("hidden"); serverTypeBox.removeAttribute("hidden"); } } - + // Server type selection (pop3 or imap) is for mail accounts only var pageData = parent.GetPageData(); var isMailAccount = pageData.accounttype.mailaccount.value; var isOtherAccount = pageData.accounttype.otheraccount.value; if (isMailAccount && !gHideIncoming) { var serverTypeRadioGroup = document.getElementById("servertype"); - /* + /* * Check to see if the radiogroup has any value. If there is no * value, this must be the first time user visting this page in the - * account setup process. So, the default is set to pop3. If there - * is a value (it's used automatically), user has already visited - * page and server type selection is done. Once user visits the page, - * the server type value from then on will persist (whether the selection + * account setup process. So, the default is set to pop3. If there + * is a value (it's used automatically), user has already visited + * page and server type selection is done. Once user visits the page, + * the server type value from then on will persist (whether the selection * came from the default or the user action). */ if (!serverTypeRadioGroup.value) { /* * if server type was set to imap in isp data, then * we preset the server type radio group accordingly, * otherwise, use pop3 as the default. */ @@ -146,17 +146,17 @@ function incomingPageInit() { if (gProtocolInfo.requiresUsername) { // since we require a username, use the uid from the email address loginNameInput.value = parent.getUsernameFromEmail(pageData.identity.email.value, gCurrentAccountData && gCurrentAccountData.incomingServerUserNameRequiresDomain); } } incomingPageValidate(); } - + function setServerType() { var pageData = parent.GetPageData(); var serverType = document.getElementById("servertype").value; var deferStorageBox = document.getElementById("deferStorageBox"); var leaveMessages = document.getElementById("leaveMsgsOnSrvrBox"); var port = serverType == "pop3" ? 110 : 143; diff --git a/mailnews/base/prefs/content/aw-outgoing.js b/mailnews/base/prefs/content/aw-outgoing.js --- a/mailnews/base/prefs/content/aw-outgoing.js +++ b/mailnews/base/prefs/content/aw-outgoing.js @@ -132,20 +132,20 @@ function hideShowLoginSettings(aEle, bEl } var savedPassword=""; function onSavePassword(target) { dump("savePassword changed! (" + target.checked + ")\n"); var passwordField = document.getElementById("server.password"); if (!passwordField) return; - + if (target.checked) { passwordField.removeAttribute("disabled"); passwordField.value = savedPassword; } else { passwordField.setAttribute("disabled", "true"); savedPassword = passwordField.value; passwordField.value = ""; } - + } diff --git a/mailnews/base/prefs/content/ispUtils.js b/mailnews/base/prefs/content/ispUtils.js --- a/mailnews/base/prefs/content/ispUtils.js +++ b/mailnews/base/prefs/content/ispUtils.js @@ -21,35 +21,35 @@ var ispDefaults; var nsIRDFResource = Ci.nsIRDFResource; var nsIRDFLiteral = Ci.nsIRDFLiteral; var ispRoot = rdf.GetResource("NC:ispinfo"); // given an ISP's domain URI, look up all relevant information about it function getIspDefaultsForUri(domainURI) { - if (!ispDefaults) + if (!ispDefaults) ispDefaults = rdf.GetDataSource("rdf:ispdefaults"); var domainRes = rdf.GetResource(domainURI); var result = dataSourceToObject(ispDefaults, domainRes); if (!result) return null; - // The domainURI should be in the format domain:example.com. (Where + // The domainURI should be in the format domain:example.com. (Where // example.com is the domain name to use for all email addresses). If // it does not match this pattern, then it is possible no domain // has been specified, so we should leave it uninitialized. if (domainURI.startsWith("domain:")) { // add this extra attribute which is the domain itself var domainData = domainURI.split(':'); if (domainData.length > 1) { // To faciltate distributing two different account types for one ISP, - // it's possible to add parameters to the domain URI + // it's possible to add parameters to the domain URI // - e.g. domain:example.com?type=imap. // This is necessary so RDF doesn't think they're the same. // Save the domain, but only the part up to the (possible) question mark. result.domain = domainData[1].replace(/\?.*/, ""); } } return result; @@ -57,17 +57,17 @@ function getIspDefaultsForUri(domainURI) // construct an ISP's domain URI based on it's domain // (i.e. turns example.com -> domain:example.com) function getIspDefaultsForDomain(domain) { let domainURI = "domain:" + domain; return getIspDefaultsForUri(domainURI); } -// Given an email address (like "joe@example.com") look up +// Given an email address (like "joe@example.com") look up function getIspDefaultsForEmail(email) { var emailData = getEmailInfo(email); var ispData = null; if (emailData) ispData = getIspDefaultsForDomain(emailData.domain); diff --git a/mailnews/base/search/content/CustomHeaders.js b/mailnews/base/search/content/CustomHeaders.js --- a/mailnews/base/search/content/CustomHeaders.js +++ b/mailnews/base/search/content/CustomHeaders.js @@ -138,17 +138,17 @@ function duplicateHdrExists(hdr) { for (var i = 0;i < gArrayHdrs.length; i++) { if (gArrayHdrs[i] == hdr) return true; } return false; } - + function onRemoveHeader() { var listitem = gHdrsList.selectedItems[0] if (!listitem) return; listitem.remove(); var selectedHdr = GetListItemAttributeStr(listitem); var j=0; for (var i = 0; i < gArrayHdrs.length; i++) diff --git a/mailnews/base/search/content/FilterEditor.js b/mailnews/base/search/content/FilterEditor.js --- a/mailnews/base/search/content/FilterEditor.js +++ b/mailnews/base/search/content/FilterEditor.js @@ -810,17 +810,17 @@ function updateFilterType() // set valid actions var ruleActions = gFilterActionList.getElementsByAttribute('class', 'ruleaction'); for (var i = 0; i < ruleActions.length; i++) ruleActions[i].mRuleActionType.hideInvalidActions(); } // Given a filter type, set the global search scope to the filter scope -function setFilterScope(aFilterType, aFilterList) +function setFilterScope(aFilterType, aFilterList) { let filterScope = getFilterScope(getScopeFromFilterList(aFilterList), aFilterType, aFilterList); setSearchScope(filterScope); } // // Given the base filter scope for a server, and the filter diff --git a/mailnews/base/search/content/searchTermOverlay.js b/mailnews/base/search/content/searchTermOverlay.js --- a/mailnews/base/search/content/searchTermOverlay.js +++ b/mailnews/base/search/content/searchTermOverlay.js @@ -5,17 +5,17 @@ var gTotalSearchTerms=0; var gSearchTermList; var gSearchTerms = new Array; var gSearchRemovedTerms = new Array; var gSearchScope; var gSearchBooleanRadiogroup; -var gUniqueSearchTermCounter = 0; // gets bumped every time we add a search term so we can always +var gUniqueSearchTermCounter = 0; // gets bumped every time we add a search term so we can always // dynamically generate unique IDs for the terms. // cache these so we don't have to hit the string bundle for them var gMoreButtonTooltipText; var gLessButtonTooltipText; var gLoading = true; @@ -110,17 +110,17 @@ searchTermContainer.prototype = { searchTerm.attrib = nsMsgSearchAttrib.Custom; searchTerm.customId = this.searchattribute.value; } else { searchTerm.attrib = this.searchattribute.value; } - if (this.searchattribute.value > nsMsgSearchAttrib.OtherHeader && this.searchattribute.value < nsMsgSearchAttrib.kNumMsgSearchAttributes) + if (this.searchattribute.value > nsMsgSearchAttrib.OtherHeader && this.searchattribute.value < nsMsgSearchAttrib.kNumMsgSearchAttributes) searchTerm.arbitraryHeader = this.searchattribute.label; searchTerm.op = this.searchoperator.value; if (this.searchvalue.value) this.searchvalue.save(); else this.searchvalue.saveTo(searchTerm.value); searchTerm.value = this.searchvalue.value; searchTerm.booleanAnd = this.booleanAnd; @@ -130,45 +130,45 @@ searchTermContainer.prototype = { saveTo: function(searchTerm) { this.internalSearchTerm = searchTerm; this.save(); } } var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm; -function initializeSearchWidgets() -{ +function initializeSearchWidgets() +{ gSearchBooleanRadiogroup = document.getElementById("booleanAndGroup"); gSearchTermList = document.getElementById("searchTermList"); // initialize some strings var bundle = document.getElementById('bundle_search'); gMoreButtonTooltipText = bundle.getString('moreButtonTooltipText'); gLessButtonTooltipText = bundle.getString('lessButtonTooltipText'); } -function initializeBooleanWidgets() +function initializeBooleanWidgets() { var booleanAnd = true; var matchAll = false; // get the boolean value from the first term var firstTerm = gSearchTerms[0].searchTerm; if (firstTerm) { // If there is a second term, it should actually define whether we're // using 'and' or not. Note that our UI is not as rich as the // underlying search model, so there's the potential to lose here when // grouping is involved. booleanAnd = (gSearchTerms.length > 1) ? gSearchTerms[1].searchTerm.booleanAnd : firstTerm.booleanAnd; matchAll = firstTerm.matchAll; } // target radio items have value="and" or value="or" or "all" - gSearchBooleanRadiogroup.value = matchAll + gSearchBooleanRadiogroup.value = matchAll ? "matchAll" : (booleanAnd ? "and" : "or") var searchTerms = document.getElementById("searchTermList"); if (searchTerms) updateSearchTermsListbox(matchAll); } function initializeSearchRows(scope, searchTerms) @@ -211,61 +211,61 @@ function updateSearchTermsListbox(matchA // enables/disables the less button for the first row of search terms. function updateRemoveRowButton() { var firstListItem = gSearchTermList.getItemAtIndex(0); if (firstListItem) firstListItem.lastChild.lastChild.setAttribute("disabled", gTotalSearchTerms == 1); } - + // Returns the actual list item row index in the list of search rows // that contains the passed in element id. function getSearchRowIndexForElement(aElement) { var listItem = aElement; - + while (listItem && listItem.localName != "listitem") listItem = listItem.parentNode; - + return gSearchTermList.getIndexOfItem(listItem); } function onMore(event) { // if we have an event, extract the list row index and use that as the row number // for our insertion point. If there is no event, append to the end.... - var rowIndex; + var rowIndex; if (event) rowIndex = getSearchRowIndexForElement(event.target) + 1; else rowIndex = gSearchTermList.getRowCount(); createSearchRow(rowIndex, gSearchScope, null, event != null); gTotalSearchTerms++; updateRemoveRowButton(); // the user just added a term, so scroll to it gSearchTermList.ensureIndexIsVisible(rowIndex); } function onLess(event) { - if (event && gTotalSearchTerms > 1) + if (event && gTotalSearchTerms > 1) { - removeSearchRow(getSearchRowIndexForElement(event.target)); + removeSearchRow(getSearchRowIndexForElement(event.target)); --gTotalSearchTerms; } updateRemoveRowButton(); } // set scope on all visible searchattribute tags -function setSearchScope(scope) +function setSearchScope(scope) { gSearchScope = scope; for (var i = 0; i < gSearchTerms.length; i++) { // don't set element attributes if XBL hasn't loaded if (!(gSearchTerms[i].obj.searchattribute.searchScope === undefined)) { gSearchTerms[i].obj.searchattribute.searchScope = scope; @@ -273,17 +273,17 @@ function setSearchScope(scope) gSearchTerms[i].obj.searchattribute.onSelect(null /* no event */); } gSearchTerms[i].scope = scope; } } function updateSearchAttributes() { - for (var i=0; i' + '' + ''; var domParser = new DOMParser(); var config = xmlReader.readFromXML(JXON.build( domParser.parseFromString(clientConfigXML, "text/xml"))); - xmlReader.replaceVariables(config, + xmlReader.replaceVariables(config, "Yamato Nadeshiko", "yamato.nadeshiko@example.com", "abc12345"); assert_equal_config(config.incoming.username, "yamato.nadeshiko", "incoming server username"); assert_equal_config(config.outgoing.username, @@ -253,17 +253,17 @@ function test_replaceVariables() "pop.example.com", "incoming server hostname"); assert_equal_config(config.outgoing.hostname, "smtp.example.com", "outgoing server hostname"); assert_equal_config(config.identity.realname, "Yamato Nadeshiko", "user real name"); - assert_equal_config(config.identity.emailAddress, + assert_equal_config(config.identity.emailAddress, "yamato.nadeshiko@example.com", "user email address"); } function run_test() { if (!xmlReader) { diff --git a/mailnews/base/test/unit/test_bccInDatabase.js b/mailnews/base/test/unit/test_bccInDatabase.js --- a/mailnews/base/test/unit/test_bccInDatabase.js +++ b/mailnews/base/test/unit/test_bccInDatabase.js @@ -9,17 +9,17 @@ Cu.import("resource:///modules/mailServices.js"); var hdr; function run_test() { localAccountUtils.loadLocalMailAccount(); - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); }, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { continueTest();} diff --git a/mailnews/base/test/unit/test_bug366491.js b/mailnews/base/test/unit/test_bug366491.js --- a/mailnews/base/test/unit/test_bug366491.js +++ b/mailnews/base/test/unit/test_bug366491.js @@ -18,18 +18,18 @@ var kGood = MailServices.junk.GOOD; /* * This test is not intended to check the spam calculations, * but only that the junk percent is transmitted (particularly * for intermediate values). The test * junkPercent values below were calculated by the plugin, * not indepedently verified. */ - -var tests = + +var tests = [ {fileName: "ham2.eml", junkPercent: 8}, {fileName: "spam2.eml", junkPercent: 81}, ]; var emails = @@ -45,17 +45,17 @@ function run_test() { localAccountUtils.loadLocalMailAccount(); do_test_pending(); doTestingListener.onMessageClassified(null, null, null); return true; }; var haveClassification = false; -var doTestingListener = +var doTestingListener = { onMessageClassified: function(aMsgURI, aClassification, aJunkPercent) { // Do we have more training emails? If so, train var email = emails.shift(); if (email) { MailServices.junk.setMessageClassification(getSpec(email.fileName), diff --git a/mailnews/base/test/unit/test_bug428427.js b/mailnews/base/test/unit/test_bug428427.js --- a/mailnews/base/test/unit/test_bug428427.js +++ b/mailnews/base/test/unit/test_bug428427.js @@ -19,28 +19,28 @@ var hdrs = []; var messageCount = 5; // tag used with test messages var tag1 = "istag"; function run_test() { localAccountUtils.loadLocalMailAccount(); - + // Get messageCount messages into the local filestore. do_test_pending(); // function setupVirtualFolder() continues the testing after CopyFileMessage. MailServices.copy.CopyFileMessage(bugmail1, localAccountUtils.inboxFolder, null, false, 0, "", copyListener, null); return true; } // nsIMsgCopyServiceListener implementation -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { hdrs.push(localAccountUtils.inboxFolder.GetMessageHeader(aKey)); }, SetMessageId: function(aMessageId) {}, @@ -53,25 +53,25 @@ var copyListener = try { setupVirtualFolder(); } catch (ex) {dump(ex);} } } }; var virtualFolder; -var numTotalMessages; +var numTotalMessages; var numUnreadMessages; // virtual folder setup function setupVirtualFolder() { // add as valid tag tag1, though probably not really necessary MailServices.tags.addTagForKey(tag1, tag1, null, null); - + // add tag1 to 4 messages var messages0to3 = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); for (var i = 0; i <= 3; i++) messages0to3.appendElement(hdrs[i], false); localAccountUtils.inboxFolder.addKeywordsToMessages(messages0to3, tag1); // set 3 messages unread, 2 messages read var messages0to2 = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); @@ -82,85 +82,85 @@ function setupVirtualFolder() var messages3to4 = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); for (i = 3; i <= 4; i++) messages3to4.appendElement(hdrs[i], false); localAccountUtils.inboxFolder.markMessagesRead(messages3to4, true); // search will look for tag tag1 in the inbox folder var searchTerm = makeSearchTerm(localAccountUtils.inboxFolder, tag1, Ci.nsMsgSearchAttrib.Keywords, Ci.nsMsgSearchOp.Contains); - + dump("creating virtual folder\n"); var rootFolder = localAccountUtils.incomingServer.rootMsgFolder; virtualFolder = CreateVirtualFolder("VfTest", rootFolder, localAccountUtils.inboxFolder.URI, searchTerm, false); var count= new Object; // Setup search session. Execution continues with testVirtualFolder() // after search is done. - + var searchSession = Cc["@mozilla.org/messenger/searchSession;1"] .createInstance(Ci.nsIMsgSearchSession); searchSession.addScopeTerm(Ci.nsMsgSearchScope.offlineMail, localAccountUtils.inboxFolder); searchSession.appendTerm(searchTerm, false); searchSession.registerListener(searchListener); dump("starting search of vf\n"); searchSession.search(null); } // partially based on gSearchNotificationListener in searchBar.js // nsIMsgSearchNotify implementation var searchListener = -{ - onNewSearch: function() +{ + onNewSearch: function() { dump("in onnewsearch\n"); numTotalMessages = 0; numUnreadMessages = 0; }, onSearchHit: function(dbHdr, folder) { print("Search hit, isRead is " + dbHdr.isRead); numTotalMessages++; if (!dbHdr.isRead) numUnreadMessages++; }, onSearchDone: function(status) - { + { print("Finished search hitCount = " + numTotalMessages); var db = virtualFolder.msgDatabase; var dbFolderInfo = db.dBFolderInfo; dbFolderInfo.numMessages = numTotalMessages; dbFolderInfo.numUnreadMessages = numUnreadMessages; virtualFolder.updateSummaryTotals(true); print("virtual folder unread is " + virtualFolder.getNumUnread(false)); testVirtualFolder(); } }; function testVirtualFolder() { /*** basic functionality tests ***/ - + // total messages matching search do_check_eq(4, virtualFolder.getTotalMessages(false)); - + // total unread messages in search do_check_eq(3, virtualFolder.getNumUnread(false)); // change unread of one item in search to decrease count var message0 = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); message0.appendElement(hdrs[0], false); localAccountUtils.inboxFolder.markMessagesRead(message0, true); virtualFolder.updateSummaryTotals(true); do_check_eq(2, virtualFolder.getNumUnread(false)); - + /*** failures fixed in this bug ***/ - + // remove tag from one item to decrease count var message1 = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); message1.appendElement(hdrs[1], false); localAccountUtils.inboxFolder.removeKeywordsFromMessages(message1, tag1); virtualFolder.updateSummaryTotals(true); do_check_eq(3, virtualFolder.getTotalMessages(false)); do_check_eq(1, virtualFolder.getNumUnread(false)); @@ -177,17 +177,17 @@ function testVirtualFolder() // adapted from commandglue.js function CreateVirtualFolder(newName, parentFolder, searchFolderURIs, searchTerm, searchOnline) { var newFolder = parentFolder.addSubfolder(newName); newFolder.setFlag(Ci.nsMsgFolderFlags.Virtual); var vfdb = newFolder.msgDatabase; var searchTerms = []; var searchTermString = getSearchTermString(searchTerm); - + var dbFolderInfo = vfdb.dBFolderInfo; // set the view string as a property of the db folder info // set the original folder name as well. dbFolderInfo.setCharProperty("searchStr", searchTermString); dbFolderInfo.setCharProperty("searchFolderUri", searchFolderURIs); dbFolderInfo.setBooleanProperty("searchOnline", searchOnline); // This fails because the folder doesn't exist - why were we doing it? // vfdb.summaryValid = true; @@ -197,20 +197,20 @@ function CreateVirtualFolder(newName, pa //print(acctMgr); acctMgr.OnItemAdded(null, newFolder); return newFolder; } function getSearchTermString(term) { var condition = ""; - + if (condition.length > 1) condition += ' '; - + if (term.matchAll) condition = "ALL"; condition += (term.booleanAnd) ? "AND (" : "OR ("; condition += term.termAsString + ')'; return condition; } // Create a search term for searching aFolder diff --git a/mailnews/base/test/unit/test_bug434810.js b/mailnews/base/test/unit/test_bug434810.js --- a/mailnews/base/test/unit/test_bug434810.js +++ b/mailnews/base/test/unit/test_bug434810.js @@ -1,12 +1,12 @@ /* 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 setup of localMailFolders Cu.import("resource://gre/modules/Services.jsm"); function run_test() { localAccountUtils.loadLocalMailAccount(); diff --git a/mailnews/base/test/unit/test_bug465805.js b/mailnews/base/test/unit/test_bug465805.js --- a/mailnews/base/test/unit/test_bug465805.js +++ b/mailnews/base/test/unit/test_bug465805.js @@ -15,17 +15,17 @@ var nsMsgSearchOp = Ci.nsMsgSearchOp; var Contains = nsMsgSearchOp.Contains; var offlineMail = nsMsgSearchScope.offlineMail; var offlineMailFilter = nsMsgSearchScope.offlineMailFilter; var Body = nsMsgSearchAttrib.Body; -var Files = +var Files = [ "../../../data/bugmail1", "../../../data/bodySearchCrash" ] var Tests = [ @@ -42,27 +42,27 @@ function run_test() localAccountUtils.loadLocalMailAccount(); // Get a message into the local filestore. function testBodySearch() continues the testing after the copy. do_test_pending(); copyListener.OnStopCopy(null); return true; } -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, - OnStopCopy: function(aStatus) + OnStopCopy: function(aStatus) { let fileName = Files.shift(); if (fileName) - { + { let file = do_get_file(fileName); MailServices.copy.CopyFileMessage(file, localAccountUtils.inboxFolder, null, false, 0, "", copyListener, null); } else testBodySearch(); } }; diff --git a/mailnews/base/test/unit/test_bug471682.js b/mailnews/base/test/unit/test_bug471682.js --- a/mailnews/base/test/unit/test_bug471682.js +++ b/mailnews/base/test/unit/test_bug471682.js @@ -30,17 +30,17 @@ function run_test() MailServices.copy.CopyFileMessage(bugmail1, localAccountUtils.inboxFolder, null, false, 0, "", step2, null); return; } // step 2: copy one message into a subfolder to establish an // mbox file time and size // nsIMsgCopyServiceListener implementation -var step2 = +var step2 = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { dump("in set message key\n"); gHdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); }, @@ -54,17 +54,17 @@ var step2 = MailServices.copy.CopyMessages(localAccountUtils.inboxFolder, messages, gSubfolder, false, step3, null, false); } }; // step 3: after the copy, delay to allow copy to complete and allow possible // file error time // nsIMsgCopyServiceListener implementation -var step3 = +var step3 = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { do_timeout(2000, step4); @@ -77,17 +77,17 @@ function step4() var messages = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); messages.appendElement(gHdr, false); MailServices.copy.CopyMessages(localAccountUtils.inboxFolder, messages, gSubfolder, false, step5, null, false); } // step 5: actual tests of file size and date // nsIMsgCopyServiceListener implementation -var step5 = +var step5 = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { var dbSize = gSubfolder.msgDatabase.dBFolderInfo.folderSize; diff --git a/mailnews/base/test/unit/test_bug514945.js b/mailnews/base/test/unit/test_bug514945.js --- a/mailnews/base/test/unit/test_bug514945.js +++ b/mailnews/base/test/unit/test_bug514945.js @@ -1,18 +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/. */ /* * Testing of GetAvailable crashes in bug 514945 */ - + function run_test() -{ +{ const kValidityManager = Cc['@mozilla.org/mail/search/validityManager;1'] .getService(Ci.nsIMsgSearchValidityManager); let validityTable = kValidityManager.getTable(Ci.nsMsgSearchScope.offlineMail); // When we try to access a bad value of getAvailable, it should give an error, // not crash. let BAD_VALUE = 1000000; // some large value that is beyond the array bounds diff --git a/mailnews/base/test/unit/test_compactColumnSave.js b/mailnews/base/test/unit/test_compactColumnSave.js --- a/mailnews/base/test/unit/test_compactColumnSave.js +++ b/mailnews/base/test/unit/test_compactColumnSave.js @@ -52,17 +52,17 @@ function checkPersistentState(folder) { let dbFolderInfo = msgDatabase.dBFolderInfo; let state = dbFolderInfo.getCharProperty(this.PERSISTED_COLUMN_PROPERTY_NAME); do_check_eq(state, columnJSON); do_timeout(0, function(){doTest(++gCurTestNum);}); } // nsIMsgCopyServiceListener implementation -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { try { let hdr = gLocalFolder2.GetMessageHeader(aKey); gMsgHdrs.push({hdr: hdr, ID: hdr.messageId}); @@ -105,17 +105,17 @@ function copyFileMessage(file, destFolde } function deleteMessages(srcFolder, items) { var array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); items.forEach(function (item) { array.appendElement(item, false); }); - + srcFolder.deleteMessages(array, null, false, true, copyListener, true); } /* * TESTS */ // Beware before commenting out a test -- later tests might just depend on earlier ones diff --git a/mailnews/base/test/unit/test_copyChaining.js b/mailnews/base/test/unit/test_copyChaining.js --- a/mailnews/base/test/unit/test_copyChaining.js +++ b/mailnews/base/test/unit/test_copyChaining.js @@ -91,17 +91,17 @@ function endTest() { // Cleanup, null out everything dump(" Exiting mail tests\n"); gMsgEnumerator = null; do_test_finished(); // for the one in run_test() } // nsIMsgCopyServiceListener implementation -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { // Check: message successfully copied. diff --git a/mailnews/base/test/unit/test_emptyTrash.js b/mailnews/base/test/unit/test_emptyTrash.js --- a/mailnews/base/test/unit/test_emptyTrash.js +++ b/mailnews/base/test/unit/test_emptyTrash.js @@ -23,17 +23,17 @@ var gLocalTrashFolder; var gCurTestNum; var gMsgHdrs = new Array(); var gRootFolder; var nsIMFNService = Ci.nsIMsgFolderNotificationService; var nsIMFListener = Ci.nsIMsgFolderListener; // nsIMsgCopyServiceListener implementation -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { let hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); gMsgHdrs.push({hdr: hdr, ID: hdr.messageId}); }, @@ -71,17 +71,17 @@ function copyFileMessage(file, destFolde } function deleteMessages(srcFolder, items) { var array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); items.forEach(function (item) { array.appendElement(item, false); }); - + srcFolder.deleteMessages(array, null, false, true, copyListener, true); } /* * TESTS */ // Beware before commenting out a test -- later tests might just depend on earlier ones @@ -148,17 +148,17 @@ function run_test() doTest(1); } function doTest(test) { if (test <= gTestArray.length) { gCurTestNum = test; - + var testFn = gTestArray[test-1]; // Set a limit of three seconds; if the notifications haven't arrived by then there's a problem. do_timeout(10000, function(){ if (gCurTestNum == test) do_throw("Notifications not received in 10000 ms for operation " + testFn.name); } ); try { diff --git a/mailnews/base/test/unit/test_folderCompact.js b/mailnews/base/test/unit/test_folderCompact.js --- a/mailnews/base/test/unit/test_folderCompact.js +++ b/mailnews/base/test/unit/test_folderCompact.js @@ -25,29 +25,29 @@ Services.prefs.setCharPref("mail.serverD var gMsgFile1, gMsgFile2, gMsgFile3; var gMsg1ID = "200806061706.m56H6RWT004933@mrapp54.mozilla.org"; var gMsg2ID = "200804111417.m3BEHTk4030129@mrapp51.mozilla.org"; var gMsg3ID = "4849BF7B.2030800@example.com"; var gLocalFolder2; var gLocalFolder3; var gLocalTrashFolder; var gCurTestNum; -// After a compact (or other operation), this is what we expect the +// After a compact (or other operation), this is what we expect the // folder size to be. var gExpectedFolderSize; var gMsgHdrs = new Array(); var gExpectedInboxSize; var gExpectedFolder2Size; var gExpectedFolder3Size; // Transfer message keys between function calls. var gMsgKeys = []; // nsIMsgCopyServiceListener implementation -var copyListenerWrap = +var copyListenerWrap = { SetMessageKey: function(aKey) { let hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); gMsgHdrs.push({hdr: hdr, ID: hdr.messageId}); }, OnStopCopy: function(aStatus) { @@ -96,17 +96,17 @@ function copyMessages(items, isMove, src } function deleteMessages(srcFolder, items) { var array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); items.forEach(function (item) { array.appendElement(item, false); }); - + let listener = new PromiseTestUtils.PromiseCopyListener(copyListenerWrap); srcFolder.deleteMessages(array, null, false, true, listener, true); return listener.promise; } function calculateFolderSize(folder) { let msgDB = folder.msgDatabase; diff --git a/mailnews/base/test/unit/test_imapPump.js b/mailnews/base/test/unit/test_imapPump.js --- a/mailnews/base/test/unit/test_imapPump.js +++ b/mailnews/base/test/unit/test_imapPump.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/. */ /** * Simple demonstration of the imap pump test method. */ -// async support +// async support load("../../../resources/logHelper.js"); load("../../../resources/alertTestUtils.js"); Cu.import("resource://testing-common/mailnews/PromiseTestUtils.jsm"); // IMAP pump Cu.import("resource://testing-common/mailnews/IMAPpump.js"); Cu.import("resource://testing-common/mailnews/imapd.js"); @@ -21,17 +21,17 @@ Cu.import("resource://gre/modules/Servic // 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 // load and update a message in the imap fake server -var gTestArray = +var gTestArray = [ // initial setup of IMAP environment setupIMAPPump, // optionally set server parameters, here enabling debug messages function serverParms() { if (typeof fsDebugAll == "undefined") Cu.import("resource://testing-common/mailnews/maild.js"); diff --git a/mailnews/base/test/unit/test_inheritedFolderProperties.js b/mailnews/base/test/unit/test_inheritedFolderProperties.js --- a/mailnews/base/test/unit/test_inheritedFolderProperties.js +++ b/mailnews/base/test/unit/test_inheritedFolderProperties.js @@ -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/. */ /* * Testing of inherited folder properties */ function run_test() -{ +{ localAccountUtils.loadLocalMailAccount(); var rootFolder = localAccountUtils.incomingServer.rootMsgFolder; // add subfolders to the inbox const subFolder11 = localAccountUtils.inboxFolder.createLocalSubfolder("subfolder11") .QueryInterface(Ci.nsIMsgLocalMailFolder); const subFolder12 = localAccountUtils.inboxFolder.createLocalSubfolder("subfolder12") .QueryInterface(Ci.nsIMsgLocalMailFolder); @@ -90,17 +90,17 @@ function run_test() // check with all levels populated subFolder21.setStringProperty(propertyName, folderValue2); localAccountUtils.incomingServer.setCharValue(propertyName, rootValue); do_check_eq(rootFolder.getInheritedStringProperty(propertyName), rootValue); do_check_eq(subFolder11.getInheritedStringProperty(propertyName), folderValue); do_check_eq(subFolder12.getInheritedStringProperty(propertyName), rootValue); do_check_eq(subFolder21.getInheritedStringProperty(propertyName), folderValue2); do_check_eq(subFolder22.getInheritedStringProperty(propertyName), rootValue); - + // clear the global value and the root value Services.prefs.clearUserPref(globalPref); localAccountUtils.incomingServer.setCharValue(propertyName, ""); do_check_eq(rootFolder.getInheritedStringProperty(propertyName), null); do_check_eq(subFolder11.getInheritedStringProperty(propertyName), folderValue); do_check_eq(subFolder12.getInheritedStringProperty(propertyName), null); do_check_eq(subFolder21.getInheritedStringProperty(propertyName), folderValue2); do_check_eq(subFolder22.getInheritedStringProperty(propertyName), null); diff --git a/mailnews/base/test/unit/test_junkWhitelisting.js b/mailnews/base/test/unit/test_junkWhitelisting.js --- a/mailnews/base/test/unit/test_junkWhitelisting.js +++ b/mailnews/base/test/unit/test_junkWhitelisting.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/. */ /* * Testing of junk whitelisting */ - + // add address book setup load("../../../resources/abSetup.js"); // add fake POP3 server driver load("../../../resources/POP3pump.js"); Cu.import("resource:///modules/mailServices.js"); @@ -20,22 +20,22 @@ Cu.import("resource:///modules/mailServi * * Map of test email contents: (P is "Prim...", I is "inva.." address) * * Index Bugmail# From * 0 1 P * 1 3 I * */ - + // indices into hdrs[] of email by domain var kDomainTest = 0; var kDomainExample = 1; -var Files = +var Files = [ "../../../data/bugmail1", "../../../data/bugmail3" ] var hdrs = []; function run_test() diff --git a/mailnews/base/test/unit/test_loadVirtualFolders.js b/mailnews/base/test/unit/test_loadVirtualFolders.js --- a/mailnews/base/test/unit/test_loadVirtualFolders.js +++ b/mailnews/base/test/unit/test_loadVirtualFolders.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/. */ -// Test loading of virtualFolders.dat, including verification of the search +// Test loading of virtualFolders.dat, including verification of the search // scopes, i.e., folder uri's. Cu.import("resource:///modules/mailServices.js"); // As currently written, this test will only work with Berkeley store. Services.prefs.setCharPref("mail.serverDefaultStoreContractID", "@mozilla.org/msgstore/berkeleystore;1"); diff --git a/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js b/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js --- a/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js +++ b/mailnews/base/test/unit/test_nsIMsgFolderListenerLocal.js @@ -330,17 +330,17 @@ function run_test() function doTest(test) { if (test <= gTestArray.length) { var testFn = gTestArray[test-1]; // Set a limit of 10 seconds; if the notifications haven't arrived by then there's a problem. do_timeout(10000, function(){ if (gTest == test) - do_throw("Notifications not received in 10000 ms for operation " + testFn.name + + do_throw("Notifications not received in 10000 ms for operation " + testFn.name + ", current status is " + gCurrStatus); } ); dump("=== Test: " + testFn.name + "\n"); testFn(); } else { diff --git a/mailnews/base/test/unit/test_nsIMsgTagService.js b/mailnews/base/test/unit/test_nsIMsgTagService.js --- a/mailnews/base/test/unit/test_nsIMsgTagService.js +++ b/mailnews/base/test/unit/test_nsIMsgTagService.js @@ -63,17 +63,17 @@ function run_test() do_check_true(MailServices.tags.isValidKey(i)); // make sure it knows the difference betweens tags and keys do_check_false(MailServices.tags.isValidKey("lotsatags" + i)); // are we confused by key at start of tag? do_check_false(MailServices.tags.isValidKey(i + "lotsatags")); } } -/* +/* function printTags() { let tags = MailServices.tags.getAllTags({}); for (var i = 0; i < tags.length; i++) print("# " + i + " key [" + tags[i].key + "] tag [" + tags[i].tag + "]"); } */ diff --git a/mailnews/base/test/unit/test_search.js b/mailnews/base/test/unit/test_search.js --- a/mailnews/base/test/unit/test_search.js +++ b/mailnews/base/test/unit/test_search.js @@ -261,17 +261,17 @@ var Tests = op: IsAfter, count: 0} ]; function run_test() { localAccountUtils.loadLocalMailAccount(); - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { testSearch();} }; diff --git a/mailnews/base/test/unit/test_searchAddressInAb.js b/mailnews/base/test/unit/test_searchAddressInAb.js --- a/mailnews/base/test/unit/test_searchAddressInAb.js +++ b/mailnews/base/test/unit/test_searchAddressInAb.js @@ -51,17 +51,17 @@ var Keywords = nsMsgSearchAttrib.Keyword * 3 I P I N * 4 I I P N * 5 P I P N * 6 I I,P P,I N * 7 I I I P * 8 I P P N * */ - + var Tests = [ { value: ABUri, attrib: Sender, op: IsInAB, count: 3 }, { value: ABUri, attrib: To, @@ -129,17 +129,17 @@ var Tests = count: 6 }, { value: "invalid@example.com", attrib: ToOrCC, op: Isnt, count: 2 }, ]; -var Files = +var Files = [ "../../../data/bugmail1", "../../../data/bugmail2", "../../../data/bugmail3", "../../../data/bugmail4", "../../../data/bugmail5", "../../../data/bugmail6", "../../../data/bugmail7", @@ -147,17 +147,17 @@ var Files = ] var messageKey, hdr; function run_test() { // Setup local mail accounts. localAccountUtils.loadLocalMailAccount(); - + // Test setup - copy the data file into place var testAB = do_get_file("../../../addrbook/test/unit/data/cardForEmail.mab"); // Copy the file to the profile directory for a PAB testAB.copyTo(do_get_profile(), kPABData.fileName); // test that validity table terms are valid @@ -217,17 +217,17 @@ function run_test() testValidityTable(onlineMail, IsntInAB, CCopy, false); testValidityTable(onlineMail, IsntInAB, Keywords, false); testValidityTable(onlineMail, IsBefore, Sender, false); testValidityTable(onlineMail, IsBefore, To, false); testValidityTable(onlineMail, IsBefore, ToOrCC, false); testValidityTable(onlineMail, IsBefore, CCopy, false); testValidityTable(onlineMail, IsBefore, Keywords, false); - // online mail filter + // online mail filter testValidityTable(onlineMailFilter, IsInAB, Sender, true); testValidityTable(onlineMailFilter, IsInAB, To, true); testValidityTable(onlineMailFilter, IsInAB, ToOrCC, true); testValidityTable(onlineMailFilter, IsInAB, CCopy, true); testValidityTable(onlineMailFilter, IsInAB, Keywords, false); testValidityTable(onlineMailFilter, IsntInAB, Sender, true); testValidityTable(onlineMailFilter, IsntInAB, To, true); testValidityTable(onlineMailFilter, IsntInAB, ToOrCC, true); @@ -257,27 +257,27 @@ function run_test() testValidityTable(news, IsBefore, Keywords, false); // Get a message into the local filestore. function testAbSearch() continues the testing after the copy. do_test_pending(); copyListener.OnStopCopy(null); return true; } -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, - OnStopCopy: function(aStatus) + OnStopCopy: function(aStatus) { var fileName = Files.shift(); if (fileName) - { + { var file = do_get_file(fileName); MailServices.copy.CopyFileMessage(file, localAccountUtils.inboxFolder, null, false, 0, "", copyListener, null); } else testAbSearch(); } }; diff --git a/mailnews/base/test/unit/test_searchBody.js b/mailnews/base/test/unit/test_searchBody.js --- a/mailnews/base/test/unit/test_searchBody.js +++ b/mailnews/base/test/unit/test_searchBody.js @@ -217,17 +217,17 @@ function run_test() testValidityTable(onlineMail, Contains, Body, true); testValidityTable(onlineMail, DoesntContain, Body, true); testValidityTable(onlineMail, Is, Body, false); testValidityTable(onlineMail, Isnt, Body, false); testValidityTable(onlineMail, IsEmpty, Body, false); testValidityTable(onlineMail, IsntEmpty, Body, false); testValidityTable(onlineMail, IsBefore, Body, false); - // online mail filter + // online mail filter /*testValidityTable(onlineMailFilter, Contains, Body, true); testValidityTable(onlineMailFilter, DoesntContain, Body, true); testValidityTable(onlineMailFilter, Is, Body, false); testValidityTable(onlineMailFilter, Isnt, Body, false); testValidityTable(onlineMailFilter, IsEmpty, Body, false); testValidityTable(onlineMailFilter, IsntEmpty, Body, false); testValidityTable(onlineMailFilter, IsBefore, Body, false);*/ diff --git a/mailnews/base/test/unit/test_searchBoolean.js b/mailnews/base/test/unit/test_searchBoolean.js --- a/mailnews/base/test/unit/test_searchBoolean.js +++ b/mailnews/base/test/unit/test_searchBoolean.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/. */ /* * Demonstrates and tests the use of grouped boolean expressions in search terms */ - + Cu.import("resource:///modules/mailServices.js"); var gSearchSession = Cc["@mozilla.org/messenger/searchSession;1"] .createInstance(Ci.nsIMsgSearchSession); var gHdr; // the message header for the one mailbox message var Tests = @@ -94,20 +94,20 @@ var Tests = B: true, C: true, D: true, matches: true}, ]; var gHitCount = 0; var searchListener = -{ +{ onSearchHit: function(dbHdr, folder) { gHitCount++; }, onSearchDone: function(status) - { + { testSearch(); }, onNewSearch: function() {gHitCount = 0;} }; function run_test() { localAccountUtils.loadLocalMailAccount(); @@ -144,17 +144,17 @@ function run_test() localAccountUtils.inboxFolder); gSearchSession.registerListener(searchListener); // I tried using capital "A" but something makes it lower case internally, so it failed addSearchTerm("a", true, false, true); // "(A" addSearchTerm("b", false, true, false); // " || B)" addSearchTerm("c", true, false, true); // " && (C" addSearchTerm("d", false, true, false); // " || D)" - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { gHdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); }, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { testSearch();} diff --git a/mailnews/base/test/unit/test_searchChaining.js b/mailnews/base/test/unit/test_searchChaining.js --- a/mailnews/base/test/unit/test_searchChaining.js +++ b/mailnews/base/test/unit/test_searchChaining.js @@ -58,26 +58,26 @@ function *searchTest() yield PromiseTestUtils.promiseDelay(1000); } // nsIMsgSearchNotify implementation var searchListener = { numTotalMessages: 0, QueryInterface: XPCOMUtils.generateQI([Ci.nsIMsgSearchNotify]), - onNewSearch: function() + onNewSearch: function() { this.numTotalMessages = 0; }, onSearchHit: function(dbHdr, folder) { this.numTotalMessages++; }, onSearchDone: function(status) - { + { Assert.equal(this.numTotalMessages, 1); return true; } }; var tests = [ setupIMAPPump, setupFolder, diff --git a/mailnews/base/test/unit/test_searchCustomTerm.js b/mailnews/base/test/unit/test_searchCustomTerm.js --- a/mailnews/base/test/unit/test_searchCustomTerm.js +++ b/mailnews/base/test/unit/test_searchCustomTerm.js @@ -57,17 +57,17 @@ var customTerm = } }; function run_test() { localAccountUtils.loadLocalMailAccount(); MailServices.filters.addCustomTerm(customTerm); - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { gHdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); }, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { doTest();} diff --git a/mailnews/base/test/unit/test_searchJunk.js b/mailnews/base/test/unit/test_searchJunk.js --- a/mailnews/base/test/unit/test_searchJunk.js +++ b/mailnews/base/test/unit/test_searchJunk.js @@ -30,23 +30,23 @@ var fileName = "../../../data/bugmail1"; /* * The search for junkpercent is defined as the effective value, * while the "junkpercent" database term is always the result * from the bayes filter. This is optimized to make views that * rely on junk percent search work with the best value for junk * percent, while allowing junk percent from the bayes filter * to be saved for analysis. * - * This means that the search for "junk percent" only uses the + * This means that the search for "junk percent" only uses the * database junkpercent value if junkscoreorigin is "plugin". * Otherwise, it uses junkstatus (if set) or defaults to 0 * (not junk) if the message is unclassified. */ -var Tests = +var Tests = [ // test empty junk status { junkScore: false, testValue: 90, attrib: JunkStatus, op: IsEmpty, count: 1}, { junkScore: false, @@ -120,17 +120,17 @@ var Tests = count: 0}, { junkScore: "0", junkScoreOrigin: "plugin", junkPercent: "10", testValue: 10, attrib: JunkPercent, op: Is, count: 1}, - + // values set by user, use junkscore not junkpercent { junkScore: "0", junkScoreOrigin: "user", junkPercent: "90", testValue: 50, attrib: JunkPercent, op: IsGreaterThan, count: 0}, @@ -172,17 +172,17 @@ var Tests = // default to 0 when nothing set { junkScore: "", junkScoreOrigin: "", junkPercent: "", testValue: 0, attrib: JunkPercent, op: Is, count: 1}, - + // junkscoreorigin search tests { junkScore: "0", junkScoreOrigin: "plugin", junkPercent: "50", testValue: "plugin", attrib: JunkScoreOrigin, op: Is, count: 1}, @@ -207,17 +207,17 @@ var Tests = attrib: JunkScoreOrigin, op: Isnt, count: 1}, ]; function run_test() { localAccountUtils.loadLocalMailAccount(); - + // test that validity table terms are valid // offline mail table testValidityTable(offlineMail, Is, JunkPercent, true); testValidityTable(offlineMail, Isnt, JunkPercent, false); testValidityTable(offlineMail, IsGreaterThan, JunkPercent, true); testValidityTable(offlineMail, IsLessThan, JunkPercent, true); @@ -230,17 +230,17 @@ function run_test() do_test_pending(); var file = do_get_file(fileName); MailServices.copy.CopyFileMessage(file, localAccountUtils.inboxFolder, null, false, 0, "", copyListener, null); return true; } var hdr; -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey);}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { testJunkSearch();} }; diff --git a/mailnews/base/test/unit/test_searchLocalizationStrings.js b/mailnews/base/test/unit/test_searchLocalizationStrings.js --- a/mailnews/base/test/unit/test_searchLocalizationStrings.js +++ b/mailnews/base/test/unit/test_searchLocalizationStrings.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/. */ - + // tests that localization strings added in bug 484147 are defined in preferences - + Cu.import("resource://gre/modules/Services.jsm"); var gValidityManager = Cc['@mozilla.org/mail/search/validityManager;1'] .getService(Ci.nsIMsgSearchValidityManager); var gStringBundle = Services.strings .createBundle("chrome://messenger/locale/search-attributes.properties"); diff --git a/mailnews/base/test/unit/test_searchTag.js b/mailnews/base/test/unit/test_searchTag.js --- a/mailnews/base/test/unit/test_searchTag.js +++ b/mailnews/base/test/unit/test_searchTag.js @@ -48,17 +48,17 @@ var Tests = // test the valid tag { msgTag: Tag1, testTag: Tag1, op: Is, count: 1 }, { msgTag: Tag1, testTag: Tag1, op: Isnt, - count: 0 }, + count: 0 }, { msgTag: Tag1, testTag: Tag1, op: Contains, count: 1 }, { msgTag: Tag1, testTag: Tag1, op: DoesntContain, count: 0 }, @@ -99,17 +99,17 @@ var Tests = // test first tag { msgTag: Tag1Tag4, testTag: Tag1, op: Is, count: 0 }, { msgTag: Tag1Tag4, testTag: Tag1, op: Isnt, - count: 1 }, + count: 1 }, { msgTag: Tag1Tag4, testTag: Tag1, op: Contains, count: 1 }, { msgTag: Tag1Tag4, testTag: Tag1, op: DoesntContain, count: 0 }, @@ -124,17 +124,17 @@ var Tests = // test second tag { msgTag: Tag1Tag4, testTag: Tag4, op: Is, count: 0 }, { msgTag: Tag1Tag4, testTag: Tag4, op: Isnt, - count: 1 }, + count: 1 }, { msgTag: Tag1Tag4, testTag: Tag4, op: Contains, count: 1 }, { msgTag: Tag1Tag4, testTag: Tag4, op: DoesntContain, count: 0 }, @@ -149,17 +149,17 @@ var Tests = // test tag not in message { msgTag: Tag1Tag4, testTag: Tag2, op: Is, count: 0 }, { msgTag: Tag1Tag4, testTag: Tag2, op: Isnt, - count: 1 }, + count: 1 }, { msgTag: Tag1Tag4, testTag: Tag2, op: Contains, count: 0 }, { msgTag: Tag1Tag4, testTag: Tag2, op: DoesntContain, count: 1 }, @@ -174,17 +174,17 @@ var Tests = // empty message { msgTag: "", testTag: Tag2, op: Is, count: 0 }, { msgTag: "", testTag: Tag2, op: Isnt, - count: 1 }, + count: 1 }, { msgTag: "", testTag: Tag2, op: Contains, count: 0 }, { msgTag: "", testTag: Tag2, op: DoesntContain, count: 1 }, @@ -192,17 +192,17 @@ var Tests = testTag: Tag2, op: IsEmpty, count: 1 }, { msgTag: "", testTag: Tag2, op: IsntEmpty, count: 0 }, // message with two tags, only one is valid - // test with the single valid tag + // test with the single valid tag { msgTag: Tag1Tag3, testTag: Tag1, op: Is, count: 1 }, { msgTag: Tag1Tag3, testTag: Tag1, op: Isnt, count: 0 }, @@ -217,17 +217,17 @@ var Tests = { msgTag: Tag1Tag3, testTag: Tag1, op: IsEmpty, count: 0 }, { msgTag: Tag1Tag3, testTag: Tag1, op: IsntEmpty, count: 1 }, - // test with a tag not in the message + // test with a tag not in the message { msgTag: Tag1Tag3, testTag: Tag2, op: Is, count: 0 }, { msgTag: Tag1Tag3, testTag: Tag2, op: Isnt, count: 1 }, @@ -251,17 +251,17 @@ var Tests = // test the tag { msgTag: Tag1Tag1, testTag: Tag1, op: Is, count: 1 }, { msgTag: Tag1Tag1, testTag: Tag1, op: Isnt, - count: 0 }, + count: 0 }, { msgTag: Tag1Tag1, testTag: Tag1, op: Contains, count: 1 }, { msgTag: Tag1Tag1, testTag: Tag1, op: DoesntContain, count: 0 }, @@ -306,17 +306,17 @@ function run_test() testValidityTable(onlineMail, Contains, Keywords, true); testValidityTable(onlineMail, DoesntContain, Keywords, true); testValidityTable(onlineMail, Is, Keywords, false); testValidityTable(onlineMail, Isnt, Keywords, false); testValidityTable(onlineMail, IsEmpty, Keywords, false); testValidityTable(onlineMail, IsntEmpty, Keywords, false); testValidityTable(onlineMail, IsBefore, Keywords, false); - // online mail filter + // online mail filter testValidityTable(onlineMailFilter, Contains, Keywords, true); testValidityTable(onlineMailFilter, DoesntContain, Keywords, true); testValidityTable(onlineMailFilter, Is, Keywords, true); testValidityTable(onlineMailFilter, Isnt, Keywords, true); testValidityTable(onlineMailFilter, IsEmpty, Keywords, true); testValidityTable(onlineMailFilter, IsntEmpty, Keywords, true); testValidityTable(onlineMailFilter, IsBefore, Keywords, false); @@ -333,17 +333,17 @@ function run_test() let tagArray = MailServices.tags.getAllTags({}); for (var i = 0; i < tagArray.length; i++) MailServices.tags.deleteKey(tagArray[i].key); // add as valid tags Tag1 and Tag4 MailServices.tags.addTagForKey(Tag1, Tag1, null, null); MailServices.tags.addTagForKey(Tag4, Tag4, null, null); - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); }, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { testKeywordSearch();} diff --git a/mailnews/base/test/unit/test_searchUint32HdrProperty.js b/mailnews/base/test/unit/test_searchUint32HdrProperty.js --- a/mailnews/base/test/unit/test_searchUint32HdrProperty.js +++ b/mailnews/base/test/unit/test_searchUint32HdrProperty.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/. */ /* * Testing of Uint32HdrProperty search attribute. Adapted from test_search.js */ - + load("../../../resources/searchTestUtils.js"); Cu.import("resource:///modules/mailServices.js"); var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib; var nsMsgSearchOp = Ci.nsMsgSearchOp; var Isnt = nsMsgSearchOp.Isnt; @@ -70,17 +70,17 @@ var Tests = value: 17, count: 0 }, ]; function run_test() { localAccountUtils.loadLocalMailAccount(); - var copyListener = + var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus) { testSearch();} }; diff --git a/mailnews/base/util/JXON.js b/mailnews/base/util/JXON.js --- a/mailnews/base/util/JXON.js +++ b/mailnews/base/util/JXON.js @@ -15,17 +15,17 @@ var JXON = new (function() { const sConflictSuffix = "_"; // used when there's a name conflict with special JXON properties const aCache = []; const rIsNull = /^\s*$/; const rIsBool = /^(?:true|false)$/i; function parseText(sValue) { //if (rIsNull.test(sValue)) // return null; - if (rIsBool.test(sValue)) + if (rIsBool.test(sValue)) return sValue.toLowerCase() === "true"; if (isFinite(sValue)) return parseFloat(sValue); if (isFinite(Date.parse(sValue))) return new Date(sValue); return sValue; }; @@ -61,17 +61,17 @@ var JXON = new (function() { var nLength = 0; var sCollectedTxt = ""; var vResult = bHighVerb ? {} : /* put here the default value for empty nodes: */ true; if (bChildren) { for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) { oNode = oParentNode.childNodes.item(nItem); if (oNode.nodeType === 4) // CDATASection - sCollectedTxt += oNode.nodeValue; + sCollectedTxt += oNode.nodeValue; else if (oNode.nodeType === 3) // Text sCollectedTxt += oNode.nodeValue; else if (oNode.nodeType === 1) // Element aCache.push(oNode); } } const nLevelEnd = aCache.length; diff --git a/mailnews/compose/test/unit/test_bug155172.js b/mailnews/compose/test/unit/test_bug155172.js --- a/mailnews/compose/test/unit/test_bug155172.js +++ b/mailnews/compose/test/unit/test_bug155172.js @@ -90,17 +90,17 @@ add_task(function *() { "MAIL FROM:<" + kSender + "> BODY=8BITMIME SIZE=155", "RCPT TO:<" + kTo + ">", "DATA"]); } catch (e) { do_throw(e); } finally { server.stop(); - + var thread = gThreadManager.currentThread; while (thread.hasPendingEvents()) thread.processNextEvent(true); } }); function run_test() { run_next_test(); diff --git a/mailnews/compose/test/unit/test_bug474774.js b/mailnews/compose/test/unit/test_bug474774.js --- a/mailnews/compose/test/unit/test_bug474774.js +++ b/mailnews/compose/test/unit/test_bug474774.js @@ -1,11 +1,11 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /** - * Tests bug 474774 - assertions when saving send later and when sending with + * Tests bug 474774 - assertions when saving send later and when sending with * FCC switched off. */ Cu.import("resource:///modules/mailServices.js"); var type = null; var test = null; var server; diff --git a/mailnews/compose/test/unit/test_nsMsgCompose1.js b/mailnews/compose/test/unit/test_nsMsgCompose1.js --- a/mailnews/compose/test/unit/test_nsMsgCompose1.js +++ b/mailnews/compose/test/unit/test_nsMsgCompose1.js @@ -138,13 +138,13 @@ function run_test() { checkPopulate("TestList1 , test3@com.invalid", "test1@foo.invalid,test2@foo.invalid,test3@foo.invalid,test3@com.invalid"); checkPopulate("TestList2 , ListTest2 ", "test4@foo.invalid,test4@com.invalid"); checkPopulate("TestList3 , ListTest1 ", "test5@foo.invalid,test1@com.invalid,test2@com.invalid,test3@com.invalid"); - + // test bug 254519 rfc 2047 encoding checkPopulate("=?iso-8859-1?Q?Sure=F6name=2C_Forename_Dr=2E?= ", "\"Sure\u00F6name, Forename Dr.\" "); }; diff --git a/mailnews/compose/test/unit/test_nsMsgCompose2.js b/mailnews/compose/test/unit/test_nsMsgCompose2.js --- a/mailnews/compose/test/unit/test_nsMsgCompose2.js +++ b/mailnews/compose/test/unit/test_nsMsgCompose2.js @@ -105,11 +105,11 @@ function run_test() { for (i = 0; i < numSendListenerFunctions + 1; ++i) { if (i < numSendListenerFunctions) do_check_eq(gSLAll[i].mReceived, 0); else do_check_eq(gSLAll[i].mReceived, 0x3F); } // Test - Remove main listener - + gMsgCompose.removeMsgSendListener(gSLAll[numSendListenerFunctions]); }; diff --git a/mailnews/compose/test/unit/test_nsMsgCompose4.js b/mailnews/compose/test/unit/test_nsMsgCompose4.js --- a/mailnews/compose/test/unit/test_nsMsgCompose4.js +++ b/mailnews/compose/test/unit/test_nsMsgCompose4.js @@ -143,17 +143,17 @@ function run_test() { checkPopulate("TestList1 , test3@com.invalid", "", SendFormat.AskUser); checkPopulate("TestList2 , ListTest2 ", "", SendFormat.PlainText); checkPopulate("TestList3 , ListTest1 ", "", SendFormat.AskUser); - + // test bug 254519 rfc 2047 encoding checkPopulate("=?iso-8859-1?Q?Sure=F6name=2C_Forename__Dr=2E?= ", "", SendFormat.AskUser); // Try some fields with newsgroups checkPopulate("test4@foo.invalid", "mozilla.test", SendFormat.AskUser); checkPopulate("test5@foo.invalid", "mozilla.test", SendFormat.AskUser); checkPopulate("", "mozilla.test", SendFormat.AskUser); diff --git a/mailnews/compose/test/unit/test_nsSmtpService1.js b/mailnews/compose/test/unit/test_nsSmtpService1.js --- a/mailnews/compose/test/unit/test_nsSmtpService1.js +++ b/mailnews/compose/test/unit/test_nsSmtpService1.js @@ -42,17 +42,17 @@ function run_test() { // Test - Check default server is still ok do_check_eq(smtpServer, smtpService.defaultServer); // Test - Delete the only server smtpService.deleteServer(smtpServer); smtpServers = smtpService.servers; do_check_false(smtpServers.hasMoreElements()); - + // do_check_eq(null, smtpService.defaultServer); // Test - add multiple servers var smtpServerArray = new Array(3); var i; for (i = 0; i < 3; ++i) diff --git a/mailnews/compose/test/unit/test_sendBackground.js b/mailnews/compose/test/unit/test_sendBackground.js --- a/mailnews/compose/test/unit/test_sendBackground.js +++ b/mailnews/compose/test/unit/test_sendBackground.js @@ -34,17 +34,17 @@ msll.prototype = { do_check_eq(gMsgSendLater.sendingMessages, true); do_check_eq(aTotal, 1); }, onMessageStartSending: function (aCurrentMessage, aTotalMessageCount, aMessageHeader, aIdentity) { }, onMessageSendProgress: function (aCurrentMessage, aTotalMessageCount, aMessageSendPercent, aMessageCopyPercent) { - }, + }, onMessageSendError: function (aCurrentMessage, aMessageHeader, aStatus, aMsg) { do_throw("onMessageSendError should not have been called, status: " + aStatus); }, onStopSending: function (aStatus, aMsg, aTotalTried, aSuccessful) { do_test_finished(); print("msll onStopSending\n"); try { diff --git a/mailnews/compose/test/unit/test_sendMailMessage.js b/mailnews/compose/test/unit/test_sendMailMessage.js --- a/mailnews/compose/test/unit/test_sendMailMessage.js +++ b/mailnews/compose/test/unit/test_sendMailMessage.js @@ -70,17 +70,17 @@ function test_RFC2821() { "RCPT TO:<" + kTo + ">", "DATA"]); } catch (e) { do_throw(e); } finally { server.stop(); - + var thread = gThreadManager.currentThread; while (thread.hasPendingEvents()) thread.processNextEvent(true); } } function run_test() { server = setupServerDaemon(); diff --git a/mailnews/compose/test/unit/test_sendMessageFile.js b/mailnews/compose/test/unit/test_sendMessageFile.js --- a/mailnews/compose/test/unit/test_sendMessageFile.js +++ b/mailnews/compose/test/unit/test_sendMessageFile.js @@ -155,14 +155,14 @@ function run_test() { ); do_test_pending(); } catch (e) { do_throw(e); } finally { server.stop(); - + var thread = gThreadManager.currentThread; while (thread.hasPendingEvents()) thread.processNextEvent(true); } } diff --git a/mailnews/compose/test/unit/test_sendMessageLater2.js b/mailnews/compose/test/unit/test_sendMessageLater2.js --- a/mailnews/compose/test/unit/test_sendMessageLater2.js +++ b/mailnews/compose/test/unit/test_sendMessageLater2.js @@ -4,17 +4,17 @@ * times in the same session. * * XXX: This test is intended to additionally test sending of multiple messages * from one send later instance, however due to the fact we use one connection * per message sent, it is very difficult to consistently get the fake server * reconected in time for the next connection. Thus, sending of multiple * messages is currently disabled (but commented out for local testing if * required), when we fix bug 136871 we should be able to enable the multiple - * messages option. + * messages option. */ load("../../../resources/logHelper.js"); load("../../../resources/asyncTestUtils.js"); Cu.import("resource:///modules/mailServices.js"); var test = "sendMessageLater"; diff --git a/mailnews/compose/test/unit/test_sendMessageLater3.js b/mailnews/compose/test/unit/test_sendMessageLater3.js --- a/mailnews/compose/test/unit/test_sendMessageLater3.js +++ b/mailnews/compose/test/unit/test_sendMessageLater3.js @@ -82,17 +82,17 @@ function OnStopCopy(aStatus) { let folder = msgSendLater.getUnsentMessagesFolder(identity); // Check that the send later service thinks we have messages to send. do_check_eq(msgSendLater.hasUnsentMessages(identity), true); // Check we have a message in the unsent message folder do_check_eq(folder.getTotalMessages(false), 1); - + // Now do a comparison of what is in the unsent mail folder let msgData = mailTestUtils .loadMessageToString(folder, mailTestUtils.firstMsgHdr(folder)); // Skip the headers etc that mailnews adds var pos = msgData.indexOf("From:"); do_check_neq(pos, -1); diff --git a/mailnews/compose/test/unit/test_smtp8bitMime.js b/mailnews/compose/test/unit/test_smtp8bitMime.js --- a/mailnews/compose/test/unit/test_smtp8bitMime.js +++ b/mailnews/compose/test/unit/test_smtp8bitMime.js @@ -54,17 +54,17 @@ function test_8bitmime(aStrictMime, aSer server.resetTest(); } catch (e) { do_throw(e); } finally { server.stop(); - + var thread = gThreadManager.currentThread; while (thread.hasPendingEvents()) thread.processNextEvent(true); } } function run_test() { // The default SMTP server advertises 8BITMIME capability. diff --git a/mailnews/compose/test/unit/test_smtpPassword.js b/mailnews/compose/test/unit/test_smtpPassword.js --- a/mailnews/compose/test/unit/test_smtpPassword.js +++ b/mailnews/compose/test/unit/test_smtpPassword.js @@ -64,17 +64,17 @@ add_task(function *() { "MAIL FROM:<" + kSender + "> BODY=8BITMIME SIZE=155", "RCPT TO:<" + kTo + ">", "DATA"]); } catch (e) { do_throw(e); } finally { server.stop(); - + var thread = gThreadManager.currentThread; while (thread.hasPendingEvents()) thread.processNextEvent(true); } }); function run_test() { run_next_test(); diff --git a/mailnews/db/gloda/modules/collection.js b/mailnews/db/gloda/modules/collection.js --- a/mailnews/db/gloda/modules/collection.js +++ b/mailnews/db/gloda/modules/collection.js @@ -382,17 +382,17 @@ var GlodaCollectionManager = { /** * This should be called when items in the global database are permanently-ish * deleted. (This is distinct from concepts like message deletion which may * involved trash folders or other modified forms of existence. Deleted * means the data is gone and if it were to come back, it would come back * via an itemsAdded event.) * We walk all existing collections for the given noun type. For items * currently in the collection, we generate onItemsRemoved events. - * + * * @param aItemIds A list of item ids that are being deleted. */ itemsDeleted: function gloda_colm_itemsDeleted(aNounID, aItemIds) { // cache let cache = this._cachesByNoun[aNounID]; if (cache) { for (let itemId of aItemIds) { if (itemId in cache._idMap) @@ -408,23 +408,23 @@ var GlodaCollectionManager = { collection._onItemsRemoved(removeItems); } }, /** * Like |itemsDeleted| but for the case where the deletion is based on an * attribute that SQLite can more efficiently check than we can and where the * cost of scanning the in-memory items is presumably much cheaper than * trying to figure out what actually got deleted. - * + * * Since we are doing an in-memory walk, this is obviously O(n) where n is the * number of noun instances of a given type in-memory. We are assuming this * is a reasonable number of things and that this type of deletion call is * not going to happen all that frequently. If these assumptions are wrong, * callers are advised to re-think the whole situation. - * + * * @param aNounID Type of noun we are talking about here. * @param aFilter A filter function that returns true when the item should be * thought of as deleted, or false if the item is still good. Screw this * up and you will get some seriously wacky bugs, yo. */ itemsDeletedByAttribute: function gloda_colm_itemsDeletedByAttribute( aNounID, aFilter) { // cache diff --git a/mailnews/db/gloda/modules/suffixtree.js b/mailnews/db/gloda/modules/suffixtree.js --- a/mailnews/db/gloda/modules/suffixtree.js +++ b/mailnews/db/gloda/modules/suffixtree.js @@ -15,17 +15,17 @@ function MultiSuffixTree(aStrings, aItem let s = ''; let offsetsToItems = []; let lastLength = 0; for (let i = 0; i < aStrings.length; i++) { s += aStrings[i]; offsetsToItems.push(lastLength, s.length, aItems[i]); lastLength = s.length; } - + this._construct(s); this._offsetsToItems = offsetsToItems; this._numItems = aItems.length; } /** * @constructor */ @@ -54,37 +54,37 @@ State.prototype = { get isExplicit() { // our end is not inclusive... return (this.end <= this.start); }, get isImplicit() { // our end is not inclusive... return (this.end > this.start); }, - + get length() { return this.end - this.start; }, - + toString: function State_toString() { return "[Start: " + this.start + " End: " + this.end + - (this.suffix ? " non-null suffix]" : " null suffix]"); + (this.suffix ? " non-null suffix]" : " null suffix]"); } }; /** * Suffix tree implemented using Ukkonen's algorithm. * @constructor */ function SuffixTree(aStr) { this._construct(aStr); } /** - * States are + * States are */ SuffixTree.prototype = { /** * Find all items matching the provided substring. */ findMatches: function findMatches(aSubstring) { let results = []; let state = this._root; @@ -100,137 +100,137 @@ SuffixTree.prototype = { let actualTraverseLength = Math.min(state.length, end - index); if (this._str.substring(state.start, state.start + actualTraverseLength) != aSubstring.substring(index, index + actualTraverseLength)) return results; index += state.length; } - + // state should now be the node which itself and all its children match... // The delta is to adjust us to the offset of the last letter of our match; // the edge we traversed to get here may have found us traversing more // than we wanted. // index - end captures the over-shoot of the edge traversal, // index - end + 1 captures the fact that we want to find the last letter // that matched, not just the first letter beyond it // However, if this state is a leaf node (end == 'infinity'), then 'end' // isn't describing an edge at all and we want to avoid accounting for it. let delta; /* if (state.end != this._infinity) //delta = index - end + 1; - delta = end - (index - state.length); + delta = end - (index - state.length); else */ delta = index - state.length - end + 1; - + this._resultGather(state, results, {}, end, delta, true); return results; }, - + _resultGather: function resultGather(aState, aResults, aPresence, aPatLength, aDelta, alreadyAdjusted) { // find the item that this state originated from based on the state's // start character. offsetToItem holds [string start index, string end // index (exclusive), item reference]. So we want to binary search to // find the string whose start/end index contains the state's start index. let low = 0; let high = this._numItems-1; let mid, stringStart, stringEnd; - + let patternLast = aState.start - aDelta; while (low <= high) { mid = low + Math.floor((high - low) / 2); // excessive, especially with js nums stringStart = this._offsetsToItems[mid*3]; let startDelta = stringStart - patternLast; stringEnd = this._offsetsToItems[mid*3+1]; let endDelta = stringEnd - patternLast; if (startDelta > 0) high = mid - 1; else if (endDelta <= 0) low = mid + 1; else { break; } } - + // - The match occurred completely inside a source string. Success. // - The match spans more than one source strings, and is therefore not // a match. - + // at this point, we have located the origin string that corresponds to the // start index of this state. // - The match terminated with the end of the preceding string, and does // not match us at all. We, and potentially our children, are merely // serving as a unique terminal. - // - The + // - The let patternFirst = patternLast - (aPatLength - 1); if (patternFirst >= stringStart) { if (!(stringStart in aPresence)) { aPresence[stringStart] = true; aResults.push(this._offsetsToItems[mid*3+2]); } } - + // bail if we had it coming OR // if the result terminates at/part-way through this state, meaning any // of its children are not going to be actual results, just hangers // on. /* if (bail || (end <= aState.end)) { dump(" bailing! (bail was: " + bail + ")\n"); return; } -*/ +*/ // process our children... for (let key in aState) { // edges have attributes of length 1... if (key.length == 1) { let statePrime = aState[key]; this._resultGather(statePrime, aResults, aPresence, aPatLength, aDelta + aState.length, //(alreadyAdjusted ? 0 : aState.length), false); } } }, /** * Given a reference 'pair' of a state and a string (may be 'empty'=explicit, * which means no work to do and we return immediately) follow that state * (and then the successive states)'s transitions until we run out of - * transitions. This happens either when we find an explicit state, or + * transitions. This happens either when we find an explicit state, or * find ourselves partially along an edge (conceptually speaking). In * the partial case, we return the state prior to the edge traversal. * (The information about the 'edge' is contained on its target State; - * we can do this because a state is only referenced by one other state.) + * we can do this because a state is only referenced by one other state.) */ _canonize: function canonize(aState, aStart, aEnd) { if (aEnd <= aStart) { return [aState, aStart]; } - + let statePrime; // we treat an aState of null as 'bottom', which has transitions for every // letter in the alphabet to 'root'. rather than create all those // transitions, we special-case here. if (aState === null) statePrime = this._root; else statePrime = aState[this._str[aStart]]; while (statePrime.length <= aEnd - aStart) { // (no 1 adjustment required) aStart += statePrime.length; aState = statePrime; if (aStart < aEnd) { statePrime = aState[this._str[aStart]]; } } - return [aState, aStart]; + return [aState, aStart]; }, /** * Given a reference 'pair' whose state may or may not be explicit (and for * which we will perform the required splitting to make it explicit), test * whether it already possesses a transition corresponding to the provided * character. * @return A list of: whether we had to make it explicit, the (potentially) @@ -248,22 +248,22 @@ dump(" bailing! (bail was: " + bail + " let rState = new State(statePrime.start, statePrime.start + length); aState[this._str[statePrime.start]] = rState; statePrime.start += length; rState[this._str[statePrime.start]] = statePrime; return [false, rState]; } } else { // it's already explicit - if (aState === null) { // bottom case... shouldn't happen, but hey. + if (aState === null) { // bottom case... shouldn't happen, but hey. return [true, aState]; } return [(aChar in aState), aState]; } - + }, _update: function update(aState, aStart, aIndex) { let oldR = this._root; let textAtIndex = this._str[aIndex]; // T sub i (0-based corrected...) // because of the way we store the 'end' value as a one-past form, we do // not need to subtract 1 off of aIndex. let [endPoint, rState] = this._testAndSplit(aState, aStart, aIndex, //no -1 @@ -275,52 +275,52 @@ dump(" bailing! (bail was: " + bail + " oldR.suffix = rState; oldR = rState; [aState, aStart] = this._canonize(aState.suffix, aStart, aIndex); // no -1 [endPoint, rState] = this._testAndSplit(aState, aStart, aIndex, // no -1 textAtIndex); } if (oldR !== this._root) oldR.suffix = aState; - + return [aState, aStart]; }, - + _construct: function construct(aStr) { this._str = aStr; // just needs to be longer than the string. this._infinity = aStr.length + 1; - + //this._bottom = new State(0, -1, null); this._root = new State(-1, 0, null); // null === bottom let state = this._root; let start = 0; - + for (let i = 0; i < aStr.length; i++) { [state, start] = this._update(state, start, i); // treat as flowing -1... [state, start] = this._canonize(state, start, i+1); // 1-length string } }, - + dump: function SuffixTree_show(aState, aIndent, aKey) { if (aState === undefined) aState = this._root; if (aIndent === undefined) { aIndent = ""; aKey = "."; } - + if (aState.isImplicit) { let snip; if (aState.length > 10) snip = this._str.slice(aState.start, Math.min(aState.start+10, this._str.length)) + "..."; else snip = this._str.slice(aState.start, - Math.min(aState.end, this._str.length)); + Math.min(aState.end, this._str.length)); dump(aIndent + aKey + ":" + snip + "(" + aState.start + ":" + aState.end + ")\n"); } else dump(aIndent + aKey + ": (explicit:" + aState.start + ":" + aState.end +")\n"); let nextIndent = aIndent + " "; let keys = Object.keys(aState).filter(c => c.length == 1); for (let key of keys) { diff --git a/mailnews/db/gloda/test/unit/base_index_messages.js b/mailnews/db/gloda/test/unit/base_index_messages.js --- a/mailnews/db/gloda/test/unit/base_index_messages.js +++ b/mailnews/db/gloda/test/unit/base_index_messages.js @@ -681,17 +681,17 @@ function* test_attributes_cant_query() { /** * Have the participants be in our addressbook prior to indexing so that we can * verify that the hand-off to the addressbook indexer does not cause breakage. */ function* test_people_in_addressbook() { var senderPair = msgGen.makeNameAndAddress(), recipPair = msgGen.makeNameAndAddress(); - + // - add both people to the address book makeABCardForAddressPair(senderPair); makeABCardForAddressPair(recipPair); let [folder, msgSet] = make_folder_with_sets([ { count: 1, to: [recipPair], from: senderPair }]); yield wait_for_message_injection(); yield wait_for_gloda_indexer(msgSet, {augment: true}); @@ -1054,17 +1054,17 @@ function* test_folder_deletion_nested() let descendentFolders = get_nsIMsgFolder(trash).descendants; let folders = Array.from(fixIterator(descendentFolders, Ci.nsIMsgFolder)); do_check_eq(folders.length, 2); let [newFolder1, newFolder2] = folders; let glodaFolder1 = Gloda.getFolderForFolder(newFolder1); let glodaFolder2 = Gloda.getFolderForFolder(newFolder2); - // verify that Gloda properly marked this folder as not to be indexed anymore + // verify that Gloda properly marked this folder as not to be indexed anymore do_check_eq(glodaFolder1.indexingPriority, glodaFolder1.kIndexingNeverPriority); // check that existing message is marked as deleted yield wait_for_gloda_indexer([], {deleted: [msgSet1, msgSet2]}); // make sure the deletion hit the database yield sqlExpectCount(1, "SELECT COUNT(*) from folderLocations WHERE id = ? AND indexingPriority = ?", diff --git a/mailnews/db/gloda/test/unit/test_mime_attachments_size.js b/mailnews/db/gloda/test/unit/test_mime_attachments_size.js --- a/mailnews/db/gloda/test/unit/test_mime_attachments_size.js +++ b/mailnews/db/gloda/test/unit/test_mime_attachments_size.js @@ -184,17 +184,17 @@ function check_attachments(aMimeMsg, eps if (aMimeMsg == null) do_throw("We really should have gotten a result!"); // dump(aMimeMsg.prettyString()+"\n"); /* It is hard to get a byte count that's perfectly accurate. When composing * the message, the MIME structure goes like this (for an encoded attachment): * - * XXXXXXXXXX + * XXXXXXXXXX * XXXXXXXXXX <-- encoded block * XXXXXXXXXX * <-- newline * --chopchop <-- MIME separator * * libmime counts bytes all the way up to the separator, which means it counts * the bytes for the extra line. Since newlines in emails are \n, most of the * time we get att.size = 174 instead of 173. @@ -257,17 +257,17 @@ var bogusMessageInfos = [ // (when they have it), rather than recursively computing their sizes. I'm not // sure changing jsmimeemitter.js is worth the trouble just for buggy // messages... { name: '.eml attachment with inner MimeUnknown', bodyPart: new SyntheticPartMultiMixed([ partHtml, msgGen.makeMessage({ // <--- M - bodyPart: + bodyPart: new SyntheticPartMultiMixed([ new SyntheticPartMultiRelated([ partHtml, new SyntheticPartLeaf(htmlText, { contentType: "woooooo" }), ]), ]), }), ]), diff --git a/mailnews/db/msgdb/test/unit/test_maildb.js b/mailnews/db/msgdb/test/unit/test_maildb.js --- a/mailnews/db/msgdb/test/unit/test_maildb.js +++ b/mailnews/db/msgdb/test/unit/test_maildb.js @@ -65,17 +65,17 @@ function doTest(test) if (test <= gTestArray.length) { dump("Doing test " + test + "\n"); gCurTestNum = test; var testFn = gTestArray[test-1]; // Set a limit of 10 seconds; if the notifications haven't arrived by then there's a problem. do_timeout(10000, function(){ - if (gCurTestNum == test) + if (gCurTestNum == test) do_throw("Notifications not received in 10000 ms for operation " + testFn.name); } ); try { testFn(); } catch(ex) {do_throw(ex);} } else diff --git a/mailnews/db/msgdb/test/unit/test_references_parsing.js b/mailnews/db/msgdb/test/unit/test_references_parsing.js --- a/mailnews/db/msgdb/test/unit/test_references_parsing.js +++ b/mailnews/db/msgdb/test/unit/test_references_parsing.js @@ -40,47 +40,47 @@ var refsAndResults = [ [" 4 < 5", ["4 < 5"]], [" 6 > 3", ["6 > 3"]], [" look ma!\n newlines!", ["look ma!\n newlines!"]] ]; /** * Parse the references in refsAndResults and ensure their references match * the corresponding results. - * + * * @param aMsgHdr A message header that you don't mind if we mess with. */ function test_references_header_parsing(aMsgHdr) { var iCase, iResult, refString, results; for (iCase = 0; iCase < refsAndResults.length; iCase++) { refString = refsAndResults[iCase][0]; results = refsAndResults[iCase][1]; - + dump("Setting references to: '" + refString + "'\n"); aMsgHdr.setReferences(refString); if (aMsgHdr.numReferences != results.length) { dump("Length mis-match! Was expecting:\n"); for (iResult = 0; iResult < results.length; iResult++) { dump("'" + results[iResult] + "'\n"); } dump("Got:\n"); for (iResult = 0; iResult < aMsgHdr.numReferences; iResult++) { dump("'" + aMsgHdr.getStringReference(iResult) + "'\n"); } - + do_check_eq(aMsgHdr.numReferences, results.length); } - + for (iResult = 0; iResult < results.length; iResult++) { do_check_eq(aMsgHdr.getStringReference(iResult), results[iResult]); } } - + do_test_finished(); } /* * This infrastructure down here exists just to get * test_references_header_parsing its message header. */ @@ -89,17 +89,17 @@ function run_test() { do_test_pending(); MailServices.copy.CopyFileMessage(anyOldMessage, localAccountUtils.inboxFolder, null, false, 0, "", messageHeaderGetterListener, null); return true; } var messageHeaderGetterListener = { msgKey: null, - + OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, GetMessageId: function (aMessageId) {}, SetMessageKey: function(aKey) { this.msgKey = aKey; }, OnStopCopy: function(aStatus) { test_references_header_parsing( diff --git a/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js b/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js --- a/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js +++ b/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js @@ -6,44 +6,44 @@ // code is adapted from Mnehy Thunderbird Extension Cu.import("resource://gre/modules/Services.jsm"); function TrainingData() { // local constants const CC = Components.Constructor; - + // public methods - + this.read = read; - + // public variables - + this.mGoodTokens = 0; this.mJunkTokens = 0; this.mGoodMessages = 0; this.mJunkMessages = 0; this.mGoodCounts = new Object; this.mJunkCounts = new Object; - + // helper functions function getJunkStatFile() { var sBaseDir = Services.dirsvc.get("ProfD", Ci.nsIFile); var CFileByFile = new CC("@mozilla.org/file/local;1", "nsILocalFile", "initWithFile"); var oFile = new CFileByFile(sBaseDir); oFile.append("training.dat"); return oFile; } - + function getBinStream(oFile) { - + if (oFile && oFile.exists()) - { + { var oUri = Services.io.newFileURI(oFile); // open stream (channel) let channel = Services.io.newChannelFromURI2(oUri, null, Services.scriptSecurityManager.getSystemPrincipal(), null, Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, Ci.nsIContentPolicy.TYPE_OTHER); @@ -56,46 +56,46 @@ function TrainingData() { var oBinStream = Cc["@mozilla.org/binaryinputstream;1"]. createInstance(Ci.nsIBinaryInputStream); oBinStream.setInputStream(oBufStream); // return it return oBinStream; } return null; } - + // method specifications - + function read() { var file = getJunkStatFile(); // does the file exist? do_check_true(file.exists()); var fileStream = getBinStream(file); - + // check magic number var iMagicNumber = fileStream.read32(); do_check_eq(iMagicNumber, 0xFEEDFACE); - + // get ham'n'spam numbers this.mGoodMessages = fileStream.read32(); this.mJunkMessages = fileStream.read32(); // Read good tokens this.mGoodTokens = fileStream.read32(); var iRefCount, iTokenLen, sToken; for (var i = 0; i < this.mGoodTokens; ++i) - { + { iRefCount = fileStream.read32(); iTokenLen = fileStream.read32(); sToken = fileStream.readBytes(iTokenLen); this.mGoodCounts[sToken] = iRefCount; } - + // we have no further good tokens, so read junk tokens this.mJunkTokens = fileStream.read32(); for (i = 0; i < this.mJunkTokens; i++) { // read token data iRefCount = fileStream.read32(); iTokenLen = fileStream.read32(); sToken = fileStream.readBytes(iTokenLen); this.mJunkCounts[sToken] = iRefCount; diff --git a/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js b/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js --- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js +++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js @@ -26,39 +26,39 @@ var trainingData; // main test function run_test() { localAccountUtils.loadLocalMailAccount(); MailServices.junk.resetTrainingData(); do_test_pending(); - + var email = emails.shift(); var classification = classifications.shift(); // additional calls to setMessageClassifiaction are done in the callback MailServices.junk.setMessageClassification(getSpec(email), kUnclassified, classification, null, doTestingListener); } -var doTestingListener = +var doTestingListener = { onMessageClassified: function(aMsgURI, aClassification, aJunkPercent) { if (!aMsgURI) return; // ignore end-of-batch signal var email = emails.shift(); var classification = classifications.shift(); if (email) { MailServices.junk.setMessageClassification(getSpec(email), kUnclassified, classification, null, doTestingListener); return; } - + // all done classifying, time to test MailServices.junk.shutdown(); // just flushes training.dat trainingData = new TrainingData(); trainingData.read(); /* // List training.dat information for debug dump("training.data results: goodMessages=" + trainingData.mGoodMessages @@ -68,42 +68,42 @@ var doTestingListener = + "\n"); print("Good counts"); for (var token in trainingData.mGoodCounts) dump("count: " + trainingData.mGoodCounts[token] + " token: " + token + "\n"); print("Junk Counts"); for (var token in trainingData.mJunkCounts) dump("count: " + trainingData.mJunkCounts[token] + " token: " + token + "\n"); */ - + /* Selected pre-shrink counts after training training.data results: goodMessages=2 junkMessages = 4 tokens = 78 Good counts count: 1 token: subject:report count: 2 token: important count: 2 token: to:careful reader Junk Counts count: 3 token: make count: 4 token: money count: 4 token: to:careful reader count: 2 token: money! */ - + // Shrinking divides all counts by two. In comments, I show the // calculation for each test, (pre-shrink count)/2. do_check_eq(trainingData.mGoodMessages, 1); // 2/2 do_check_eq(trainingData.mJunkMessages, 2); // 4/2 checkToken("money", 0, 2); // (0/2, 4/2) checkToken("subject:report", 0, 0); // (1/2, 0/2) checkToken("to:careful reader ", 1, 2); // (2/2, 4/2) checkToken("make", 0, 1); // (0/2, 3/2) checkToken("important", 1, 0); // (2/2, 0/2) - + do_test_finished(); } }; // helper functions function checkToken(aToken, aGoodCount, aJunkCount) { diff --git a/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js b/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js --- a/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js +++ b/mailnews/extensions/bayesian-spam-filter/test/unit/test_traitAliases.js @@ -144,17 +144,17 @@ function startCommand() while ((antiAlias = antiAliases.pop())) traitService.removeAlias(kAntiTrait, antiAlias); // add new aliases while ((proAlias = gTest.proAliases.pop())) traitService.addAlias(kProTrait, proAlias); while ((antiAlias = gTest.antiAliases.pop())) traitService.addAlias(kAntiTrait, antiAlias); - + MailServices.junk.classifyTraitsInMessage( getSpec(gTest.fileName), // in string aMsgURI proArray.length, // length of traits arrays proArray, // in array aProTraits, antiArray, // in array aAntiTraits listener); // in nsIMsgTraitClassificationListener aTraitListener //null, // [optional] in nsIMsgWindow aMsgWindow //null, // [optional] in nsIJunkMailClassificationListener aJunkListener diff --git a/mailnews/extensions/dsn/content/am-dsn.js b/mailnews/extensions/dsn/content/am-dsn.js --- a/mailnews/extensions/dsn/content/am-dsn.js +++ b/mailnews/extensions/dsn/content/am-dsn.js @@ -2,17 +2,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 useCustomPrefs; var requestAlways; var gIdentity; -function onInit() +function onInit() { useCustomPrefs = document.getElementById("identity.dsn_use_custom_prefs"); requestAlways = document.getElementById("identity.dsn_always_request_on"); EnableDisableCustomSettings(); return true; } diff --git a/mailnews/extensions/mdn/content/am-mdn.js b/mailnews/extensions/mdn/content/am-mdn.js --- a/mailnews/extensions/mdn/content/am-mdn.js +++ b/mailnews/extensions/mdn/content/am-mdn.js @@ -17,36 +17,36 @@ var outsideDomainLabel; var otherCasesPref; var otherCasesLabel; var receiptArriveLabel; var receiptRequestLabel; var gIdentity; var gIncomingServer; var gMdnPrefBranch; -function onInit() +function onInit() { useCustomPrefs = document.getElementById("identity.use_custom_prefs"); requestReceipt = document.getElementById("identity.request_return_receipt_on"); leaveInInbox = document.getElementById("leave_in_inbox"); moveToSent = document.getElementById("move_to_sent"); receiptSend = document.getElementById("server.mdn_report_enabled"); neverReturn = document.getElementById("never_return"); returnSome = document.getElementById("return_some"); notInToCcPref = document.getElementById("server.mdn_not_in_to_cc"); notInToCcLabel = document.getElementById("notInToCcLabel"); outsideDomainPref = document.getElementById("server.mdn_outside_domain"); outsideDomainLabel = document.getElementById("outsideDomainLabel"); otherCasesPref = document.getElementById("server.mdn_other"); otherCasesLabel = document.getElementById("otherCasesLabel"); receiptArriveLabel = document.getElementById("receiptArriveLabel"); receiptRequestLabel = document.getElementById("receiptRequestLabel"); - + EnableDisableCustomSettings(); - + return true; } function onSave() { } @@ -103,17 +103,17 @@ function onPreInit(account, accountValue { gIdentity = account.defaultIdentity; gIncomingServer = account.incomingServer; } // Disables xul elements that have associated preferences locked. function onLockPreference(initPrefString, keyString) { - var finalPrefString; + var finalPrefString; var allPrefElements = [ { prefstring:"request_return_receipt_on", id:"identity.request_return_receipt_on"}, { prefstring:"select_custom_prefs", id:"identity.select_custom_prefs"}, { prefstring:"select_global_prefs", id:"identity.select_global_prefs"}, { prefstring:"incorporate_return_receipt", id:"server.incorporate_return_receipt"}, { prefstring:"never_return", id:"never_return"}, { prefstring:"return_some", id:"return_some"}, @@ -121,17 +121,17 @@ function onLockPreference(initPrefString { prefstring:"mdn_outside_domain", id:"server.mdn_outside_domain"}, { prefstring:"mdn_other", id:"server.mdn_other"}, ]; finalPrefString = initPrefString + "." + keyString + "."; gMdnPrefBranch = Services.prefs.getBranch(finalPrefString); disableIfLocked( allPrefElements ); -} +} function disableIfLocked( prefstrArray ) { for (var i=0; i 1) { @@ -46,17 +46,17 @@ var smimeHeaderSink = } gSignatureStatus = aSignatureStatus; gSignerCert = aSignerCert; gSMIMEContainer.collapsed = false; gSignedUINode.collapsed = false; gSignedStatusPanel.collapsed = false; - + switch (aSignatureStatus) { case nsICMSMessageErrors.SUCCESS: gSignedUINode.setAttribute("signed", "ok"); gStatusBar.setAttribute("signed", "ok"); break; case nsICMSMessageErrors.VERIFY_NOT_YET_ATTEMPTED: gSignedUINode.setAttribute("signed", "unknown"); @@ -81,31 +81,31 @@ var smimeHeaderSink = if (aNestingLevel > 1) { // we are not interested return; } gEncryptionStatus = aEncryptionStatus; gEncryptionCert = aRecipientCert; - gSMIMEContainer.collapsed = false; + gSMIMEContainer.collapsed = false; gEncryptedUINode.collapsed = false; - gEncryptedStatusPanel.collapsed = false; + gEncryptedStatusPanel.collapsed = false; if (nsICMSMessageErrors.SUCCESS == aEncryptionStatus) { gEncryptedUINode.setAttribute("encrypted", "ok"); gStatusBar.setAttribute("encrypted", "ok"); } else { gEncryptedUINode.setAttribute("encrypted", "notok"); gStatusBar.setAttribute("encrypted", "notok"); } - + if (gEncryptedURIService) { // Remember the message URI and the corresponding necko URI. gMyLastEncryptedURI = GetLoadedMessage(); gEncryptedURIService.rememberEncrypted(gMyLastEncryptedURI); gEncryptedURIService.rememberEncrypted( neckoURLForMessageURI(gMyLastEncryptedURI)); } @@ -152,30 +152,30 @@ function forgetEncryptedURI() gMyLastEncryptedURI = null; } } function onSMIMEStartHeaders() { gEncryptionStatus = -1; gSignatureStatus = -1; - + gSignerCert = null; gEncryptionCert = null; - + gSMIMEContainer.collapsed = true; gSignedUINode.collapsed = true; gSignedUINode.removeAttribute("signed"); gSignedStatusPanel.collapsed = true; gStatusBar.removeAttribute("signed"); gEncryptedUINode.collapsed = true; gEncryptedUINode.removeAttribute("encrypted"); - gEncryptedStatusPanel.collapsed = true; + gEncryptedStatusPanel.collapsed = true; gStatusBar.removeAttribute("encrypted"); forgetEncryptedURI(); } function onSMIMEEndHeaders() {} @@ -207,17 +207,17 @@ function msgHdrViewSMIMEOnLoad(event) // add ourself to the list of message display listeners so we get notified when we are about to display a // message. var listener = {}; listener.onStartHeaders = onSMIMEStartHeaders; listener.onEndHeaders = onSMIMEEndHeaders; gMessageListeners.push(listener); - gEncryptedURIService = + gEncryptedURIService = Cc["@mozilla.org/messenger-smime/smime-encrypted-uris-service;1"] .getService(Ci.nsIEncryptedSMIMEURIsService); } function msgHdrViewSMIMEOnUnload(event) { window.crypto.enableSmartCardEvents = false; document.removeEventListener("smartcard-insert", onSmartCardChange, false); @@ -230,17 +230,17 @@ function msgHdrViewSMIMEOnUnload(event) } function msgHdrViewSMIMEOnMessagePaneHide() { gSMIMEContainer.collapsed = true; gSignedUINode.collapsed = true; gSignedStatusPanel.collapsed = true; gEncryptedUINode.collapsed = true; - gEncryptedStatusPanel.collapsed = true; + gEncryptedStatusPanel.collapsed = true; } function msgHdrViewSMIMEOnMessagePaneUnhide() { if (gEncryptionStatus != -1 || gSignatureStatus != -1) { gSMIMEContainer.collapsed = false; diff --git a/mailnews/extensions/smime/content/msgReadSecurityInfo.js b/mailnews/extensions/smime/content/msgReadSecurityInfo.js --- a/mailnews/extensions/smime/content/msgReadSecurityInfo.js +++ b/mailnews/extensions/smime/content/msgReadSecurityInfo.js @@ -107,17 +107,17 @@ function onLoad() sigInfoHeader = "SIInvalidHeader"; sigInfo_clueless = true; break; default: Cu.reportError("Unexpected gSignatureStatus: " + gSignatureStatus); } - document.getElementById("signatureLabel").value = + document.getElementById("signatureLabel").value = bundle.getString(sigInfoLabel); var label; if (sigInfoHeader) { label = document.getElementById("signatureHeader"); label.collapsed = false; label.value = bundle.getString(sigInfoHeader); } @@ -157,17 +157,17 @@ function onLoad() encInfoHeader = "EIInvalidHeader"; encInfo_clueless = 1; break; default: Cu.reportError("Unexpected gEncryptionStatus: " + gEncryptionStatus); } - document.getElementById("encryptionLabel").value = + document.getElementById("encryptionLabel").value = bundle.getString(encInfoLabel); if (encInfoHeader) { label = document.getElementById("encryptionHeader"); label.collapsed = false; label.value = bundle.getString(encInfoHeader); } diff --git a/mailnews/extensions/smime/content/smime.js b/mailnews/extensions/smime/content/smime.js --- a/mailnews/extensions/smime/content/smime.js +++ b/mailnews/extensions/smime/content/smime.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/. */ -/* +/* Add any default pref values we want for smime */ pref("mail.identity.default.encryption_cert_name",""); pref("mail.identity.default.encryptionpolicy", 0); pref("mail.identity.default.signing_cert_name", ""); pref("mail.identity.default.sign_mail", false); diff --git a/mailnews/imap/test/unit/test_bug460636.js b/mailnews/imap/test/unit/test_bug460636.js --- a/mailnews/imap/test/unit/test_bug460636.js +++ b/mailnews/imap/test/unit/test_bug460636.js @@ -7,17 +7,17 @@ load("../../../resources/asyncTestUtils. var gSavedMsgFile; var gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"] .getService(Ci.nsIMsgMessageService); var gFileName = "bug460636"; var gMsgFile = do_get_file("../../../data/" + gFileName); - + var tests = [ setup, checkSavedMessage, teardown ]; function* setup() { setupIMAPPump(); diff --git a/mailnews/imap/test/unit/test_dod.js b/mailnews/imap/test/unit/test_dod.js --- a/mailnews/imap/test/unit/test_dod.js +++ b/mailnews/imap/test/unit/test_dod.js @@ -1,17 +1,17 @@ /* * Test bodystructure and body fetch by parts. Messages with problem of * 'This part will be downloaded on demand' in message pane content (text) area. * To add messages to the test, place the 'markerRe' text used for testing in * the offending part that is displaying the problem message. * Prepend to the filename 'bodystructure' and save in the database * See current test files for examples. */ - + // async support load("../../../resources/logHelper.js"); load("../../../resources/asyncTestUtils.js"); Cu.import("resource://gre/modules/Services.jsm"); var gServer, gIMAPIncomingServer, gIMAPDaemon; diff --git a/mailnews/imap/test/unit/test_downloadOffline.js b/mailnews/imap/test/unit/test_downloadOffline.js --- a/mailnews/imap/test/unit/test_downloadOffline.js +++ b/mailnews/imap/test/unit/test_downloadOffline.js @@ -32,17 +32,17 @@ function *setup() { let messages = []; let gMessageGenerator = new MessageGenerator(); messages = messages.concat(gMessageGenerator.makeMessage()); let dataUri = Services.io.newURI("data:text/plain;base64," + btoa(messages[0].toMessageString())); let imapMsg = new imapMessage(dataUri.spec, IMAPPump.mailbox.uidnext++, []); imapMsg.setSize(5000); IMAPPump.mailbox.addMessage(imapMsg); - + // ...and download for offline use. let promiseUrlListener = new PromiseTestUtils.PromiseUrlListener(); IMAPPump.inbox.downloadAllForOffline(promiseUrlListener, null); yield promiseUrlListener.promise; } function *downloadAllForOffline() { let promiseUrlListener = new PromiseTestUtils.PromiseUrlListener(); diff --git a/mailnews/imap/test/unit/test_imapAttachmentSaves.js b/mailnews/imap/test/unit/test_imapAttachmentSaves.js --- a/mailnews/imap/test/unit/test_imapAttachmentSaves.js +++ b/mailnews/imap/test/unit/test_imapAttachmentSaves.js @@ -86,17 +86,17 @@ function* startDetach() } // test that the detachment was successful function* testDetach() { // This test seems to fail on Linux without the following delay. mailTestUtils.do_timeout_function(200, async_driver); yield false; - // Check that the file attached to the message now exists in the profile + // Check that the file attached to the message now exists in the profile // directory. let checkFile = do_get_profile().clone(); checkFile.append(kAttachFileName); do_check_true(checkFile.exists()); // The message should now have a detached attachment. Read the message, // and search for "AttachmentDetached" which is added on detachment. diff --git a/mailnews/imap/test/unit/test_imapChunks.js b/mailnews/imap/test/unit/test_imapChunks.js --- a/mailnews/imap/test/unit/test_imapChunks.js +++ b/mailnews/imap/test/unit/test_imapChunks.js @@ -7,17 +7,17 @@ Cu.import("resource:///modules/IOUtils.j var gIMAPDaemon, gServer, gIMAPIncomingServer, gSavedMsgFile; var gIMAPService = Cc["@mozilla.org/messenger/messageservice;1?type=imap"] .getService(Ci.nsIMsgMessageService); var gFileName = "bug92111"; var gMsgFile = do_get_file("../../../data/" + gFileName); - + function run_test() { /* * Set up an IMAP server. The bug is only triggered when nsMsgSaveAsListener * is used (i.e., for IMAP and NNTP). */ gIMAPDaemon = new imapDaemon(); gServer = makeServer(gIMAPDaemon, ""); @@ -95,17 +95,17 @@ function endTest() } catch (ex) { dump(ex); do_throw(ex); } do_test_finished(); } -var UrlListener = +var UrlListener = { OnStartRunningUrl: function(url) { }, OnStopRunningUrl: function(url, rc) { // operation succeeded do_check_eq(rc, 0); // File contents were not modified diff --git a/mailnews/imap/test/unit/test_imapContentLength.js b/mailnews/imap/test/unit/test_imapContentLength.js --- a/mailnews/imap/test/unit/test_imapContentLength.js +++ b/mailnews/imap/test/unit/test_imapContentLength.js @@ -15,17 +15,17 @@ load("../../../resources/logHelper.js"); load("../../../resources/asyncTestUtils.js"); Cu.import("resource:///modules/mailServices.js"); var gMsgHdr = null; // Take a multipart message as we're testing attachment URLs as well var gFile = do_get_file("../../../data/multipart-complex2"); - + var tests = [ setup, addMessageToServer, verifyContentLength, teardown ]; // Adds some messages directly to a mailbox (eg new mail) diff --git a/mailnews/imap/test/unit/test_imapFilterActions.js b/mailnews/imap/test/unit/test_imapFilterActions.js --- a/mailnews/imap/test/unit/test_imapFilterActions.js +++ b/mailnews/imap/test/unit/test_imapFilterActions.js @@ -52,17 +52,17 @@ var kFiltersAppliedAtom = Cc["@mozilla.o var kDeleteOrMoveMsgCompleted = Cc["@mozilla.org/atom-service;1"] .getService(Ci.nsIAtomService) .getAtom("DeleteOrMoveMsgCompleted"); // Definition of tests. The test function name is the filter action // being tested, with "Body" appended to tests that use delayed // application of filters due to a body search var gTestArray = -[ +[ setupIMAPPump, // optionally set server parameters, here enabling debug messages //function serverParms() { // IMAPPump.server.setDebugLevel(fsDebugAll); //}, setupFilters, // The initial tests do not result in new messages added. function *MoveToFolder() { diff --git a/mailnews/imap/test/unit/test_imapFlagChange.js b/mailnews/imap/test/unit/test_imapFlagChange.js --- a/mailnews/imap/test/unit/test_imapFlagChange.js +++ b/mailnews/imap/test/unit/test_imapFlagChange.js @@ -18,17 +18,17 @@ var tests = [ let rootFolder = IMAPPump.incomingServer.rootFolder; gSecondFolder = rootFolder.getChildNamed("secondFolder") .QueryInterface(Ci.nsIMsgImapMailFolder); // Selecting the second folder will close the cached connection // on the inbox because fake server only supports one connection at a time. // Then, we can poke at the message on the imap server directly, which // simulates the user changing the message from a different machine, - // and Thunderbird discovering the change when it does a flag sync + // and Thunderbird discovering the change when it does a flag sync // upon reselecting the Inbox. gSecondFolder.updateFolderWithListener(null, asyncUrlListener); yield false; }, function* simulateForwardFlagSet() { gMessage.setFlag("$Forwarded"); IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener); yield false; diff --git a/mailnews/imap/test/unit/test_imapHighWater.js b/mailnews/imap/test/unit/test_imapHighWater.js --- a/mailnews/imap/test/unit/test_imapHighWater.js +++ b/mailnews/imap/test/unit/test_imapHighWater.js @@ -156,17 +156,17 @@ var UrlListener = { // Check for ok status. do_check_eq(rc, 0); async_driver(); } }; // nsIMsgCopyServiceListener implementation -var CopyListener = +var CopyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey){}, SetMessageId: function(aMessageId) {}, OnStopCopy: function(aStatus){ do_check_eq(aStatus, 0); async_driver(); diff --git a/mailnews/imap/test/unit/test_imapStoreMsgOffline.js b/mailnews/imap/test/unit/test_imapStoreMsgOffline.js --- a/mailnews/imap/test/unit/test_imapStoreMsgOffline.js +++ b/mailnews/imap/test/unit/test_imapStoreMsgOffline.js @@ -187,30 +187,30 @@ var tests = [ mbox.addMessage(new imapMessage(dataUri.spec, mbox.uidnext++, [])); }); IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener); yield false; }, function* testQueuedOfflineDownload() { // Make sure that streaming the same message and then trying to download - // it for offline use doesn't end up in it getting added to the offline + // it for offline use doesn't end up in it getting added to the offline // store twice. gImapInboxOfflineStoreSize = IMAPPump.inbox.filePath.fileSize + gFirstMsgSize; let newMsgHdr = IMAPPump.inbox.GetMessageHeader(gFirstNewMsg); let msgURI = newMsgHdr.folder.getUriForMsg(newMsgHdr); let messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger); let msgServ = messenger.messageServiceFromURI(msgURI); msgServ.streamMessage(msgURI, gStreamListener, null, null, false, "", false); yield false; }, function* firstStreamFinished() { // nsIMsgFolder.DownloadMessagesForOffline does not take a listener, so - // we invoke nsIImapService.downloadMessagesForOffline directly with a + // we invoke nsIImapService.downloadMessagesForOffline directly with a // listener. MailServices.imap.downloadMessagesForOffline(gFirstNewMsg, IMAPPump.inbox, asyncUrlListener, null); yield false; }, function checkOfflineStoreSize() diff --git a/mailnews/imap/test/unit/test_localToImapFilter.js b/mailnews/imap/test/unit/test_localToImapFilter.js --- a/mailnews/imap/test/unit/test_localToImapFilter.js +++ b/mailnews/imap/test/unit/test_localToImapFilter.js @@ -98,17 +98,17 @@ function folderCount(folder) { count++; let hdr = enumerator.getNext(); } return count; } function setup() { - setupIMAPPump(); + setupIMAPPump(); gEmptyLocal1 = localAccountUtils.incomingServer .rootFolder.createLocalSubfolder("empty 1"); gEmptyLocal2 = localAccountUtils.incomingServer .rootFolder.createLocalSubfolder("empty 2"); // these hacks are required because we've created the inbox before // running initial folder discovery, and adding the folder bails // out before we set it as verified online, so we bail out, and diff --git a/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js b/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js --- a/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js +++ b/mailnews/imap/test/unit/test_nsIMsgFolderListenerIMAP.js @@ -254,17 +254,17 @@ function doTest(test) dump("Doing test " + test + "\n"); if (test <= gTestArray.length) { let testFn = gTestArray[test-1]; // Set a limit of ten seconds; if the notifications haven't arrived by then there's a problem. do_timeout(10000, function(){ if (gTest == test) - do_throw("Notifications not received in 10000 ms for operation " + testFn.name + + do_throw("Notifications not received in 10000 ms for operation " + testFn.name + ", current status is " + gCurrStatus); } ); testFn(); } else { gMFNService.removeListener(gMFListener); diff --git a/mailnews/imap/test/unit/test_offlineStoreLocking.js b/mailnews/imap/test/unit/test_offlineStoreLocking.js --- a/mailnews/imap/test/unit/test_offlineStoreLocking.js +++ b/mailnews/imap/test/unit/test_offlineStoreLocking.js @@ -177,17 +177,17 @@ function setup() { for (let i = 0; i < 50; i++) messages = messages.concat(messageGenerator.makeMessage({body: {body: bodyString, contentType: "text/plain"}})); addGeneratedMessagesToServer(messages, IMAPPump.daemon.getMailbox("INBOX")); } // nsIMsgCopyServiceListener implementation - runs next test when copy // is completed. -var CopyListener = +var CopyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) { let hdr = localAccountUtils.inboxFolder.GetMessageHeader(aKey); gMsgHdrs.push({hdr: hdr, ID: hdr.messageId}); }, diff --git a/mailnews/imap/test/unit/test_partsOnDemand.js b/mailnews/imap/test/unit/test_partsOnDemand.js --- a/mailnews/imap/test/unit/test_partsOnDemand.js +++ b/mailnews/imap/test/unit/test_partsOnDemand.js @@ -102,17 +102,17 @@ function* testAllInlineMessage() async_driver(); }, true /* allowDownload */, { partsOnDemand: true }); yield false; } } function* updateCounts() { - // select the trash, then the inbox again, to force an update of the + // select the trash, then the inbox again, to force an update of the // read state of messages. let trash = IMAPPump.incomingServer.rootFolder.getChildNamed("Trash"); do_check_true(trash instanceof Ci.nsIMsgImapMailFolder); trash.updateFolderWithListener(null, asyncUrlListener); yield false; IMAPPump.inbox.updateFolderWithListener(null, asyncUrlListener); yield false; } diff --git a/mailnews/imap/test/unit/test_preserveDataOnMove.js b/mailnews/imap/test/unit/test_preserveDataOnMove.js --- a/mailnews/imap/test/unit/test_preserveDataOnMove.js +++ b/mailnews/imap/test/unit/test_preserveDataOnMove.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/. */ // This tests that arbitrary message header properties are preserved // during online move of an imap message. -// async support +// async support load("../../../resources/logHelper.js"); load("../../../resources/asyncTestUtils.js"); // IMAP pump // Globals Cu.import("resource:///modules/mailServices.js"); diff --git a/mailnews/imap/test/unit/test_syncChanges.js b/mailnews/imap/test/unit/test_syncChanges.js --- a/mailnews/imap/test/unit/test_syncChanges.js +++ b/mailnews/imap/test/unit/test_syncChanges.js @@ -19,17 +19,17 @@ var tests = [ let rootFolder = IMAPPump.incomingServer.rootFolder; gSecondFolder = rootFolder.getChildNamed("secondFolder") .QueryInterface(Ci.nsIMsgImapMailFolder); // Selecting the second folder will close the cached connection // on the inbox because fake server only supports one connection at a time. // Then, we can poke at the message on the imap server directly, which // simulates the user changing the message from a different machine, - // and Thunderbird discovering the change when it does a flag sync + // and Thunderbird discovering the change when it does a flag sync // upon reselecting the Inbox. gSecondFolder.updateFolderWithListener(null, asyncUrlListener); yield false; }, function* simulateMailboxEmptied() { gMessage.setFlag("\\Deleted"); IMAPPump.inbox.expunge(asyncUrlListener, null); yield false; diff --git a/mailnews/imap/test/unit/test_trustSpamAssassin.js b/mailnews/imap/test/unit/test_trustSpamAssassin.js --- a/mailnews/imap/test/unit/test_trustSpamAssassin.js +++ b/mailnews/imap/test/unit/test_trustSpamAssassin.js @@ -1,22 +1,22 @@ /* 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 tests recognizing a message as junk due to * SpamAssassin headers, and marking that as good * without having the message return to the junk folder, * as discussed in bug 540385. * * adapted from test_filterNeedsBody.js */ -// async support +// async support load("../../../resources/logHelper.js"); load("../../../resources/asyncTestUtils.js"); // IMAP pump // Globals Cu.import("resource:///modules/mailServices.js"); @@ -145,17 +145,17 @@ function run_test() spamSettings.initialize(server); // Add folder listeners that will capture async events const nsIMFNService = Ci.nsIMsgFolderNotificationService; let flags = nsIMFNService.msgsMoveCopyCompleted | - nsIMFNService.folderAdded | + nsIMFNService.folderAdded | nsIMFNService.msgAdded; MailServices.mfn.addListener(mfnListener, flags); //start first test async_run_tests(tests); } var mfnListener = diff --git a/mailnews/import/content/fieldMapImport.js b/mailnews/import/content/fieldMapImport.js --- a/mailnews/import/content/fieldMapImport.js +++ b/mailnews/import/content/fieldMapImport.js @@ -78,17 +78,17 @@ function ListFields() { } function CreateField( name, index, on) { var item = document.createElement('listitem'); item.setAttribute('field-index', index); item.setAttribute('type', "checkbox"); var cell = document.createElement('listcell'); - var cCell = document.createElement( 'listcell'); + var cCell = document.createElement( 'listcell'); cCell.setAttribute('type', "checkbox"); cCell.setAttribute( 'label', name); if (on == true) cCell.setAttribute( 'checked', "true"); item.appendChild( cCell); cell.setAttribute( "class", "importsampledata"); cell.setAttribute( 'label', ""); item.appendChild( cell); @@ -145,17 +145,17 @@ function FetchSampleData(num) { if (!top.addInterface) return false; var data = top.addInterface.GetData( "sampleData-" + num); if (!(data instanceof Ci.nsISupportsString)) return false; ShowSampleData( data.data); - return true; + return true; } function Browse(step) { recordNum += step; if (FetchSampleData(recordNum - 1)) document.getElementById('recordNumber').setAttribute('value', ("" + recordNum)); diff --git a/mailnews/import/test/unit/resources/addressbook.json b/mailnews/import/test/unit/resources/addressbook.json --- a/mailnews/import/test/unit/resources/addressbook.json +++ b/mailnews/import/test/unit/resources/addressbook.json @@ -68,17 +68,17 @@ } ], "quote_csv" : [ { "DisplayName" : "Acer America", "Work Phone" : "(800) 000-0000", "Organization" : "Acer America" - } + } ], "vcard_import" : [ { "DisplayName" : "John Doe", "FirstName" : "John", "LastName" : "Doe", "PrimaryEmail" : "john.doe@genericemail.invalid" diff --git a/mailnews/import/test/unit/resources/import_helper.js b/mailnews/import/test/unit/resources/import_helper.js --- a/mailnews/import/test/unit/resources/import_helper.js +++ b/mailnews/import/test/unit/resources/import_helper.js @@ -31,17 +31,17 @@ function GenericImportHelper(aModuleType this.mFile = aFile; // checked in the beginImport method } GenericImportHelper.prototype = { interfaceType: Ci.nsIImportGeneric, /** * GenericImportHelper.beginImport - * Imports the given address book export or mail data and invoke + * Imports the given address book export or mail data and invoke * checkProgress of child class to check the data, */ beginImport: function() { do_check_true(this.mFile instanceof Ci.nsIFile && this.mFile.exists()); if (this.mModuleType == "addressbook") this.mInterface.SetData("addressLocation", this.mFile); else if (this.mModuleType == "mail") diff --git a/mailnews/intl/test/unit/CharsetConversionTests.js b/mailnews/intl/test/unit/CharsetConversionTests.js --- a/mailnews/intl/test/unit/CharsetConversionTests.js +++ b/mailnews/intl/test/unit/CharsetConversionTests.js @@ -1,13 +1,13 @@ var CC = Components.Constructor; function CreateScriptableConverter() { - var ScriptableUnicodeConverter = + var ScriptableUnicodeConverter = CC("@mozilla.org/intl/scriptableunicodeconverter", "nsIScriptableUnicodeConverter"); return new ScriptableUnicodeConverter(); } function checkDecode(converter, charset, inText, expectedText) { diff --git a/mailnews/local/test/unit/test_folderLoaded.js b/mailnews/local/test/unit/test_folderLoaded.js --- a/mailnews/local/test/unit/test_folderLoaded.js +++ b/mailnews/local/test/unit/test_folderLoaded.js @@ -23,17 +23,17 @@ var gTargetFolder = null; var tests = [ function* setup() { do_timeout(5000, function() { // should be done by now do_check_true(false); }); - + if (typeof localAccountUtils.inboxFolder == 'undefined') localAccountUtils.loadLocalMailAccount(); localAccountUtils.rootFolder.createSubfolder("target", null); gTargetFolder = localAccountUtils.rootFolder.getChildNamed("target"); MailServices.copy.CopyFileMessage(gMsgFile1, gTargetFolder, null, false, 0, "", asyncCopyListener, null); yield false; diff --git a/mailnews/local/test/unit/test_msgCopy.js b/mailnews/local/test/unit/test_msgCopy.js --- a/mailnews/local/test/unit/test_msgCopy.js +++ b/mailnews/local/test/unit/test_msgCopy.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 setting keywords with CopyFileMessage var bugmail11 = do_get_file("../../../data/bugmail11"); - + // main test // tag used with test messages var tag1 = "istag"; function run_test() { do_test_pending(); diff --git a/mailnews/mailnews.js b/mailnews/mailnews.js --- a/mailnews/mailnews.js +++ b/mailnews/mailnews.js @@ -403,17 +403,17 @@ pref("mail.identity.default.overrideGlob pref("mail.identity.default.auto_quote", true); pref("mail.identity.default.reply_on_top", 0); // 0=bottom 1=top 2=select pref("mail.identity.default.sig_bottom", true); // true=below quoted false=above quoted pref("mail.identity.default.sig_on_fwd", false); // Include signature on fwd? pref("mail.identity.default.sig_on_reply", true); // Include signature on re? // Suppress double-dash signature separator pref("mail.identity.default.suppress_signature_separator", false); - + // default to archives folder on same server. pref("mail.identity.default.archives_folder_picker_mode", "0"); // Headers to always add to outgoing mail // examples: "header1,header2" // pref("mail.identity.id1.headers", "header1"); // user_pref("mail.identity.id1.header.header1", "X-Mozilla-Rocks: True") pref("mail.identity.default.headers", ""); diff --git a/mailnews/mime/jsmime/test/test_header_emitter.js b/mailnews/mime/jsmime/test/test_header_emitter.js --- a/mailnews/mime/jsmime/test/test_header_emitter.js +++ b/mailnews/mime/jsmime/test/test_header_emitter.js @@ -137,17 +137,17 @@ suite('headeremitter', function () { for (let line of this.output.split('\r\n')) assert.ok(line.length <= 30, "Line is too long"); } } let header_tests = [ ["My house burned down!", "My house burned down!"], // Which variables need to be encoded in QP encoding? - ["! \" # $ % & ' ( ) * + - .", + ["! \" # $ % & ' ( ) * + - .", "! \" # $ % & ' ( ) * + - ."], [" / : ; < = > ? , @ [ \\ ] ^ _ ` { | } ~ \x7f", "=?UTF-8?Q?_/_:_;_<_=3d_>_=3f?=\r\n" + " =?UTF-8?Q?_=2c_@_[_\\_]_^_?=\r\n" + " =?UTF-8?Q?=5f_`_{_|_}_~_=7f?="], // But non-printable characters don't need it in the first place! ["! \" # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~", "! \" # $ % & ' ( ) * + , - . /\r\n" + diff --git a/mailnews/mime/test/unit/test_alternate_p7m_handling.js b/mailnews/mime/test/unit/test_alternate_p7m_handling.js --- a/mailnews/mime/test/unit/test_alternate_p7m_handling.js +++ b/mailnews/mime/test/unit/test_alternate_p7m_handling.js @@ -12,17 +12,17 @@ var gMessenger = Cc["@mozilla.org/messen // Create a message generator var msgGen = gMessageGenerator = new MessageGenerator(); var p7mAttachment = "dGhpcyBpcyBub3QgYSByZWFsIHMvbWltZSBwN20gZW50aXR5"; // create a message with a p7m attachment var messages = { - attachments: [{ + attachments: [{ body: p7mAttachment, filename: 'test.txt.p7m', contentType: 'application/pkcs7-mime', format:'', encoding: "base64" }] }; @@ -30,17 +30,17 @@ var msgWindow = Cc["@mozilla.org/messeng .createInstance(Ci.nsIMsgWindow); function* worker(params) { let synMsg = gMessageGenerator.makeMessage(params.messages); let synSet = new SyntheticMessageSet([synMsg]); yield add_sets_to_folder(gInbox, [synSet]); let msgHdr = synSet.getMsgHdr(0); - + Services.prefs.setBoolPref("mailnews.p7m_external", params.all_external); Services.prefs.setBoolPref("mailnews.p7m_subparts_external", params.subparts_external); MsgHdrToMimeMessage(msgHdr, null, function (aMsgHdr, aMimeMsg) { try { Assert.ok(aMimeMsg.allUserAttachments.length == params.count); async_driver(); } catch (err) { diff --git a/mailnews/mime/test/unit/test_mimeStreaming.js b/mailnews/mime/test/unit/test_mimeStreaming.js --- a/mailnews/mime/test/unit/test_mimeStreaming.js +++ b/mailnews/mime/test/unit/test_mimeStreaming.js @@ -4,17 +4,17 @@ /** * 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. */ Cu.import("resource://testing-common/mailnews/localAccountUtils.js"); Cu.import("resource:///modules/IOUtils.js"); -var gTestFiles =[ +var gTestFiles =[ "../../../data/bug505221", "../../../data/bug513543", ]; var gMsgEnumerator; var gMessenger = Cc["@mozilla.org/messenger;1"]. createInstance(Ci.nsIMessenger); diff --git a/mailnews/news/test/unit/test_getNewsMessage.js b/mailnews/news/test/unit/test_getNewsMessage.js --- a/mailnews/news/test/unit/test_getNewsMessage.js +++ b/mailnews/news/test/unit/test_getNewsMessage.js @@ -70,17 +70,17 @@ function run_test() { var folder = localserver.rootFolder.getChildNamed("test.subscribe.simple"); folder.clearFlag(Ci.nsMsgFolderFlags.Offline); folder.getNewMessages(null, { OnStopRunningUrl: function () { localserver.closeCachedConnections(); }}); server.performTest(); do_check_eq(folder.getTotalMessages(false), 1); do_check_true(folder.hasNewMessages); - + server.resetTest(); var message = folder.firstNewMessage; var messageUri = folder.getUriForMsg(message); var nntpService = Cc["@mozilla.org/messenger/nntpservice;1"] .getService(Ci.nsIMsgMessageService); diff --git a/mailnews/news/test/unit/test_nntpPassword2.js b/mailnews/news/test/unit/test_nntpPassword2.js --- a/mailnews/news/test/unit/test_nntpPassword2.js +++ b/mailnews/news/test/unit/test_nntpPassword2.js @@ -54,17 +54,17 @@ add_task(function *() { Services.prefs.setCharPref("mail.server.server2.realhostname", "localhost"); Services.prefs.setCharPref("mail.server.server2.type", "nntp"); // Prepare files for passwords (generated by a script in bug 1018624). yield setupForPassword("signons-mailnews1.8-alt.json"); try { - // Note, the uri is for hostname "invalid" which is the original uri. See + // Note, the uri is for hostname "invalid" which is the original uri. See // setupProtocolTest parameters. var prefix = "news://invalid:" + server.port + "/"; // Test - group subscribe listing test = "news:*"; // Get the existing incoming server MailServices.accounts.LoadAccounts(); diff --git a/mailnews/news/test/unit/test_nntpUrl.js b/mailnews/news/test/unit/test_nntpUrl.js --- a/mailnews/news/test/unit/test_nntpUrl.js +++ b/mailnews/news/test/unit/test_nntpUrl.js @@ -18,13 +18,13 @@ function getMessageHeaderFromUrl(aUrl) { function run_test() { // This is crash test for Bug 392729 try { // msgkey is invalid for news:// protocol let hdr = getMessageHeaderFromUrl("news://localhost:119" + "/123@example.invalid?group=test.subscribe.simple&key=abcdefghijk"); - do_check_true(false); + do_check_true(false); } catch (e) { do_check_eq(e.result, Cr.NS_ERROR_MALFORMED_URI); } } diff --git a/mailnews/test/fakeserver/maild.js b/mailnews/test/fakeserver/maild.js --- a/mailnews/test/fakeserver/maild.js +++ b/mailnews/test/fakeserver/maild.js @@ -49,17 +49,17 @@ var TIMEOUT = 3*60*1000; * the state for the logical server). To make a new server, one needs to pass * in a function to create handlers--not the handlers themselves--and the * backend daemon. Since each handler presumably needs access to the logical * server daemon, that is passed into the handler creation function. A new * handler will be constructed for every connection made. * * As the core code is inherently single-threaded, it is guaranteed that all of * the calls to the daemon will be made on the same thread, so you do not have - * to worry about reentrancy in daemon calls. + * to worry about reentrancy in daemon calls. * ****************************************************************************** * Typical usage: * function createHandler(daemon) { * return new handler(daemon); * } * do_test_pending(); * var server = new nsMailServer(createHandler, serverDaemon); @@ -333,17 +333,17 @@ function nsMailReader(server, handler, t if (this.transaction) this.transaction.us.push(response); this._output.write(response, response.length); this._output.flush(); this._multiline = false; this._isRunning = true; - + this.observer = { server : server, forced : false, notify : function (timer) { this.forced = true; this.server.stopTest(); this.server.stop(); }, diff --git a/mailnews/test/fakeserver/nntpd.js b/mailnews/test/fakeserver/nntpd.js --- a/mailnews/test/fakeserver/nntpd.js +++ b/mailnews/test/fakeserver/nntpd.js @@ -547,17 +547,17 @@ subclass(NNTP_RFC4643_extension, NNTP_RF return "381 Password required"; this.authenticated = this.lastGroupTried ? this.lastGroupTried : true; return "281 Authentication Accepted"; } else if (action == "pass") { if (!this.requireBoth || !this.usernameReceived) return "482 Authetication commands issued out of sequence"; - + this.usernameReceived = false; var expectPassword = this.lastGroupTried ? this._daemon.groupCredentials[this.lastGroupTried][1] : this.expectedPassword; if (param != expectPassword) return "481 Authentication failed"; diff --git a/mailnews/test/fakeserver/pop3d.js b/mailnews/test/fakeserver/pop3d.js --- a/mailnews/test/fakeserver/pop3d.js +++ b/mailnews/test/fakeserver/pop3d.js @@ -68,17 +68,17 @@ function pop3Daemon(flags) { this._messages = []; } pop3Daemon.prototype = { _messages: null, _totalMessageSize: 0, /** * Set the messages that the POP3 daemon will provide to its clients. - * + * * @param messages An array of either 1) strings that are filenames whose * contents will be loaded from the files or 2) objects with a "fileData" * attribute whose value is the content of the file. */ setMessages: function(messages) { this._messages = []; this._totalMessageSize = 0; diff --git a/mailnews/test/resources/alertTestUtils.js b/mailnews/test/resources/alertTestUtils.js --- a/mailnews/test/resources/alertTestUtils.js +++ b/mailnews/test/resources/alertTestUtils.js @@ -40,65 +40,65 @@ var alertUtilsPrompts = { if (typeof alert == "function") { alert(aDialogTitle, aText); return; } do_throw("alert unexpectedly called: " + aText + "\n"); return; }, - + alertCheck: function(aDialogTitle, aText, aCheckMsg, aCheckState) { if (typeof alertCheck == "function") { alertCheck(aDialogTitle, aText, aCheckMsg, aCheckState); return; } do_throw("alertCheck unexpectedly called: " + aText + "\n"); return; }, - + confirm: function(aDialogTitle, aText) { if (typeof confirm == "function") { return confirm(aDialogTitle, aText); } do_throw("confirm unexpectedly called: " + aText + "\n"); return false; }, - + confirmCheck: function(aDialogTitle, aText, aCheckMsg, aCheckState) { if (typeof confirmCheck == "function") { return confirmCheck(aDialogTitle, aText, aCheckMsg, aCheckState); } do_throw("confirmCheck unexpectedly called: " + aText + "\n"); return false; }, - + confirmEx: function(aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) { if (typeof confirmEx == "function") { return confirmEx(aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState); } do_throw("confirmEx unexpectedly called: " + aText + "\n"); return 0; }, - + prompt: function(aDialogTitle, aText, aValue, aCheckMsg, aCheckState) { if (typeof prompt == "function") { return prompt(aDialogTitle, aText, aValue, aCheckMsg, aCheckState); } do_throw("prompt unexpectedly called: " + aText + "\n"); return false; }, - + promptUsernameAndPassword: function(aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) { if (typeof promptUsernameAndPassword == "function") { return promptUsernameAndPassword(aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState); } do_throw("promptUsernameAndPassword unexpectedly called: " + aText + "\n"); @@ -110,94 +110,94 @@ var alertUtilsPrompts = { if (typeof promptPassword == "function") { return promptPassword(aDialogTitle, aText, aPassword, aCheckMsg, aCheckState); } do_throw("promptPassword unexpectedly called: " + aText + "\n"); return false; }, - + select: function(aDialogTitle, aText, aCount, aSelectList, aOutSelection) { if (typeof select == "function") { return select(aDialogTitle, aText, aCount, aSelectList, aOutSelection); } do_throw("select unexpectedly called: " + aText + "\n"); return false; }, - + QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]) }; var alertUtilsPromptService = { alert: function(aParent, aDialogTitle, aText) { if (typeof alertPS == "function") { alertPS(aParent, aDialogTitle, aText); return; } do_throw("alertPS unexpectedly called: " + aText + "\n"); return; }, - + alertCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) { if (typeof alertCheckPS == "function") { alertCheckPS(aParent, aDialogTitle, aText, aCheckMsg, aCheckState); return; } do_throw("alertCheckPS unexpectedly called: " + aText + "\n"); return; }, - + confirm: function(aParent, aDialogTitle, aText) { if (typeof confirmPS == "function") { return confirmPS(aParent, aDialogTitle, aText); } do_throw("confirmPS unexpectedly called: " + aText + "\n"); return false; }, - + confirmCheck: function(aParent, aDialogTitle, aText, aCheckMsg, aCheckState) { if (typeof confirmCheckPS == "function") { return confirmCheckPS(aParent, aDialogTitle, aText, aCheckMsg, aCheckState); } do_throw("confirmCheckPS unexpectedly called: " + aText + "\n"); return false; }, - + confirmEx: function(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState) { if (typeof confirmExPS == "function") { return confirmExPS(aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState); } do_throw("confirmExPS unexpectedly called: " + aText + "\n"); return 0; }, - + prompt: function(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState) { if (typeof promptPS == "function") { return promptPS(aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState); } do_throw("promptPS unexpectedly called: " + aText + "\n"); return false; }, - + promptUsernameAndPassword: function(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState) { if (typeof promptUsernameAndPasswordPS == "function") { return promptUsernameAndPasswordPS(aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState); } @@ -210,28 +210,28 @@ var alertUtilsPromptService = { if (typeof promptPasswordPS == "function") { return promptPasswordPS(aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState); } do_throw("promptPasswordPS unexpectedly called: " + aText + "\n"); return false; }, - + select: function(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection) { if (typeof selectPS == "function") { return selectPS(aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection); } do_throw("selectPS unexpectedly called: " + aText + "\n"); return false; }, - + createInstance: function createInstance(outer, iid) { if (outer != null) throw Cr.NS_ERROR_NO_AGGREGATION; return this.QueryInterface(iid); }, QueryInterface: XPCOMUtils.generateQI([Ci.nsIPromptService, Ci.nsIPromptService2]) diff --git a/mailnews/test/resources/mailShutdown.js b/mailnews/test/resources/mailShutdown.js --- a/mailnews/test/resources/mailShutdown.js +++ b/mailnews/test/resources/mailShutdown.js @@ -1,9 +1,9 @@ - + /* Provides methods to make sure our test shuts down mailnews properly. */ // Notifies everyone that the we're shutting down. This is needed to make sure // that e.g. the account manager closes and cleans up correctly. It is semi-fake // because we don't actually do any work to make sure the profile goes away, but // it will mimic the behaviour in the app sufficiently. // // See also http://developer.mozilla.org/en/Observer_Notifications diff --git a/mailnews/test/resources/msgFolderListenerSetup.js b/mailnews/test/resources/msgFolderListenerSetup.js --- a/mailnews/test/resources/msgFolderListenerSetup.js +++ b/mailnews/test/resources/msgFolderListenerSetup.js @@ -110,17 +110,17 @@ var gMFListener = verify([gMFNService.msgKeyChanged, aOldKey, aNewMsgHdr]); if (gExpectedEvents.length == 0) { gCurrStatus |= kStatus.notificationsDone; if (gCurrStatus == kStatus.everythingDone) resetStatusAndProceed(); } }, - + folderAdded: function(aFolder) { verify([gMFNService.folderAdded, aFolder]); if (gExpectedEvents.length == 0) { gCurrStatus |= kStatus.notificationsDone; if (gCurrStatus == kStatus.everythingDone) resetStatusAndProceed(); diff --git a/mailnews/test/resources/searchTestUtils.js b/mailnews/test/resources/searchTestUtils.js --- a/mailnews/test/resources/searchTestUtils.js +++ b/mailnews/test/resources/searchTestUtils.js @@ -1,12 +1,12 @@ /* 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/. */ - + // Contains various functions commonly used in testing mailnews search /** * TestSearch: Class to test number of search hits * * @param aFolder: the folder to search * @param aValue: value used for the search * The interpretation of aValue depends on aAttrib. It @@ -23,38 +23,38 @@ * @param aHdrProperty for HdrProperty and Uint32HdrProperty case * */ function TestSearch(aFolder, aValue, aAttrib, aOp, aHitCount, onDone, aCustomId, aArbitraryHeader, aHdrProperty) { var searchListener = - { + { onSearchHit: function(dbHdr, folder) { hitCount++; }, onSearchDone: function(status) - { + { print("Finished search does " + aHitCount + " equal " + hitCount + "?"); searchSession = null; do_check_eq(aHitCount, hitCount); if (onDone) onDone(); }, onNewSearch: function() {hitCount = 0;} }; // define and initiate the search session - + var hitCount; var searchSession = Cc["@mozilla.org/messenger/searchSession;1"] .createInstance(Ci.nsIMsgSearchSession); searchSession.addScopeTerm(Ci.nsMsgSearchScope.offlineMail, aFolder); var searchTerm = searchSession.createTerm(); searchTerm.attrib = aAttrib; - + var value = searchTerm.value; // This is tricky - value.attrib must be set before actual values value.attrib = aAttrib; if (aAttrib == Ci.nsMsgSearchAttrib.JunkPercent) value.junkPercent = aValue; else if (aAttrib == Ci.nsMsgSearchAttrib.Priority) value.priority = aValue; else if (aAttrib == Ci.nsMsgSearchAttrib.Date)