Bug 1110166 - Port bug 1102219 - Rename String.prototype.contains to String.prototype.includes: mail. r=mkmelin
This commit is contained in:
Родитель
2459f02841
Коммит
6420087e0e
|
@ -880,7 +880,7 @@ function getFirstFolder(msgFolder)
|
|||
*/
|
||||
function filterSearchMatch(aFilter, aKeyword)
|
||||
{
|
||||
return (aFilter.filterName.toLocaleLowerCase().contains(aKeyword))
|
||||
return (aFilter.filterName.toLocaleLowerCase().includes(aKeyword))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -495,7 +495,7 @@
|
|||
else
|
||||
labelFormat = glodaFacetStrings.get(
|
||||
"glodaFacetView.facets."+stringName+".fallbackLabel");
|
||||
if (!labelFormat.contains("#1"))
|
||||
if (!labelFormat.includes("#1"))
|
||||
return labelFormat;
|
||||
else
|
||||
return labelFormat.replace("#1", facetValue);
|
||||
|
|
|
@ -462,7 +462,7 @@ var FacetContext = {
|
|||
explicitBinding.orderedGroups = faceter.orderedGroups;
|
||||
// explicit booleans should always be displayed for consistency
|
||||
if (faceter.groupCount >= 1 ||
|
||||
(explicitBinding.getAttribute("type").contains("boolean"))) {
|
||||
(explicitBinding.getAttribute("type").includes("boolean"))) {
|
||||
try {
|
||||
explicitBinding.build(true);
|
||||
} catch (e) {
|
||||
|
|
|
@ -30,7 +30,7 @@ function getBestIdentity(identities, optionalHint)
|
|||
if (!identity.email)
|
||||
continue;
|
||||
if (hints[i].trim() == identity.email.toLowerCase() ||
|
||||
hints[i].contains("<" + identity.email.toLowerCase() + ">"))
|
||||
hints[i].includes("<" + identity.email.toLowerCase() + ">"))
|
||||
return identity;
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ function getIdentityForHeader(hdr, type)
|
|||
continue;
|
||||
// If the deliver-to header contains the defined identity, that's it.
|
||||
if (deliveredTos[i] == identity.email.toLowerCase() ||
|
||||
deliveredTos[i].contains("<" + identity.email.toLowerCase() + ">"))
|
||||
deliveredTos[i].includes("<" + identity.email.toLowerCase() + ">"))
|
||||
return identity.email;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -956,8 +956,8 @@ function InitMessageTags(menuPopup)
|
|||
for (var i = 0; i < tagCount; ++i)
|
||||
{
|
||||
var taginfo = tagArray[i];
|
||||
let removeKey = (" " + curKeys + " ").contains(" " + taginfo.key + " ");
|
||||
if (taginfo.ordinal.contains("~AUTOTAG") && !removeKey)
|
||||
let removeKey = (" " + curKeys + " ").includes(" " + taginfo.key + " ");
|
||||
if (taginfo.ordinal.includes("~AUTOTAG") && !removeKey)
|
||||
continue;
|
||||
|
||||
// TODO we want to either remove or "check" the tags that already exist
|
||||
|
@ -1188,7 +1188,7 @@ function IsReplyAllEnabled()
|
|||
// Check to see if my email address is in the list of addresses.
|
||||
let myEmail = getIdentityForHeader(msgHdr).email;
|
||||
// We aren't guaranteed to have an email address, so guard against that.
|
||||
let imInAddresses = myEmail && (addresses.toLowerCase().contains(
|
||||
let imInAddresses = myEmail && (addresses.toLowerCase().includes(
|
||||
myEmail.toLowerCase()));
|
||||
|
||||
// Now, let's get the number of unique addresses.
|
||||
|
@ -1204,7 +1204,7 @@ function IsReplyAllEnabled()
|
|||
// show up in the address at all.)
|
||||
for (var i in emailAddresses.value)
|
||||
{
|
||||
if (emailAddresses.value[i].contains(":"))
|
||||
if (emailAddresses.value[i].includes(":"))
|
||||
numAddresses--;
|
||||
}
|
||||
|
||||
|
@ -3179,7 +3179,7 @@ function onRemoteContentOptionsShowing(aEvent) {
|
|||
// ... and in with the new.
|
||||
for (let host of hosts) {
|
||||
let uri = Services.io.newURI(
|
||||
host.contains("@") ? "mailto:" + host : "http://" + host, null, null);
|
||||
host.includes("@") ? "mailto:" + host : "http://" + host, null, null);
|
||||
|
||||
let menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute("label",
|
||||
|
|
|
@ -539,7 +539,7 @@ var messageHeaderSink = {
|
|||
var fromMailboxes = kMailboxSeparator +
|
||||
MailServices.headerParser.extractHeaderAddressMailboxes(
|
||||
currentHeaderData.from.headerValue) + kMailboxSeparator;
|
||||
if (fromMailboxes.contains(senderMailbox))
|
||||
if (fromMailboxes.includes(senderMailbox))
|
||||
delete currentHeaderData.sender;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,14 +118,14 @@ function GenerateValidFilename(filename, extension)
|
|||
function validateFileName(aFileName)
|
||||
{
|
||||
var re = /[\/]+/g;
|
||||
if (navigator.appVersion.contains("Windows")) {
|
||||
if (navigator.appVersion.includes("Windows")) {
|
||||
re = /[\\\/\|]+/g;
|
||||
aFileName = aFileName.replace(/[\"]+/g, "'");
|
||||
aFileName = aFileName.replace(/[\*\:\?]+/g, " ");
|
||||
aFileName = aFileName.replace(/[\<]+/g, "(");
|
||||
aFileName = aFileName.replace(/[\>]+/g, ")");
|
||||
}
|
||||
else if (navigator.appVersion.contains("Macintosh"))
|
||||
else if (navigator.appVersion.includes("Macintosh"))
|
||||
re = /[\:\/]+/g;
|
||||
|
||||
if (Services.prefs.getBoolPref("mail.save_msg_filename_underscores_for_space"))
|
||||
|
|
|
@ -54,7 +54,7 @@ var mailInstrumentationManager =
|
|||
|
||||
_accountsChanged: function() {
|
||||
// check if there are at least two accounts - one is local folders account
|
||||
if (Services.prefs.getCharPref("mail.accountmanager.accounts").contains(',', 1)) {
|
||||
if (Services.prefs.getCharPref("mail.accountmanager.accounts").includes(',', 1)) {
|
||||
mailInstrumentationManager.addEvent("accountAdded", true);
|
||||
mailInstrumentationManager._removeObserver(
|
||||
"mail.accountmanager.accounts",
|
||||
|
|
|
@ -37,7 +37,7 @@ var gCustomSearchTermSubject = {
|
|||
return [Components.interfaces.nsMsgSearchOp.Contains];
|
||||
},
|
||||
match: function subject_match(aMsgHdr, aSearchValue, aSearchOp) {
|
||||
return (aMsgHdr.subject.contains(aSearchValue));
|
||||
return (aMsgHdr.subject.includes(aSearchValue));
|
||||
},
|
||||
needsBody: false,
|
||||
};
|
||||
|
|
|
@ -582,7 +582,7 @@ function CheckAndSetCardValues(cardproperty, doc, check)
|
|||
function CleanUpWebPage(webPage)
|
||||
{
|
||||
// no :// yet so we should add something
|
||||
if (webPage.length && !webPage.contains("://"))
|
||||
if (webPage.length && !webPage.includes("://"))
|
||||
{
|
||||
// check for missing / on http://
|
||||
if (webPage.startsWith("http:/"))
|
||||
|
|
|
@ -2734,7 +2734,7 @@ function CheckValidEmailAddress(aMsgCompFields)
|
|||
// We could parse each address, but that might be overkill.
|
||||
function isInvalidAddress(aAddress) {
|
||||
return (aAddress.length > 0 &&
|
||||
((!aAddress.contains("@", 1) && aAddress.toLowerCase() != "postmaster") ||
|
||||
((!aAddress.includes("@", 1) && aAddress.toLowerCase() != "postmaster") ||
|
||||
aAddress.endsWith("@")));
|
||||
}
|
||||
if (isInvalidAddress(aMsgCompFields.to))
|
||||
|
|
|
@ -794,7 +794,7 @@ function awRecipientKeyPress(event, element)
|
|||
case KeyEvent.DOM_VK_RETURN:
|
||||
case KeyEvent.DOM_VK_TAB:
|
||||
// if the user text contains a comma or a line return, ignore
|
||||
if (element.value.contains(','))
|
||||
if (element.value.includes(','))
|
||||
{
|
||||
var addresses = element.value;
|
||||
element.value = ""; // clear out the current line so we don't try to autocomplete it..
|
||||
|
@ -1034,7 +1034,7 @@ AutomatedAutoCompleteHandler.prototype =
|
|||
{
|
||||
/* XXX This is used to work, until switching to the new toolkit broke it
|
||||
We should fix it see bug 456550.
|
||||
if (!this.namesToComplete[this.indexIntoNames].contains('@')) // don't autocomplete if address has an @ sign in it
|
||||
if (!this.namesToComplete[this.indexIntoNames].includes('@')) // don't autocomplete if address has an @ sign in it
|
||||
{
|
||||
// make sure total session count is updated before we kick off ANY actual searches
|
||||
if (gAutocompleteSession)
|
||||
|
|
|
@ -968,7 +968,7 @@
|
|||
if (event.metaKey)
|
||||
modifiers |= masks.META_MASK;
|
||||
if (event.accelKey)
|
||||
modifiers |= (navigator.platform.contains("Mac")) ? masks.META_MASK
|
||||
modifiers |= (navigator.platform.includes("Mac")) ? masks.META_MASK
|
||||
: masks.CONTROL_MASK;
|
||||
|
||||
// resend the event
|
||||
|
|
|
@ -1138,8 +1138,8 @@ var gApplicationsPane = {
|
|||
|
||||
_matchesFilter: function(aType) {
|
||||
var filterValue = this._filter.value.toLowerCase();
|
||||
return this._describeType(aType).toLowerCase().contains(filterValue) ||
|
||||
this._describePreferredAction(aType).toLowerCase().contains(filterValue);
|
||||
return this._describeType(aType).toLowerCase().includes(filterValue) ||
|
||||
this._describePreferredAction(aType).toLowerCase().includes(filterValue);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -813,9 +813,9 @@ var gCookiesWindow = {
|
|||
|
||||
_cookieMatchesFilter: function (aCookie)
|
||||
{
|
||||
return aCookie.rawHost.contains(this._view._filterValue) ||
|
||||
aCookie.name.contains(this._view._filterValue) ||
|
||||
aCookie.value.contains(this._view._filterValue);
|
||||
return aCookie.rawHost.includes(this._view._filterValue) ||
|
||||
aCookie.name.includes(this._view._filterValue) ||
|
||||
aCookie.value.includes(this._view._filterValue);
|
||||
},
|
||||
|
||||
_filterCookies: function (aFilterValue)
|
||||
|
|
|
@ -112,7 +112,7 @@ var gGeneralPane = {
|
|||
soundLocation = document.getElementById('soundType').value == 1 ?
|
||||
document.getElementById('soundUrlLocation').value : "";
|
||||
|
||||
if (!soundLocation.contains("file://")) {
|
||||
if (!soundLocation.includes("file://")) {
|
||||
if (Services.appinfo.OS == "Darwin") // OS X
|
||||
sound.beep();
|
||||
else
|
||||
|
|
|
@ -72,7 +72,7 @@ var gPermissionManager = {
|
|||
addPermission: function (aCapability)
|
||||
{
|
||||
var textbox = document.getElementById("url");
|
||||
let scheme = textbox.value.contains("@") ? "mailto:" : "http://";
|
||||
let scheme = textbox.value.includes("@") ? "mailto:" : "http://";
|
||||
let host = textbox.value.replace(/^\s*([-\w]*:\/*)?/, ""); // trim any leading space and scheme
|
||||
try {
|
||||
let uri = Services.io.newURI(scheme + host, null, null);
|
||||
|
|
|
@ -157,7 +157,7 @@ function test_get_account_details() {
|
|||
|
||||
// Our first check is to see that no sensitive data has crept in
|
||||
for (let [, data] in Iterator(gSensitiveData))
|
||||
do_check_false(accountDetailsText.contains(data));
|
||||
do_check_false(accountDetailsText.includes(data));
|
||||
|
||||
for (let [, details] in Iterator(accountDetails)) {
|
||||
// We're going to make one exception: for the local folders server. We don't
|
||||
|
|
|
@ -356,7 +356,7 @@ function test_attachment_renamed() {
|
|||
let originalName1 = lastEvent.detail;
|
||||
assert_true(renamedAttachment1 instanceof Ci.nsIMsgAttachment);
|
||||
assert_equals(kRenameTo1, renamedAttachment1.name);
|
||||
assert_true(renamedAttachment1.url.contains("http://www.example.com/1"));
|
||||
assert_true(renamedAttachment1.url.includes("http://www.example.com/1"));
|
||||
assert_equals("www.example.com/1", originalName1);
|
||||
|
||||
// Ok, let's try renaming the same attachment.
|
||||
|
@ -372,7 +372,7 @@ function test_attachment_renamed() {
|
|||
let originalName2 = lastEvent.detail;
|
||||
assert_true(renamedAttachment2 instanceof Ci.nsIMsgAttachment);
|
||||
assert_equals(kRenameTo2, renamedAttachment2.name);
|
||||
assert_true(renamedAttachment2.url.contains("http://www.example.com/1"));
|
||||
assert_true(renamedAttachment2.url.includes("http://www.example.com/1"));
|
||||
assert_equals(kRenameTo1, originalName2);
|
||||
|
||||
// Ok, let's rename another attachment
|
||||
|
@ -391,7 +391,7 @@ function test_attachment_renamed() {
|
|||
let originalName3 = lastEvent.detail;
|
||||
assert_true(renamedAttachment3 instanceof Ci.nsIMsgAttachment);
|
||||
assert_equals(kRenameTo3, renamedAttachment3.name);
|
||||
assert_true(renamedAttachment3.url.contains("http://www.example.com/2"));
|
||||
assert_true(renamedAttachment3.url.includes("http://www.example.com/2"));
|
||||
assert_equals("www.example.com/2", originalName3);
|
||||
|
||||
// Unregister the Mock Prompt service, and remove our observer.
|
||||
|
|
|
@ -149,7 +149,7 @@ function test_no_mojibake() {
|
|||
let draftMsg = select_click_row(1);
|
||||
assert_equals(getMsgHeaders(draftMsg).get("").charset, "UTF-8");
|
||||
let text = getMsgHeaders(draftMsg, true).get("");
|
||||
if (!text.contains(nonASCII))
|
||||
if (!text.includes(nonASCII))
|
||||
throw new Error("Expected to find " + nonASCII + " in " + text);
|
||||
press_delete(mc); // Delete message
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ function test_encoding_upgrade_html_compose() {
|
|||
assert_equals(draftMsg.Charset, "windows-1252");
|
||||
|
||||
let draftMsgContent = getMsgSource(draftMsg);
|
||||
if (!draftMsgContent.contains('content="text/html; charset=windows-1252"'))
|
||||
if (!draftMsgContent.includes('content="text/html; charset=windows-1252"'))
|
||||
throw new Error("Expected content type not in msg; draftMsgContent=" +
|
||||
draftMsgContent);
|
||||
|
||||
|
@ -140,11 +140,11 @@ function test_encoding_upgrade_html_compose() {
|
|||
assert_equals(draftMsg2.Charset, "UTF-8");
|
||||
|
||||
let draftMsg2Content = getMsgSource(draftMsg2);
|
||||
if (!draftMsg2Content.contains('content="text/html; charset=UTF-8"'))
|
||||
if (!draftMsg2Content.includes('content="text/html; charset=UTF-8"'))
|
||||
throw new Error("Expected content type not in msg; draftMsg2Content=" +
|
||||
draftMsg2Content);
|
||||
|
||||
if (!draftMsg2Content.contains(CHINESE))
|
||||
if (!draftMsg2Content.includes(CHINESE))
|
||||
throw new Error("Chinese text not in msg; CHINESE=" + CHINESE +
|
||||
", draftMsg2Content=" + draftMsg2Content);
|
||||
|
||||
|
@ -156,7 +156,7 @@ function test_encoding_upgrade_html_compose() {
|
|||
let outMsgContent = getMsgSource(outMsg);
|
||||
|
||||
// This message should be multipart/alternative.
|
||||
if (!outMsgContent.contains("Content-Type: multipart/alternative"))
|
||||
if (!outMsgContent.includes("Content-Type: multipart/alternative"))
|
||||
throw new Error("Expected multipart/alternative; content=" + outMsgContent);
|
||||
|
||||
let chinesePlainIdx = outMsgContent.indexOf(CHINESE);
|
||||
|
@ -168,7 +168,7 @@ function test_encoding_upgrade_html_compose() {
|
|||
", outMsgContent=" + outMsgContent);
|
||||
|
||||
// Make sure the actual html also got the content type set correctly.
|
||||
if (!outMsgContent.contains('content="text/html; charset=UTF-8"'))
|
||||
if (!outMsgContent.includes('content="text/html; charset=UTF-8"'))
|
||||
throw new Error("Expected content type not in html; outMsgContent=" +
|
||||
outMsgContent);
|
||||
|
||||
|
@ -213,11 +213,11 @@ function test_encoding_upgrade_plaintext_compose() {
|
|||
assert_equals(draftMsg2.Charset, "UTF-8");
|
||||
|
||||
let draftMsg2Content = getMsgSource(draftMsg2);
|
||||
if (draftMsg2Content.contains("<html>"))
|
||||
if (draftMsg2Content.includes("<html>"))
|
||||
throw new Error("Plaintext draft contained <html>; "+
|
||||
"draftMsg2Content=" + draftMsg2Content);
|
||||
|
||||
if (!draftMsg2Content.contains(CHINESE))
|
||||
if (!draftMsg2Content.includes(CHINESE))
|
||||
throw new Error("Chinese text not in msg; CHINESE=" + CHINESE +
|
||||
", draftMsg2Content=" + draftMsg2Content);
|
||||
|
||||
|
@ -229,10 +229,10 @@ function test_encoding_upgrade_plaintext_compose() {
|
|||
let outMsgContent = getMsgSource(outMsg);
|
||||
|
||||
// This message should be text/plain;
|
||||
if (!outMsgContent.contains("Content-Type: text/plain"))
|
||||
if (!outMsgContent.includes("Content-Type: text/plain"))
|
||||
throw new Error("Expected text/plain; content=" + outMsgContent);
|
||||
|
||||
if (!outMsgContent.contains(CHINESE))
|
||||
if (!outMsgContent.includes(CHINESE))
|
||||
throw new Error("Chinese text not in msg; CHINESE=" + CHINESE +
|
||||
", outMsgContent=" + outMsgContent);
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ function test_reply_to_base64_eml() {
|
|||
.querySelector("body").textContent;
|
||||
|
||||
const message = "You have decoded this text from base64.";
|
||||
if (!bodyText.contains(message))
|
||||
if (!bodyText.includes(message))
|
||||
throw new Error("body text didn't contain the decoded text; message=" +
|
||||
message + ", bodyText=" + bodyText);
|
||||
|
||||
|
@ -135,7 +135,7 @@ function test_forward_base64_eml() {
|
|||
.querySelector("body").textContent;
|
||||
|
||||
const message = "You have decoded this text from base64.";
|
||||
if (!bodyText.contains(message))
|
||||
if (!bodyText.includes(message))
|
||||
throw new Error("body text didn't contain the decoded text; message=" +
|
||||
message + ", bodyText=" + bodyText);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ function test_forwarded_subj() {
|
|||
|
||||
let headerTableText = fwdWin.e("content-frame").contentDocument
|
||||
.querySelector("table").textContent;
|
||||
if (!headerTableText.contains(msg.mime2DecodedSubject)) {
|
||||
if (!headerTableText.includes(msg.mime2DecodedSubject)) {
|
||||
throw new Error("Subject not set correctly in header table: subject=" +
|
||||
msg.mime2DecodedSubject + ", header table text=" +
|
||||
headerTableText);
|
||||
|
|
|
@ -103,15 +103,15 @@ function setupWindowAndTest(hotkeyToHit, hotkeyModifiers) {
|
|||
|
||||
let bodyText= compWin.e("content-frame").contentDocument
|
||||
.querySelector("body").textContent;
|
||||
if (bodyText.contains("html"))
|
||||
if (bodyText.includes("html"))
|
||||
throw new Error("body text contains raw html; bodyText=" + bodyText);
|
||||
|
||||
if (!bodyText.contains(msgbodyA))
|
||||
if (!bodyText.includes(msgbodyA))
|
||||
throw new Error("body text didn't contain the body text; msgbodyA=" +
|
||||
msgbodyB + ", bodyText=" + bodyText);
|
||||
|
||||
let subjectText = compWin.e("msgSubject").value;
|
||||
if (!subjectText.contains(msgsubject))
|
||||
if (!subjectText.includes(msgsubject))
|
||||
throw new Error("subject text didn't contain the original subject; " +
|
||||
"msgsubject=" + msgsubject + ", subjectText=" + subjectText);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ function test_basic_multipart_related() {
|
|||
assert_equals(headers.get("2").getRawHeader("Content-Disposition")[0],
|
||||
"inline; filename=\"arrow-dn.gif\"");
|
||||
let cid = headers.get("2").getRawHeader("Content-ID")[0].slice(1, -1);
|
||||
if (!text.get("1").contains("src=\"cid:" + cid + '"')) {
|
||||
if (!text.get("1").includes("src=\"cid:" + cid + '"')) {
|
||||
throw new Error("Expected HTML to refer to cid " + cid);
|
||||
}
|
||||
press_delete(mc); // Delete message
|
||||
|
|
|
@ -94,10 +94,10 @@ function check_sig_strip_works(aRow, aShouldStrip) {
|
|||
let rwc = open_compose_with_reply();
|
||||
let body = get_compose_body(rwc);
|
||||
|
||||
if (aShouldStrip && body.textContent.contains(sig)) {
|
||||
if (aShouldStrip && body.textContent.includes(sig)) {
|
||||
throw new Error("signature was not stripped; body=" + body.textContent);
|
||||
}
|
||||
else if (!aShouldStrip && !body.textContent.contains(sig)) {
|
||||
else if (!aShouldStrip && !body.textContent.includes(sig)) {
|
||||
throw new Error("signature stripped; body=" + body.textContent);
|
||||
}
|
||||
close_compose_window(rwc);
|
||||
|
|
|
@ -82,7 +82,7 @@ function test_view_source_reload() {
|
|||
"Timeout waiting for the latin1 view-source document to load.");
|
||||
|
||||
let source = vsc.e("content").contentDocument.querySelector("pre").textContent;
|
||||
if (!source.contains(contentLatin1))
|
||||
if (!source.includes(contentLatin1))
|
||||
throw new Error("View source didn't contain the latin1 text;\n" +
|
||||
contentLatin1 + "\n" + source);
|
||||
|
||||
|
@ -96,7 +96,7 @@ function test_view_source_reload() {
|
|||
"Timeout waiting utf-8 encoded view-source document to load.");
|
||||
|
||||
source = vsc.e("content").contentDocument.querySelector("pre").textContent;
|
||||
if (!source.contains(contentUTF8))
|
||||
if (!source.includes(contentUTF8))
|
||||
throw new Error("View source didn't contain the utf-8 text;\n" +
|
||||
contentUTF8 + "\n" + source);
|
||||
|
||||
|
|
|
@ -201,18 +201,18 @@ function test_copy_to_clipboard_public() {
|
|||
let text = data.value.QueryInterface(Ci.nsISupportsString).data;
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_STRINGS)) {
|
||||
if (!text.contains(str))
|
||||
if (!text.includes(str))
|
||||
mark_failure(["Unable to find \"" + str + "\" in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_ERROR_STRINGS)) {
|
||||
if (text.contains(str))
|
||||
if (text.includes(str))
|
||||
mark_failure(["Found \"" + str + "\" in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
|
||||
// Check that private data (profile directory) isn't in the output.
|
||||
let profD = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
if (text.contains(profD))
|
||||
if (text.includes(profD))
|
||||
mark_failure(["Found profile directory in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
close_tab(tab);
|
||||
|
@ -242,22 +242,22 @@ function test_copy_to_clipboard_private() {
|
|||
let text = data.value.QueryInterface(Ci.nsISupportsString).data;
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_STRINGS)) {
|
||||
if (!text.contains(str))
|
||||
if (!text.includes(str))
|
||||
mark_failure(["Unable to find \"" + str + "\" in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_ERROR_STRINGS)) {
|
||||
if (text.contains(str))
|
||||
if (text.includes(str))
|
||||
mark_failure(["Found \"" + str + "\" in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
|
||||
// Check that private data (profile directory) is in the output.
|
||||
let profD = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
if (!text.contains(profD))
|
||||
if (!text.includes(profD))
|
||||
mark_failure(["Unable to find profile directory in flavor \"" + flavor + "\""]);
|
||||
|
||||
// Check that the warning text is in the output.
|
||||
if (!text.contains(warningText))
|
||||
if (!text.includes(warningText))
|
||||
mark_failure(["Unable to find warning text in flavor \"" + flavor + "\""]);
|
||||
}
|
||||
close_tab(tab);
|
||||
|
@ -274,18 +274,18 @@ function test_send_via_email_public() {
|
|||
let text = contentFrame.contentDocument.body.innerHTML;
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_STRINGS)) {
|
||||
if (!text.contains(str))
|
||||
if (!text.includes(str))
|
||||
mark_failure(["Unable to find \"" + str + "\" in compose window"]);
|
||||
}
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_ERROR_STRINGS)) {
|
||||
if (text.contains(str))
|
||||
if (text.includes(str))
|
||||
mark_failure(["Found \"" + str + "\" in compose window"]);
|
||||
}
|
||||
|
||||
// Check that private data (profile directory) isn't in the output.
|
||||
let profD = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
if (text.contains(profD))
|
||||
if (text.includes(profD))
|
||||
mark_failure(["Found profile directory in compose window"]);
|
||||
|
||||
close_compose_window(cwc);
|
||||
|
@ -313,22 +313,22 @@ function test_send_via_email_private() {
|
|||
let text = contentFrame.contentDocument.body.innerHTML;
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_STRINGS)) {
|
||||
if (!text.contains(str))
|
||||
if (!text.includes(str))
|
||||
mark_failure(["Unable to find \"" + str + "\" in compose window"]);
|
||||
}
|
||||
|
||||
for (let [, str] in Iterator(ABOUT_SUPPORT_ERROR_STRINGS)) {
|
||||
if (text.contains(str))
|
||||
if (text.includes(str))
|
||||
mark_failure(["Found \"" + str + "\" in compose window"]);
|
||||
}
|
||||
|
||||
// Check that private data (profile directory) is in the output.
|
||||
let profD = Services.dirsvc.get("ProfD", Ci.nsIFile).path;
|
||||
if (!text.contains(profD))
|
||||
if (!text.includes(profD))
|
||||
mark_failure(["Unable to find profile directory in compose window"]);
|
||||
|
||||
// Check that the warning text is in the output.
|
||||
if (!text.contains(warningText))
|
||||
if (!text.includes(warningText))
|
||||
mark_failure(["Unable to find warning text in compose window"]);
|
||||
|
||||
close_compose_window(cwc);
|
||||
|
|
|
@ -59,7 +59,7 @@ function setupModule(module) {
|
|||
* disable them for now, until we can figure out what's going on.
|
||||
*/
|
||||
let is64BitOSX = (mc.mozmillModule.isMac &&
|
||||
Services.appinfo.XPCOMABI.contains("x86_64-"));
|
||||
Services.appinfo.XPCOMABI.includes("x86_64-"));
|
||||
|
||||
// These tests are no good if the crash reporter is disabled, or if
|
||||
// we don't have out-of-process plugins enabled.
|
||||
|
|
|
@ -875,7 +875,7 @@ function subtest_addresses_in_tooltip_text(aRecipients, aHeaderBox,
|
|||
|
||||
for (let i = aShownAddrsNum; (i < numAddresses) &&
|
||||
(i < maxTooltipAddrsNum + aShownAddrsNum); i++) {
|
||||
assert_true(tooltipText.contains(fullNames.value[i]), fullNames.value[i]);
|
||||
assert_true(tooltipText.includes(fullNames.value[i]), fullNames.value[i]);
|
||||
addrsNumInTooltip += 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ var addIdentitiesAndFolder = function() {
|
|||
|
||||
var checkReply = function (replyWin, expectedFromEmail) {
|
||||
let identityList = replyWin.e("msgIdentity");
|
||||
if (!identityList.selectedItem.label.contains(expectedFromEmail))
|
||||
if (!identityList.selectedItem.label.includes(expectedFromEmail))
|
||||
throw new Error("The From address is not correctly selected! Expected: " +
|
||||
expectedFromEmail + "; Actual: " +
|
||||
identityList.selectedItem.label);
|
||||
|
|
|
@ -99,7 +99,7 @@ function test_Reply_To_List_From_Address() {
|
|||
var identityList = replyToListWindow.e("msgIdentity");
|
||||
|
||||
// see if it's the correct identity selected
|
||||
if (!identityList.selectedItem.label.contains(identityString1))
|
||||
if (!identityList.selectedItem.label.includes(identityString1))
|
||||
throw new Error("The From address is not correctly selected! Expected: "+
|
||||
identityString1 + "; Actual: " +
|
||||
identityList.selectedItem.label);
|
||||
|
|
|
@ -96,10 +96,10 @@ function assert_mdn_shown(shouldShow) {
|
|||
function assert_mdn_text_contains(text, shouldContain) {
|
||||
let nb = mc.window.document.getElementById(kBoxId);
|
||||
let notificationText = nb.currentNotification.label;
|
||||
if (shouldContain && !notificationText.contains(text))
|
||||
if (shouldContain && !notificationText.includes(text))
|
||||
throw new Error("mdnBar should contain text=" + text +
|
||||
"; notificationText=" + notificationText);
|
||||
if (!shouldContain && notificationText.contains(text))
|
||||
if (!shouldContain && notificationText.includes(text))
|
||||
throw new Error("mdnBar shouldn't contain text=" + text +
|
||||
"; notificationText=" + notificationText);
|
||||
}
|
||||
|
|
|
@ -62,6 +62,6 @@ function test_throbber_removed() {
|
|||
else
|
||||
currentSet = mc.e("mail-toolbar-menubar2").getAttribute("currentset");
|
||||
|
||||
assert_false(currentSet.contains("throbber-box"),
|
||||
assert_false(currentSet.includes("throbber-box"),
|
||||
"We found a throbber-box where we shouldn't have.");
|
||||
}
|
||||
|
|
|
@ -452,11 +452,11 @@ function subtest_html_characters_and_ampersands(w) {
|
|||
// & should have been replaced with &, and the
|
||||
// greater than / less than characters with > and
|
||||
// < respectively.
|
||||
assert_true(displayedName.contains("&"),
|
||||
assert_true(displayedName.includes("&"),
|
||||
"Should have eliminated ampersands");
|
||||
assert_true(displayedName.contains(">"),
|
||||
assert_true(displayedName.includes(">"),
|
||||
"Should have eliminated greater-than signs");
|
||||
assert_true(displayedName.contains("<"),
|
||||
assert_true(displayedName.includes("<"),
|
||||
"Should have eliminated less-than signs");
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ function test_show_oldest_new_unread_since_last_notification() {
|
|||
[{count: 1,
|
||||
body: {body: notifyFirst}}])
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified.");
|
||||
assert_true(gMockAlertsService._text.contains(notifyFirst, 1),
|
||||
assert_true(gMockAlertsService._text.includes(notifyFirst, 1),
|
||||
"Should have notified for the first message");
|
||||
|
||||
be_in_folder(gFolder);
|
||||
|
@ -244,7 +244,7 @@ function test_show_oldest_new_unread_since_last_notification() {
|
|||
[{count: 1,
|
||||
body: {body: notifySecond}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified.");
|
||||
assert_true(gMockAlertsService._text.contains(notifySecond, 1),
|
||||
assert_true(gMockAlertsService._text.includes(notifySecond, 1),
|
||||
"Should have notified for the second message");
|
||||
}
|
||||
test_show_oldest_new_unread_since_last_notification.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -302,7 +302,7 @@ function test_show_subject() {
|
|||
subject: subject
|
||||
}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(subject),
|
||||
assert_true(gMockAlertsService._text.includes(subject),
|
||||
"Should have displayed the subject");
|
||||
}
|
||||
test_show_subject.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -318,7 +318,7 @@ function test_hide_subject() {
|
|||
subject: subject
|
||||
}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(!gMockAlertsService._text.contains(subject),
|
||||
assert_true(!gMockAlertsService._text.includes(subject),
|
||||
"Should not have displayed the subject");
|
||||
}
|
||||
test_hide_subject.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -341,11 +341,11 @@ function test_show_only_subject() {
|
|||
subject: subject,
|
||||
body: {body: messageBody}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(subject),
|
||||
assert_true(gMockAlertsService._text.includes(subject),
|
||||
"Should have displayed the subject");
|
||||
assert_true(!gMockAlertsService._text.contains(messageBody),
|
||||
assert_true(!gMockAlertsService._text.includes(messageBody),
|
||||
"Should not have displayed the preview");
|
||||
assert_true(!gMockAlertsService._text.contains(sender[0]),
|
||||
assert_true(!gMockAlertsService._text.includes(sender[0]),
|
||||
"Should not have displayed the sender");
|
||||
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ function test_show_sender() {
|
|||
[{count: 1,
|
||||
from: sender}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(sender[0]),
|
||||
assert_true(gMockAlertsService._text.includes(sender[0]),
|
||||
"Should have displayed the sender");
|
||||
}
|
||||
test_show_sender.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -376,7 +376,7 @@ function test_hide_sender() {
|
|||
[{count: 1,
|
||||
from: sender}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(!gMockAlertsService._text.contains(sender[0]),
|
||||
assert_true(!gMockAlertsService._text.includes(sender[0]),
|
||||
"Should not have displayed the sender");
|
||||
}
|
||||
test_hide_sender.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -399,11 +399,11 @@ function test_show_only_sender() {
|
|||
subject: subject,
|
||||
body: {body: messageBody}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(sender[0]),
|
||||
assert_true(gMockAlertsService._text.includes(sender[0]),
|
||||
"Should have displayed the sender");
|
||||
assert_true(!gMockAlertsService._text.contains(messageBody),
|
||||
assert_true(!gMockAlertsService._text.includes(messageBody),
|
||||
"Should not have displayed the preview");
|
||||
assert_true(!gMockAlertsService._text.contains(subject),
|
||||
assert_true(!gMockAlertsService._text.includes(subject),
|
||||
"Should not have displayed the subject");
|
||||
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ function test_show_preview() {
|
|||
[{count: 1,
|
||||
body: {body: messageBody}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(messageBody),
|
||||
assert_true(gMockAlertsService._text.includes(messageBody),
|
||||
"Should have displayed the preview");
|
||||
}
|
||||
test_show_preview.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -434,7 +434,7 @@ function test_hide_preview() {
|
|||
[{count: 1,
|
||||
body: {body: messageBody}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(!gMockAlertsService._text.contains(messageBody),
|
||||
assert_true(!gMockAlertsService._text.includes(messageBody),
|
||||
"Should not have displayed the preview");
|
||||
}
|
||||
test_hide_preview.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
@ -456,11 +456,11 @@ function test_show_only_preview() {
|
|||
subject: subject,
|
||||
body: {body: messageBody}}]);
|
||||
assert_true(gMockAlertsService._didNotify, "Should have notified");
|
||||
assert_true(gMockAlertsService._text.contains(messageBody),
|
||||
assert_true(gMockAlertsService._text.includes(messageBody),
|
||||
"Should have displayed the preview: " + gMockAlertsService._text);
|
||||
assert_true(!gMockAlertsService._text.contains(sender[0]),
|
||||
assert_true(!gMockAlertsService._text.includes(sender[0]),
|
||||
"Should not have displayed the sender");
|
||||
assert_true(!gMockAlertsService._text.contains(subject),
|
||||
assert_true(!gMockAlertsService._text.includes(subject),
|
||||
"Should not have displayed the subject");
|
||||
}
|
||||
test_show_only_preview.EXCLUDED_PLATFORMS = ['winnt', 'darwin'];
|
||||
|
|
|
@ -342,7 +342,7 @@ function wait_for_content_tab_element_display_value(aTab, aElem, aValue) {
|
|||
*/
|
||||
function assert_content_tab_text_present(aTab, aText) {
|
||||
let html = aTab.browser.contentDocument.documentElement.innerHTML;
|
||||
if (!html.contains(aText)) {
|
||||
if (!html.includes(aText)) {
|
||||
mark_failure(["Unable to find string \"" + aText + "\" on the content tab's page"]);
|
||||
}
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ function assert_content_tab_text_present(aTab, aText) {
|
|||
*/
|
||||
function assert_content_tab_text_absent(aTab, aText) {
|
||||
let html = aTab.browser.contentDocument.documentElement.innerHTML;
|
||||
if (html.contains(aText)) {
|
||||
if (html.includes(aText)) {
|
||||
mark_failure(["Found string \"" + aText + "\" on the content tab's page"]);
|
||||
}
|
||||
}
|
||||
|
@ -392,14 +392,14 @@ function plugins_run_in_separate_processes(aController) {
|
|||
let supportsOOPP = false;
|
||||
|
||||
if (aController.mozmillModule.isMac) {
|
||||
if (Services.appinfo.XPCOMABI.contains("x86-")) {
|
||||
if (Services.appinfo.XPCOMABI.includes("x86-")) {
|
||||
try {
|
||||
supportsOOPP = Services.prefs.getBoolPref("dom.ipc.plugins.enabled.i386.test.plugin");
|
||||
} catch(e) {
|
||||
supportsOOPP = Services.prefs.getBoolPref("dom.ipc.plugins.enabled.i386");
|
||||
}
|
||||
}
|
||||
else if (Services.appinfo.XPCOMABI.contains("x86_64-")) {
|
||||
else if (Services.appinfo.XPCOMABI.includes("x86_64-")) {
|
||||
try {
|
||||
supportsOOPP = Services.prefs.getBoolPref("dom.ipc.plugins.enabled.x86_64.test.plugin");
|
||||
} catch(e) {
|
||||
|
|
|
@ -780,7 +780,7 @@ function assert_tab_titled_from(aTab, aWhat) {
|
|||
else if (aWhat instanceof Ci.nsIMsgDBHdr)
|
||||
text = aWhat.mime2DecodedSubject;
|
||||
|
||||
if (!aTab.title.contains(text))
|
||||
if (!aTab.title.includes(text))
|
||||
mark_failure(["Tab title of tab", aTab,
|
||||
"should include '" + text + "' but does not." +
|
||||
" (Current title: '" + aTab.title + "')"]);
|
||||
|
|
|
@ -198,7 +198,7 @@ var gConsoleListener = {
|
|||
if (!this._msg)
|
||||
return;
|
||||
|
||||
this._sawMsg |= (aMsg.message.contains(this._msg));
|
||||
this._sawMsg |= (aMsg.message.includes(this._msg));
|
||||
},
|
||||
|
||||
listenFor: function(aMsg) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче