Backed out changesets 34a66a625618, 32db3daa20fe, and ac15ba8568c5 (bug 1102219) for Gaia unit test failures.

--HG--
extra : rebase_source : 0266cc0b2a6568ca653885745f381df8d6d167ec
This commit is contained in:
Ryan VanderMeulen 2014-12-11 11:28:30 -05:00
parent db530200c7
commit b066004440
228 changed files with 641 additions and 662 deletions

View File

@ -28,7 +28,7 @@ const permissions = metadata.permissions || {};
const isPacked = rootURI && rootURI.indexOf("jar:") === 0;
const uri = (path="") =>
path.includes(":") ? path : addonDataURI + path.replace(/^\.\//, "");
path.contains(":") ? path : addonDataURI + path.replace(/^\.\//, "");
let { preferencesBranch } = options;
if (/[^\w{@}.-]/.test(preferencesBranch)) {

View File

@ -5,6 +5,6 @@
const { uri } = module;
const prefix = uri.substr(0, uri.lastIndexOf("/") + 1) + "fixtures/";
exports.url = (path="") => path && path.includes(":")
exports.url = (path="") => path && path.contains(":")
? path
: prefix + path.replace(/^\.\//, "");

View File

@ -134,7 +134,7 @@ exports["test dead object errors"] = function(assert, done) {
let { level } = message;
let text = String(message.arguments[0]);
if (level === "error" && text.includes("can't access dead object"))
if (level === "error" && text.contains("can't access dead object"))
fail(text);
}

View File

@ -485,7 +485,7 @@ exports.testWindowStopDontBreak = function (assert, done) {
getService(Ci.nsIConsoleService);
const listener = {
observe: ({message}) => {
if (message.includes('contentWorker is null'))
if (message.contains('contentWorker is null'))
assert.fail('contentWorker is null');
}
};

View File

@ -26,7 +26,7 @@ exports["test start / stop ports"] = assert => {
const input = new InputPort({ id: Date.now().toString(32), initial: {data:0} });
const topic = input.topic;
assert.ok(topic.includes(addonID), "topics are namespaced to add-on");
assert.ok(topic.contains(addonID), "topics are namespaced to add-on");
const xs = lift(({data}) => "x:" + data, input);
const ys = lift(({data}) => "y:" + data, input);
@ -216,7 +216,7 @@ exports["test receive what was send"] = assert => {
const input = new InputPort({ id: id, initial: 0});
const output = new OutputPort({ id: id, sync: true });
assert.ok(input.topic.includes(addonID),
assert.ok(input.topic.contains(addonID),
"input topic is namespaced to addon");
assert.equal(input.topic, output.topic,
"input & output get same topics from id.");

View File

@ -113,7 +113,7 @@ let wrapper = {
// URLSearchParams implementation doesn't support iteration (bug 1085284).
let urlParamStr = urlParams.toString();
if (urlParamStr) {
url += (url.includes("?") ? "&" : "?") + urlParamStr;
url += (url.contains("?") ? "&" : "?") + urlParamStr;
}
iframe.src = url;
},

View File

@ -204,8 +204,8 @@ SocialUI = {
let docElem = document.documentElement;
// extrachrome is not restored during session restore, so we need
// to check for the toolbar as well.
let chromeless = docElem.getAttribute("chromehidden").includes("extrachrome") ||
docElem.getAttribute('chromehidden').includes("toolbar");
let chromeless = docElem.getAttribute("chromehidden").contains("extrachrome") ||
docElem.getAttribute('chromehidden').contains("toolbar");
// This property is "fixed" for a window, so avoid doing the check above
// multiple times...
delete this._chromeless;

View File

@ -2964,7 +2964,7 @@ function getMeOutOfHere() {
url = prefs.getComplexValue("browser.startup.homepage",
Ci.nsIPrefLocalizedString).data;
// If url is a pipe-delimited set of pages, just take the first one.
if (url.includes("|"))
if (url.contains("|"))
url = url.split("|")[0];
} catch(e) {
Components.utils.reportError("Couldn't get homepage pref: " + e);
@ -3773,7 +3773,7 @@ function FillHistoryMenu(aParent) {
function addToUrlbarHistory(aUrlToAdd) {
if (!PrivateBrowsingUtils.isWindowPrivate(window) &&
aUrlToAdd &&
!aUrlToAdd.includes(" ") &&
!aUrlToAdd.contains(" ") &&
!/[\x00-\x1F]/.test(aUrlToAdd))
PlacesUIUtils.markPageAsTyped(aUrlToAdd);
}
@ -6646,7 +6646,7 @@ function GetSearchFieldBookmarkData(node) {
if (isURLEncoded)
postData = formData.join("&");
else {
let separator = spec.includes("?") ? "&" : "?";
let separator = spec.contains("?") ? "&" : "?";
spec += separator + formData.join("&");
}

View File

@ -67,8 +67,8 @@ let RemoteTabViewer = {
let item = this._tabsList.getItemAtIndex(i);
let hide = false;
if (item.getAttribute("type") == "tab") {
if (!item.getAttribute("url").toLowerCase().includes(val) &&
!item.getAttribute("title").toLowerCase().includes(val)) {
if (!item.getAttribute("url").toLowerCase().contains(val) &&
!item.getAttribute("title").toLowerCase().contains(val)) {
hide = true;
} else {
clientTabs++;

View File

@ -985,7 +985,7 @@
// add the scheme and host to the title to prevent spoofing.
// XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239
try {
if (docElement.getAttribute("chromehidden").includes("location")) {
if (docElement.getAttribute("chromehidden").contains("location")) {
var uri = this.mURIFixup.createExposableURI(
aBrowser.currentURI);
if (uri.scheme == "about")

View File

@ -18,7 +18,7 @@ function initialStylesheetAdded(evt) {
is(evt.type, "StyleSheetAdded", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.documentSheet, "style sheet is a document sheet");
}
@ -63,7 +63,7 @@ function dynamicStylesheetAdded(evt) {
is(evt.type, "StyleSheetAdded", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.documentSheet, "style sheet is a document sheet");
}
@ -97,8 +97,8 @@ function dynamicStylesheetRemoved(evt) {
is(evt.type, "StyleSheetRemoved", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.href.includes(gStyleSheet), "evt.stylesheet is the removed stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.href.contains(gStyleSheet), "evt.stylesheet is the removed stylesheet");
gBrowser.addEventListener("StyleRuleAdded", styleRuleAdded, true);
gBrowser.contentDocument.querySelector("style").sheet.insertRule("*{color:black}", 0);
@ -110,7 +110,7 @@ function styleRuleAdded(evt) {
is(evt.type, "StyleRuleAdded", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.rule, "evt.rule is defined");
is(evt.rule.cssText, "* { color: black; }", "evt.rule.cssText has expected value");
@ -124,7 +124,7 @@ function styleRuleChanged(evt) {
is(evt.type, "StyleRuleChanged", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.rule, "evt.rule is defined");
is(evt.rule.cssText, "* { color: green; }", "evt.rule.cssText has expected value");
@ -138,7 +138,7 @@ function styleRuleRemoved(evt) {
is(evt.type, "StyleRuleRemoved", "evt.type has expected value");
is(evt.target, gBrowser.contentDocument, "event targets correct document");
ok(evt.stylesheet, "evt.stylesheet is defined");
ok(evt.stylesheet.toString().includes("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.stylesheet.toString().contains("CSSStyleSheet"), "evt.stylesheet is a stylesheet");
ok(evt.rule, "evt.rule is defined");
executeSoon(concludeTest);

View File

@ -40,7 +40,7 @@ function test() {
is(document.getElementById("context-searchselect").hidden, !opts.shouldBeShown, "search context menu item is shown for '#" + opts.id + "' and selected is '" + opts.isSelected + "'");
if(opts.shouldBeShown) {
ok(menuItem.label.includes(opts.expectedLabelContents), "Menu item text '" + menuItem.label + "' contains the correct search terms '" + opts.expectedLabelContents + "'");
ok(menuItem.label.contains(opts.expectedLabelContents), "Menu item text '" + menuItem.label + "' contains the correct search terms '" + opts.expectedLabelContents + "'");
}
}

View File

@ -154,7 +154,7 @@ function activateSecondaryAction(aAction) {
// One down event to open the popup
EventUtils.synthesizeKey("VK_DOWN",
{ altKey: !navigator.platform.includes("Mac") });
{ altKey: !navigator.platform.contains("Mac") });
}
registerCleanupFunction(function() {

View File

@ -37,7 +37,7 @@ function test() {
executeSoon(function () {
let consoleListener = {
observe: function (m) {
if (m.message.includes("NS_ERROR_DOM_BAD_URI")) {
if (m.message.contains("NS_ERROR_DOM_BAD_URI")) {
ok(true, "drop was blocked");
executeSoon(finish);
}

View File

@ -73,7 +73,7 @@ add_task(function checkAllTheCSS() {
return;
}
// Only care about CSS errors generated by our iframe:
if (aMessage.category.includes("CSS") && aMessage.innerWindowID === 0 && aMessage.outerWindowID === 0) {
if (aMessage.category.contains("CSS") && aMessage.innerWindowID === 0 && aMessage.outerWindowID === 0) {
// Check if this error is whitelisted in kWhitelist
if (!ignoredError(aMessage)) {
ok(false, "Got error message for " + aMessage.sourceName + ": " + aMessage.errorMessage);

View File

@ -83,7 +83,7 @@ add_task(function* checkAllTheJS() {
let uris;
// If an absolute URI is specified on the command line, use it immediately.
if (parseValue && parseValue.includes(":")) {
if (parseValue && parseValue.contains(":")) {
uris = [NetUtil.newURI(parseValue)];
} else {
let appDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
@ -98,7 +98,7 @@ add_task(function* checkAllTheJS() {
// Apply the filter specified on the command line, if any.
if (parseValue) {
uris = uris.filter(uri => {
if (uri.spec.includes(parseValue)) {
if (uri.spec.contains(parseValue)) {
return true;
}
info("Not checking filtered out " + uri.spec);

View File

@ -24,7 +24,7 @@ function test() {
{
var urispec = uri.asciiSpec;
info(urispec);
is(urispec.includes(filename), false, "web content present in disk cache");
is(urispec.contains(filename), false, "web content present in disk cache");
},
onCacheEntryVisitCompleted: function()
{

View File

@ -78,7 +78,7 @@ function handleMessageEvents(event) {
catch (e) {
var bodyInnerHTML = "";
}
if (cacheCount == 2 || bodyInnerHTML.includes("error")) {
if (cacheCount == 2 || bodyInnerHTML.contains("error")) {
clearInterval(intervalID);
is(cacheCount, 2, "frame not reloaded successfully");
if (cacheCount != 2) {

View File

@ -304,7 +304,7 @@ function blobToBase64(blob) {
let checkCurrentEngine = Task.async(function* ({name: basename, logoPrefix1x, logoPrefix2x}) {
let engine = Services.search.currentEngine;
ok(engine.name.includes(basename),
ok(engine.name.contains(basename),
"Sanity check: current engine: engine.name=" + engine.name +
" basename=" + basename);

View File

@ -75,8 +75,8 @@ add_task(function* () {
// Ensure that the notification is showing information about
// the x-second-test plugin.
ok(notification.label.includes("Second Test"), "Should mention the second plugin");
ok(!notification.label.includes("127.0.0.1"), "Should not refer to old principal");
ok(notification.label.includes("null"), "Should refer to the new principal");
ok(notification.label.contains("Second Test"), "Should mention the second plugin");
ok(!notification.label.contains("127.0.0.1"), "Should not refer to old principal");
ok(notification.label.contains("null"), "Should refer to the new principal");
gBrowser.removeTab(newTab);
});

View File

@ -19,7 +19,7 @@ function test() {
.getService(Ci.nsIConsoleService);
var errorListener = {
observe: function(aMessage) {
if (aMessage.message.includes("NS_ERROR"))
if (aMessage.message.contains("NS_ERROR"))
gConsoleErrors++;
}
};

View File

@ -309,5 +309,5 @@ function triggerSecondaryCommand(popup, index) {
// One down event to open the popup
info("Open the popup to trigger secondary command for notification " + notification.id);
EventUtils.synthesizeKey("VK_DOWN", { altKey: !navigator.platform.includes("Mac") });
EventUtils.synthesizeKey("VK_DOWN", { altKey: !navigator.platform.contains("Mac") });
}

View File

@ -519,7 +519,7 @@
return selectedVal;
// The selection doesn't span the full domain if it doesn't contain a slash and is
// followed by some character other than a slash.
if (!selectedVal.includes("/")) {
if (!selectedVal.contains("/")) {
let remainder = inputVal.replace(selectedVal, "");
if (remainder != "" && remainder[0] != "/")
return selectedVal;

View File

@ -431,7 +431,7 @@ const PanelUI = {
if (!label) {
continue;
}
if (label.includes("\u00ad")) {
if (label.contains("\u00ad")) {
node.setAttribute("auto-hyphens", "off");
} else {
node.removeAttribute("auto-hyphens");

View File

@ -692,8 +692,8 @@ DownloadElementShell.prototype = {
if (!aTerm)
return true;
aTerm = aTerm.toLowerCase();
return this.getDownloadMetaData().displayName.toLowerCase().includes(aTerm) ||
this.downloadURI.toLowerCase().includes(aTerm);
return this.getDownloadMetaData().displayName.toLowerCase().contains(aTerm) ||
this.downloadURI.toLowerCase().contains(aTerm);
},
// Handles return keypress on the element (the keypress listener is

View File

@ -284,7 +284,7 @@ let LoopCallsInternal = {
EMAIL_OR_PHONE_RE.test(callData.callerId)) {
LoopContacts.search({
q: callData.callerId,
field: callData.callerId.includes("@") ? "email" : "tel"
field: callData.callerId.contains("@") ? "email" : "tel"
}, (err, contacts) => {
if (err) {
// Database error, helas!

View File

@ -481,8 +481,8 @@ loop.contacts = (function(_, mozL10n) {
let filter = this.state.filter.trim().toLocaleLowerCase();
if (filter) {
let filterFn = contact => {
return contact.name[0].toLocaleLowerCase().includes(filter) ||
getPreferred(contact, "email").value.toLocaleLowerCase().includes(filter);
return contact.name[0].toLocaleLowerCase().contains(filter) ||
getPreferred(contact, "email").value.toLocaleLowerCase().contains(filter);
};
if (shownContacts.available) {
shownContacts.available = shownContacts.available.filter(filterFn);

View File

@ -481,8 +481,8 @@ loop.contacts = (function(_, mozL10n) {
let filter = this.state.filter.trim().toLocaleLowerCase();
if (filter) {
let filterFn = contact => {
return contact.name[0].toLocaleLowerCase().includes(filter) ||
getPreferred(contact, "email").value.toLocaleLowerCase().includes(filter);
return contact.name[0].toLocaleLowerCase().contains(filter) ||
getPreferred(contact, "email").value.toLocaleLowerCase().contains(filter);
};
if (shownContacts.available) {
shownContacts.available = shownContacts.available.filter(filterFn);

View File

@ -13,11 +13,11 @@ add_test(function test_registration_uses_hawk_session_token() {
// components/interfaces at a higher level.
let header = request.getHeader("Authorization");
Assert.notEqual(header.includes("Hawk id="), -1, "Should contain a hawk id");
Assert.notEqual(header.includes("ts="), -1, "Should contain a timestamp");
Assert.notEqual(header.includes("nonce="), -1, "Should contain a nonce");
Assert.notEqual(header.includes("hash="), -1, "Should contain a hash");
Assert.notEqual(header.includes("mac="), -1, "Should contain a mac");
Assert.notEqual(header.contains("Hawk id="), -1, "Should contain a hawk id");
Assert.notEqual(header.contains("ts="), -1, "Should contain a timestamp");
Assert.notEqual(header.contains("nonce="), -1, "Should contain a nonce");
Assert.notEqual(header.contains("hash="), -1, "Should contain a hash");
Assert.notEqual(header.contains("mac="), -1, "Should contain a mac");
response.setStatusLine(null, 200, "OK");
response.processAsync();

View File

@ -1593,7 +1593,7 @@ BrowserGlue.prototype = {
let currentset = xulStore.getValue(BROWSER_DOCURL, "nav-bar", "currentset");
// Need to migrate only if toolbar is customized.
if (currentset) {
if (currentset.includes("bookmarks-menu-button-container")) {
if (currentset.contains("bookmarks-menu-button-container")) {
currentset = currentset.replace(/(^|,)bookmarks-menu-button-container($|,)/,
"$1bookmarks-menu-button$2");
xulStore.setValue(BROWSER_DOCURL, "nav-bar", "currentset", currentset);
@ -1621,13 +1621,13 @@ BrowserGlue.prototype = {
let currentset = xulStore.getValue(BROWSER_DOCURL, "nav-bar", "currentset");
// Need to migrate only if toolbar is customized.
if (currentset) {
if (!currentset.includes("bookmarks-menu-button")) {
if (!currentset.contains("bookmarks-menu-button")) {
// The button isn't in the nav-bar, so let's look for an appropriate
// place to put it.
if (currentset.includes("downloads-button")) {
if (currentset.contains("downloads-button")) {
currentset = currentset.replace(/(^|,)downloads-button($|,)/,
"$1bookmarks-menu-button,downloads-button$2");
} else if (currentset.includes("home-button")) {
} else if (currentset.contains("home-button")) {
currentset = currentset.replace(/(^|,)home-button($|,)/,
"$1bookmarks-menu-button,home-button$2");
} else {

View File

@ -595,7 +595,7 @@
let cs = getComputedStyle(container);
let transitionProp = cs.transitionProperty;
let transitionTime = parseFloat(cs.transitionDuration);
disablePointerEvents = (transitionProp.includes("transform") ||
disablePointerEvents = (transitionProp.contains("transform") ||
transitionProp == "all") &&
transitionTime > 0;
this.setAttribute("disablepointereventsfortransition", disablePointerEvents);

View File

@ -43,7 +43,7 @@ add_task(function* test_dont_save_passwords() {
yield forceSaveState();
yield promiseForEachSessionRestoreFile((state, key) =>
// Ensure that we have not saved our password.
ok(!state.includes(PASS), "password has not been written to file " + key)
ok(!state.contains(PASS), "password has not been written to file " + key)
);

View File

@ -45,7 +45,7 @@ function testStayOnPage(win, blockingTab) {
// The other initial tab has been closed when trying to close the tab
// group. The only tab left is the one with the onbeforeunload dialog.
let url = win.gBrowser.browsers[0].currentURI.spec;
ok(url.includes("onbeforeunload"), "The open tab is the expected one");
ok(url.contains("onbeforeunload"), "The open tab is the expected one");
is(contentWindow.GroupItems.getActiveGroupItem(), activeGroup,
"Active group is still the same");

View File

@ -24,7 +24,7 @@ function* testPrefs(test) {
}
function isNightly() {
return Services.appinfo.version.includes("a1");
return Services.appinfo.version.contains("a1");
}
add_task(function* test_default_values() {

View File

@ -135,8 +135,8 @@ this.BingTranslator.prototype = {
if (aError instanceof RESTRequest &&
[400, 401].indexOf(aError.response.status) != -1) {
let body = aError.response.body;
if (body.includes("TranslateApiException") &&
(body.includes("balance") || body.includes("active state")))
if (body.contains("TranslateApiException") &&
(body.contains("balance") || body.contains("active state")))
this._serviceUnavailable = true;
}

View File

@ -130,7 +130,7 @@ function checkAuth(req) {
throw new HTTPError(401, "Invalid Authorization header content: '" + auth + "'");
// Rejecting inactive subscriptions.
if (auth.includes("inactive")) {
if (auth.contains("inactive")) {
const INACTIVE_STATE_RESPONSE = "<html><body><h1>TranslateApiException</h1><p>Method: TranslateArray()</p><p>Message: The Azure Market Place Translator Subscription associated with the request credentials is not in an active state.</p><code></code><p>message id=5641.V2_Rest.TranslateArray.48CC6470</p></body></html>";
throw new HTTPError(401, INACTIVE_STATE_RESPONSE);
}

View File

@ -72,7 +72,7 @@ function openPopup(aPopup) {
aPopup.focus();
// One down event to open the popup.
EventUtils.synthesizeKey("VK_DOWN",
{ altKey: !navigator.platform.includes("Mac") });
{ altKey: !navigator.platform.contains("Mac") });
return deferred.promise;
}

View File

@ -887,10 +887,10 @@ let CallsListView = Heritage.extend(WidgetMethods, {
let line = call.line.toString().toLowerCase();
let args = call.argsPreview.toLowerCase();
return name.includes(lowerCaseSearchToken) ||
file.includes(lowerCaseSearchToken) ||
line.includes(lowerCaseSearchToken) ||
args.includes(lowerCaseSearchToken);
return name.contains(lowerCaseSearchToken) ||
file.contains(lowerCaseSearchToken) ||
line.contains(lowerCaseSearchToken) ||
args.contains(lowerCaseSearchToken);
});
},

View File

@ -65,7 +65,7 @@ function ifTestingSupported() {
"The last called function's file is correct.");
is(functionCalls[7].line, 30,
"The last called function's line is correct.");
ok(functionCalls[7].argsPreview.includes("Function"),
ok(functionCalls[7].argsPreview.contains("Function"),
"The last called function's args preview is correct.");
is(functionCalls[7].callerPreview, "",
"The last called function's caller preview is correct.");

View File

@ -32,16 +32,16 @@ function ifTestingSupported() {
"There should be 4 functions on the stack for the draw call.");
ok($all(".call-item-stack-fn-name", callItem.target)[0].getAttribute("value")
.includes("C()"),
.contains("C()"),
"The first function on the stack has the correct name.");
ok($all(".call-item-stack-fn-name", callItem.target)[1].getAttribute("value")
.includes("B()"),
.contains("B()"),
"The second function on the stack has the correct name.");
ok($all(".call-item-stack-fn-name", callItem.target)[2].getAttribute("value")
.includes("A()"),
.contains("A()"),
"The third function on the stack has the correct name.");
ok($all(".call-item-stack-fn-name", callItem.target)[3].getAttribute("value")
.includes("drawRect()"),
.contains("drawRect()"),
"The fourth function on the stack has the correct name.");
is($all(".call-item-stack-fn-location", callItem.target)[0].getAttribute("value"),

View File

@ -26,7 +26,7 @@ function ifTestingSupported() {
is($("#screenshot-image").getAttribute("flipped"), "false",
"The screenshot element should not be flipped vertically.");
ok(window.getComputedStyle($("#screenshot-image")).backgroundImage.includes("#screenshot-rendering"),
ok(window.getComputedStyle($("#screenshot-image")).backgroundImage.contains("#screenshot-rendering"),
"The screenshot element should have an offscreen canvas element as a background.");
yield teardown(panel);

View File

@ -89,7 +89,7 @@ function spawnTest() {
output: [ /page1/, /page2/, /page3/ ]
},
post: function(output, text) {
ok(!text.includes("index"), "index is not contained in output");
ok(!text.contains("index"), "index is not contained in output");
}
},
@ -149,10 +149,10 @@ function spawnTest() {
output: [ /no results/ ]
},
post: function(output, text) {
ok(!text.includes("index"), "index is not contained in output");
ok(!text.includes("page1"), "page1 is not contained in output");
ok(!text.includes("page2"), "page1 is not contained in output");
ok(!text.includes("page3"), "page1 is not contained in output");
ok(!text.contains("index"), "index is not contained in output");
ok(!text.contains("page1"), "page1 is not contained in output");
ok(!text.contains("page2"), "page1 is not contained in output");
ok(!text.contains("page3"), "page1 is not contained in output");
}
},

View File

@ -126,8 +126,8 @@ function test() {
output: [ /zap=zep/, /zup=banana/, /Edit/ ]
},
post: function(output, text) {
ok(!text.includes("zip"), "");
ok(!text.includes("zop"), "");
ok(!text.contains("zip"), "");
ok(!text.contains("zop"), "");
}
},
{
@ -140,10 +140,10 @@ function test() {
output: [ /zup=banana/, /Edit/ ]
},
post: function(output, text) {
ok(!text.includes("zap"), "");
ok(!text.includes("zep"), "");
ok(!text.includes("zip"), "");
ok(!text.includes("zop"), "");
ok(!text.contains("zap"), "");
ok(!text.contains("zep"), "");
ok(!text.contains("zip"), "");
ok(!text.contains("zop"), "");
}
},
{
@ -156,13 +156,13 @@ function test() {
output: 'No cookies found for host example.com'
},
post: function(output, text) {
ok(!text.includes("zap"), "");
ok(!text.includes("zep"), "");
ok(!text.includes("zip"), "");
ok(!text.includes("zop"), "");
ok(!text.includes("zup"), "");
ok(!text.includes("banana"), "");
ok(!text.includes("Edit"), "");
ok(!text.contains("zap"), "");
ok(!text.contains("zep"), "");
ok(!text.contains("zip"), "");
ok(!text.contains("zop"), "");
ok(!text.contains("zup"), "");
ok(!text.contains("banana"), "");
ok(!text.contains("Edit"), "");
}
},
]);

View File

@ -1453,7 +1453,7 @@ TracerView.prototype = Heritage.extend(WidgetMethods, {
*/
_onSearch: function() {
const query = this._search.value.trim().toLowerCase();
const predicate = name => name.toLowerCase().includes(query);
const predicate = name => name.toLowerCase().contains(query);
this.filterContents(item => predicate(item.attachment.trace.name));
},
@ -1586,7 +1586,7 @@ let SourceUtils = {
*/
isJavaScript: function(aUrl, aContentType = "") {
return (aUrl && /\.jsm?$/.test(this.trimUrlQuery(aUrl))) ||
aContentType.includes("javascript");
aContentType.contains("javascript");
},
/**
@ -2498,7 +2498,7 @@ EventListenersView.prototype = Heritage.extend(WidgetMethods, {
// There's no easy way of grouping event types into higher-level groups,
// so we need to do this by hand.
let is = (...args) => args.indexOf(type) != -1;
let has = str => type.includes(str);
let has = str => type.contains(str);
let starts = str => type.startsWith(str);
let group;
@ -2829,7 +2829,7 @@ GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
}
// Verify that the search token is found anywhere in the source.
if (!text.toLowerCase().includes(lowerCaseToken)) {
if (!text.toLowerCase().contains(lowerCaseToken)) {
continue;
}
// ...and if so, create a Map containing search details for each line.
@ -2841,7 +2841,7 @@ GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
let lowerCaseLine = aString.toLowerCase();
// Verify that the search token is found anywhere in this line.
if (!lowerCaseLine.includes(lowerCaseToken)) {
if (!lowerCaseLine.contains(lowerCaseToken)) {
return;
}
// ...and if so, create a Map containing search details for each word.

View File

@ -72,7 +72,7 @@ function testSources() {
gThreadClient.getSources(aResponse => {
// source URLs contain launch-specific temporary directory path,
// hence the ".contains" call.
const matches = aResponse.sources.filter(s => s.url.includes(ADDON_MODULE_URL));
const matches = aResponse.sources.filter(s => s.url.contains(ADDON_MODULE_URL));
ok(matches.length > 0,
"the main script of the addon is present in the source list");
deferred.resolve();

View File

@ -51,7 +51,7 @@ function test(){
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -93,7 +93,7 @@ function testAutoPrettyPrintOff(){
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}

View File

@ -63,7 +63,7 @@ function test(){
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -101,7 +101,7 @@ function disableAutoPrettyPrint(){
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}

View File

@ -52,7 +52,7 @@ function test() {
let item = gEvents.items[index];
let node = item.target;
ok(item.attachment.url.includes(label),
ok(item.attachment.url.contains(label),
"The event at index " + index + " has the correct url.");
is(item.attachment.type, type,
"The event at index " + index + " has the correct type.");

View File

@ -43,7 +43,7 @@ function test() {
function testChromeActor() {
gClient.listTabs(aResponse => {
ok(aResponse.chromeDebugger.includes("chromeDebugger"),
ok(aResponse.chromeDebugger.contains("chromeDebugger"),
"Chrome debugger actor should identify itself accordingly.");
gClient.addListener("newGlobal", onNewGlobal);

View File

@ -22,7 +22,7 @@ function test() {
"There should be one source displayed in the view.")
is(getSelectedSourceURL(gSources), JS_URL,
"The correct source is currently selected in the view.");
ok(gEditor.getText().includes("bacon"),
ok(gEditor.getText().contains("bacon"),
"The currently shown source contains bacon. Mmm, delicious!");
let { source } = gSources.selectedItem.attachment;
@ -40,7 +40,7 @@ function test() {
"There should be one source displayed in the view after reloading.")
is(getSelectedSourceURL(gSources), JS_URL,
"The correct source is currently selected in the view after reloading.");
ok(gEditor.getText().includes("bacon"),
ok(gEditor.getText().contains("bacon"),
"The newly shown source contains bacon. Mmm, delicious!");
({ source } = gSources.selectedItem.attachment);

View File

@ -27,7 +27,7 @@ function test() {
gClient.listTabs(aResponse => {
let globalActor = aResponse.testGlobalActor1;
ok(globalActor, "Found the test tab actor.")
ok(globalActor.includes("test_one"),
ok(globalActor.contains("test_one"),
"testGlobalActor1's actorPrefix should be used.");
gClient.request({ to: globalActor, type: "ping" }, aResponse => {

View File

@ -37,7 +37,7 @@ function test() {
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -51,7 +51,7 @@ function testProgressBarShown() {
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}
@ -65,7 +65,7 @@ function testSourceIsStillPretty() {
const { source } = gSources.selectedItem.attachment;
gDebugger.DebuggerController.SourceScripts.getText(source).then(([, text]) => {
ok(text.includes("\n "),
ok(text.contains("\n "),
"Subsequent calls to getText return the pretty printed source.");
deferred.resolve();
});

View File

@ -42,7 +42,7 @@ function selectContextMenuItem() {
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}

View File

@ -29,7 +29,7 @@ function test() {
is(getSelectedSourceURL(gSources), TAB_URL,
"The correct source is currently selected.");
ok(gEditor.getText().includes("myFunction"),
ok(gEditor.getText().contains("myFunction"),
"The source shouldn't be pretty printed yet.");
clickPrettyPrintButton();
@ -47,9 +47,9 @@ function test() {
[source, text] = yield gControllerSources.getText(source);
is(getSelectedSourceURL(gSources), TAB_URL,
"The correct source is still selected.");
ok(gEditor.getText().includes("myFunction"),
ok(gEditor.getText().contains("myFunction"),
"The displayed source hasn't changed.");
ok(text.includes("myFunction"),
ok(text.contains("myFunction"),
"The cached source text wasn't altered in any way.");
yield closeDebuggerAndFinish(gPanel);

View File

@ -45,7 +45,7 @@ function test() {
is(getSelectedSourceURL(gSources), JS_URL,
"The correct source is currently selected.");
ok(gEditor.getText().includes("myFunction"),
ok(gEditor.getText().contains("myFunction"),
"The source shouldn't be pretty printed yet.");
clickPrettyPrintButton();
@ -55,7 +55,7 @@ function test() {
yield gControllerSources.togglePrettyPrint(source);
ok(false, "The promise for a prettified source should be rejected!");
} catch ([source, error]) {
ok(error.includes("prettyPrintError"),
ok(error.contains("prettyPrintError"),
"The promise was correctly rejected with a meaningful message.");
}
@ -63,9 +63,9 @@ function test() {
[source, text] = yield gControllerSources.getText(source);
is(getSelectedSourceURL(gSources), JS_URL,
"The correct source is still selected.");
ok(gEditor.getText().includes("myFunction"),
ok(gEditor.getText().contains("myFunction"),
"The displayed source hasn't changed.");
ok(text.includes("myFunction"),
ok(text.contains("myFunction"),
"The cached source text wasn't altered in any way.");
is(gPrettyPrinted, true,

View File

@ -23,7 +23,7 @@ function test() {
function findSource() {
gThreadClient.getSources(({ error, sources }) => {
ok(!error);
sources = sources.filter(s => s.url.includes('code_ugly-2.js'));
sources = sources.filter(s => s.url.contains('code_ugly-2.js'));
is(sources.length, 1);
gSource = sources[0];
prettyPrintSource();
@ -36,7 +36,7 @@ function prettyPrintSource() {
function testPrettyPrinted({ error, source }) {
ok(!error);
ok(source.includes("\n "));
ok(source.contains("\n "));
disablePrettyPrint();
}
@ -46,7 +46,7 @@ function disablePrettyPrint() {
function testUgly({ error, source }) {
ok(!error);
ok(!source.includes("\n "));
ok(!source.contains("\n "));
closeDebuggerAndFinish(gPanel);
}

View File

@ -27,7 +27,7 @@ const BP_LOCATION = {
function findSource() {
gThreadClient.getSources(({ error, sources }) => {
ok(!error, "error should exist");
sources = sources.filter(s => s.url.includes("code_ugly-3.js"));
sources = sources.filter(s => s.url.contains("code_ugly-3.js"));
is(sources.length, 1, "sources.length should be 1");
[gSource] = sources;
BP_LOCATION.actor = gSource.actor;

View File

@ -66,7 +66,7 @@ function disablePrettyPrint() {
function testUgly({ error, source }) {
ok(!error);
ok(!source.includes("\n "));
ok(!source.contains("\n "));
getFrame();
}

View File

@ -32,7 +32,7 @@ function test() {
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -48,7 +48,7 @@ function clickPrettyPrintButton() {
function testSourceIsStillUgly() {
const { source } = gSources.selectedItem.attachment;
return gDebugger.DebuggerController.SourceScripts.getText(source).then(([, text]) => {
ok(!text.includes("\n "));
ok(!text.contains("\n "));
});
}

View File

@ -36,7 +36,7 @@ function test() {
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -45,7 +45,7 @@ function clickPrettyPrintButton() {
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}

View File

@ -40,7 +40,7 @@ function test() {
}
function testSourceIsUgly() {
ok(!gEditor.getText().includes("\n "),
ok(!gEditor.getText().contains("\n "),
"The source shouldn't be pretty printed yet.");
}
@ -54,7 +54,7 @@ function testProgressBarShown() {
}
function testSourceIsPretty() {
ok(gEditor.getText().includes("\n "),
ok(gEditor.getText().contains("\n "),
"The source should be pretty printed.")
}
@ -68,7 +68,7 @@ function testSourceIsStillPretty() {
const { source } = gSources.selectedItem.attachment;
gDebugger.DebuggerController.SourceScripts.getText(source).then(([, text]) => {
ok(text.includes("\n "),
ok(text.contains("\n "),
"Subsequent calls to getText return the pretty printed source.");
deferred.resolve();
});

View File

@ -36,7 +36,7 @@ function showBogusSource() {
}
function testDebuggerLoadingError() {
ok(gEditor.getText().includes(gL10N.getStr("errorLoadingText")),
ok(gEditor.getText().contains(gL10N.getStr("errorLoadingText")),
"The valid error loading message is displayed.");
}

View File

@ -103,9 +103,9 @@ function combineWithTokenColonSearch() {
}
function verifySourceAndCaret(aUrl, aLine, aColumn, aSelection) {
ok(gSources.selectedItem.attachment.label.includes(aUrl),
ok(gSources.selectedItem.attachment.label.contains(aUrl),
"The selected item's label appears to be correct.");
ok(gSources.selectedItem.attachment.source.url.includes(aUrl),
ok(gSources.selectedItem.attachment.source.url.contains(aUrl),
"The selected item's value appears to be correct.");
ok(isCaretPos(gPanel, aLine, aColumn),
"The current caret position appears to be correct.");

View File

@ -101,9 +101,9 @@ function escapeAndClear() {
}
function verifySourceAndCaret(aUrl, aLine, aColumn) {
ok(gSources.selectedItem.attachment.label.includes(aUrl),
ok(gSources.selectedItem.attachment.label.contains(aUrl),
"The selected item's label appears to be correct.");
ok(gSources.selectedItem.attachment.source.url.includes(aUrl),
ok(gSources.selectedItem.attachment.source.url.contains(aUrl),
"The selected item's value appears to be correct.");
ok(isCaretPos(gPanel, aLine, aColumn),
"The current caret position appears to be correct.");

View File

@ -53,7 +53,7 @@ function firstSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");
@ -167,7 +167,7 @@ function secondSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");

View File

@ -56,7 +56,7 @@ function firstSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");
@ -77,7 +77,7 @@ function doFirstJump() {
info("Current source url:\n" + getSelectedSourceURL(gSources));
info("Debugger editor text:\n" + gEditor.getText());
ok(getSelectedSourceURL(gSources).includes("-01.js"),
ok(getSelectedSourceURL(gSources).contains("-01.js"),
"The currently shown source is incorrect (1).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (1).");
@ -105,7 +105,7 @@ function doSecondJump() {
info("Current source url:\n" + getSelectedSourceURL(gSources));
info("Debugger editor text:\n" + gEditor.getText());
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The currently shown source is incorrect (2).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (2).");
@ -133,7 +133,7 @@ function doWrapAroundJump() {
info("Current source url:\n" + getSelectedSourceURL(gSources));
info("Debugger editor text:\n" + gEditor.getText());
ok(getSelectedSourceURL(gSources).includes("-01.js"),
ok(getSelectedSourceURL(gSources).contains("-01.js"),
"The currently shown source is incorrect (3).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (3).");
@ -162,7 +162,7 @@ function doBackwardsWrapAroundJump() {
info("Current source url:\n" + getSelectedSourceURL(gSources));
info("Debugger editor text:\n" + gEditor.getText());
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The currently shown source is incorrect (4).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (4).");
@ -189,7 +189,7 @@ function testSearchTokenEmpty() {
info("Current source url:\n" + getSelectedSourceURL(gSources));
info("Debugger editor text:\n" + gEditor.getText());
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The currently shown source is incorrect (4).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (4).");

View File

@ -52,7 +52,7 @@ function firstSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");

View File

@ -45,7 +45,7 @@ function firstSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");
@ -68,7 +68,7 @@ function secondSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");

View File

@ -48,7 +48,7 @@ function doSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");
@ -101,7 +101,7 @@ function testClickLineToJump() {
"The editor didn't jump to the correct line (1).");
is(gEditor.getSelection(), "",
"The editor didn't select the correct text (1).");
ok(getSelectedSourceURL(gSources).includes("-01.js"),
ok(getSelectedSourceURL(gSources).contains("-01.js"),
"The currently shown source is incorrect (1).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (1).");
@ -130,7 +130,7 @@ function testClickMatchToJump() {
"The editor didn't jump to the correct line (2).");
is(gEditor.getSelection(), "",
"The editor didn't select the correct text (2).");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The currently shown source is incorrect (2).");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search (2).");

View File

@ -54,7 +54,7 @@ function doSearch() {
ok(isCaretPos(gPanel, 6),
"The editor shouldn't have jumped to a matching line yet.");
ok(getSelectedSourceURL(gSources).includes("-02.js"),
ok(getSelectedSourceURL(gSources).contains("-02.js"),
"The current source shouldn't have changed after a global search.");
is(gSources.visibleItems.length, 2,
"Not all the sources are shown after the global search.");

View File

@ -73,7 +73,7 @@ function htmlSearch() {
"Shouldn't create empty label nodes.");
}
if (value) {
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").includes(value),
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").contains(value),
"The corect value (" + value + ") is attached.");
} else {
ok(!target.querySelector(".results-panel-item-label-below"),
@ -144,7 +144,7 @@ function firstJsSearch() {
"Shouldn't create empty label nodes.");
}
if (value) {
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").includes(value),
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").contains(value),
"The corect value (" + value + ") is attached.");
} else {
ok(!target.querySelector(".results-panel-item-label-below"),
@ -215,7 +215,7 @@ function secondJsSearch() {
"Shouldn't create empty label nodes.");
}
if (value) {
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").includes(value),
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").contains(value),
"The corect value (" + value + ") is attached.");
} else {
ok(!target.querySelector(".results-panel-item-label-below"),
@ -286,7 +286,7 @@ function thirdJsSearch() {
"Shouldn't create empty label nodes.");
}
if (value) {
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").includes(value),
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").contains(value),
"The corect value (" + value + ") is attached.");
} else {
ok(!target.querySelector(".results-panel-item-label-below"),
@ -354,7 +354,7 @@ function filterSearch() {
"Shouldn't create empty label nodes.");
}
if (value) {
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").includes(value),
ok(target.querySelector(".results-panel-item-label-below").getAttribute("value").contains(value),
"The corect value (" + value + ") is attached.");
} else {
ok(!target.querySelector(".results-panel-item-label-below"),

View File

@ -36,11 +36,11 @@ function test() {
}
function initialChecks() {
ok(gEditor.getText().includes("First source!"),
ok(gEditor.getText().contains("First source!"),
"Editor text contents appears to be correct.");
is(gSources.selectedItem.attachment.label, "code_function-search-01.js",
"The currently selected label in the sources container is correct.");
ok(getSelectedSourceURL(gSources).includes("code_function-search-01.js"),
ok(getSelectedSourceURL(gSources).contains("code_function-search-01.js"),
"The currently selected value in the sources container appears to be correct.");
is(gSources.itemCount, TOTAL_SOURCES,
@ -57,22 +57,22 @@ function initialChecks() {
is(gSources.attachments[0].label, "code_function-search-01.js",
"The first source label is correct.");
ok(gSources.attachments[0].source.url.includes("code_function-search-01.js"),
ok(gSources.attachments[0].source.url.contains("code_function-search-01.js"),
"The first source value appears to be correct.");
is(gSources.attachments[1].label, "code_function-search-02.js",
"The second source label is correct.");
ok(gSources.attachments[1].source.url.includes("code_function-search-02.js"),
ok(gSources.attachments[1].source.url.contains("code_function-search-02.js"),
"The second source value appears to be correct.");
is(gSources.attachments[2].label, "code_function-search-03.js",
"The third source label is correct.");
ok(gSources.attachments[2].source.url.includes("code_function-search-03.js"),
ok(gSources.attachments[2].source.url.contains("code_function-search-03.js"),
"The third source value appears to be correct.");
is(gSources.attachments[3].label, "doc_function-search.html",
"The third source label is correct.");
ok(gSources.attachments[3].source.url.includes("doc_function-search.html"),
ok(gSources.attachments[3].source.url.contains("doc_function-search.html"),
"The third source value appears to be correct.");
is(gDebugger.SourceUtils._labelsCache.size, TOTAL_SOURCES,
@ -98,7 +98,7 @@ function testCacheIntegrity(aSources) {
ok(index >= 0 && index <= TOTAL_SOURCES,
"Found a source actor cached correctly (" + index + ").");
ok(contents.includes(
ok(contents.contains(
["First source!", "Second source!", "Third source!", "Peanut butter jelly time!"][index]),
"Found a source's text contents cached correctly (" + index + ").");

View File

@ -42,7 +42,7 @@ function testTabActor([aGrip, aResponse]) {
ok(aGrip.testTabActor1,
"Found the test tab actor.");
ok(aGrip.testTabActor1.includes("test_one"),
ok(aGrip.testTabActor1.contains("test_one"),
"testTabActor1's actorPrefix should be used.");
gClient.request({ to: aGrip.testTabActor1, type: "ping" }, aResponse => {

View File

@ -42,7 +42,7 @@ function testTabActor([aGrip, aResponse]) {
ok(aGrip.testTabActor1,
"Found the test tab actor.");
ok(aGrip.testTabActor1.includes("test_one"),
ok(aGrip.testTabActor1.contains("test_one"),
"testTabActor1's actorPrefix should be used.");
gClient.request({ to: aGrip.testTabActor1, type: "ping" }, aResponse => {

View File

@ -49,14 +49,14 @@ function testTraceLogs() {
"The second 'onclick' log should be a return.");
for (let t of onclickLogs) {
ok(t.querySelector(".trace-item").getAttribute("tooltiptext")
.includes("doc_tracing-01.html"));
.contains("doc_tracing-01.html"));
}
const nonOnclickLogs = filterTraces(gPanel,
t => !t.querySelector(".trace-name[value=onclick]"));
for (let t of nonOnclickLogs) {
ok(t.querySelector(".trace-item").getAttribute("tooltiptext")
.includes("code_tracing-01.js"));
.contains("code_tracing-01.js"));
}
const mainLogs = filterTraces(gPanel,

View File

@ -15,7 +15,7 @@ function test() {
ok(testScope,
"Should have created a scope.");
ok(testScope.id.includes("test"),
ok(testScope.id.contains("test"),
"The newly created scope should have the default id set.");
is(testScope.name, "test",
"The newly created scope should have the desired name set.");
@ -27,7 +27,7 @@ function test() {
ok(testScope.target,
"The newly created scope should point to a target node.");
ok(testScope.target.id.includes("test"),
ok(testScope.target.id.contains("test"),
"Should have the correct scope id on the element.");
is(testScope.target.querySelector(".name").getAttribute("value"), "test",

View File

@ -27,7 +27,7 @@ function test() {
ok(testVar,
"Should have created a variable.");
ok(testVar.id.includes("something"),
ok(testVar.id.contains("something"),
"The newly created variable should have the default id set.");
is(testVar.name, "something",
"The newly created variable should have the desired name set.");
@ -39,7 +39,7 @@ function test() {
ok(testVar.target,
"The newly created scope should point to a target node.");
ok(testVar.target.id.includes("something"),
ok(testVar.target.id.contains("something"),
"Should have the correct variable id on the element.");
is(testVar.target.querySelector(".name").getAttribute("value"), "something",
@ -157,7 +157,7 @@ function test() {
let testChild = testVar.get("child");
ok(testChild,
"Should have created a child property.");
ok(testChild.id.includes("child"),
ok(testChild.id.contains("child"),
"The newly created property should have the default id set.");
is(testChild.name, "child",
"The newly created property should have the desired name set.");
@ -169,7 +169,7 @@ function test() {
ok(testChild.target,
"The newly created scope should point to a target node.");
ok(testChild.target.id.includes("child"),
ok(testChild.target.id.contains("child"),
"Should have the correct property id on the element.");
is(testChild.target.querySelector(".name").getAttribute("value"), "child",

View File

@ -38,9 +38,9 @@ function initialChecks() {
is(scopeNodes.length, 2,
"There should be 2 scopes available.");
ok(scopeNodes[0].querySelector(".name").getAttribute("value").includes("[test]"),
ok(scopeNodes[0].querySelector(".name").getAttribute("value").contains("[test]"),
"The local scope should be properly identified.");
ok(scopeNodes[1].querySelector(".name").getAttribute("value").includes("[Window]"),
ok(scopeNodes[1].querySelector(".name").getAttribute("value").contains("[Window]"),
"The global scope should be properly identified.");
is(gVariables.getScopeAtIndex(0).target, scopeNodes[0],
@ -89,7 +89,7 @@ function testExpandVariables() {
is(thisVar.get("window").target.querySelector(".value").getAttribute("value"),
"Window \u2192 doc_frame-parameters.html",
"Should have the right property value for 'window'.");
ok(thisVar.get("window").target.querySelector(".value").className.includes("token-other"),
ok(thisVar.get("window").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'window'.");
is(thisVar.get("document").target.querySelector(".name").getAttribute("value"), "document",
@ -97,7 +97,7 @@ function testExpandVariables() {
is(thisVar.get("document").target.querySelector(".value").getAttribute("value"),
"HTMLDocument \u2192 doc_frame-parameters.html",
"Should have the right property value for 'document'.");
ok(thisVar.get("document").target.querySelector(".value").className.includes("token-domnode"),
ok(thisVar.get("document").target.querySelector(".value").className.contains("token-domnode"),
"Should have the right token class for 'document'.");
let argsProps = argsVar.target.querySelectorAll(".variables-view-property");
@ -108,35 +108,35 @@ function testExpandVariables() {
"Should have the right property name for '0'.");
is(argsProps[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '0'.");
ok(argsProps[0].querySelector(".value").className.includes("token-other"),
ok(argsProps[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '0'.");
is(argsProps[1].querySelector(".name").getAttribute("value"), "1",
"Should have the right property name for '1'.");
is(argsProps[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for '1'.");
ok(argsProps[1].querySelector(".value").className.includes("token-string"),
ok(argsProps[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for '1'.");
is(argsProps[2].querySelector(".name").getAttribute("value"), "2",
"Should have the right property name for '2'.");
is(argsProps[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property name for '2'.");
ok(argsProps[2].querySelector(".value").className.includes("token-number"),
ok(argsProps[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for '2'.");
is(argsProps[3].querySelector(".name").getAttribute("value"), "3",
"Should have the right property name for '3'.");
is(argsProps[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for '3'.");
ok(argsProps[3].querySelector(".value").className.includes("token-boolean"),
ok(argsProps[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for '3'.");
is(argsProps[4].querySelector(".name").getAttribute("value"), "4",
"Should have the right property name for '4'.");
is(argsProps[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property name for '4'.");
ok(argsProps[4].querySelector(".value").className.includes("token-null"),
ok(argsProps[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for '4'.");
is(gVariables.getItemForNode(argsProps[0]).target,
@ -171,42 +171,42 @@ function testExpandVariables() {
"Should have the right property name for 'a'.");
is(cProps[0].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(cProps[0].querySelector(".value").className.includes("token-number"),
ok(cProps[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(cProps[1].querySelector(".name").getAttribute("value"), "b",
"Should have the right property name for 'b'.");
is(cProps[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for 'b'.");
ok(cProps[1].querySelector(".value").className.includes("token-string"),
ok(cProps[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'b'.");
is(cProps[2].querySelector(".name").getAttribute("value"), "c",
"Should have the right property name for 'c'.");
is(cProps[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property value for 'c'.");
ok(cProps[2].querySelector(".value").className.includes("token-number"),
ok(cProps[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'c'.");
is(cProps[3].querySelector(".name").getAttribute("value"), "d",
"Should have the right property name for 'd'.");
is(cProps[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for 'd'.");
ok(cProps[3].querySelector(".value").className.includes("token-boolean"),
ok(cProps[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for 'd'.");
is(cProps[4].querySelector(".name").getAttribute("value"), "e",
"Should have the right property name for 'e'.");
is(cProps[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'e'.");
ok(cProps[4].querySelector(".value").className.includes("token-null"),
ok(cProps[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'e'.");
is(cProps[5].querySelector(".name").getAttribute("value"), "f",
"Should have the right property name for 'f'.");
is(cProps[5].querySelector(".value").getAttribute("value"), "undefined",
"Should have the right property value for 'f'.");
ok(cProps[5].querySelector(".value").className.includes("token-undefined"),
ok(cProps[5].querySelector(".value").className.contains("token-undefined"),
"Should have the right token class for 'f'.");
is(gVariables.getItemForNode(cProps[0]).target,

View File

@ -56,84 +56,84 @@ function testScopeVariables() {
is(localEnums[0].querySelector(".value").getAttribute("value"),
"Window \u2192 doc_frame-parameters.html",
"Should have the right property value for 'this'.");
ok(localEnums[0].querySelector(".value").className.includes("token-other"),
ok(localEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'this'.");
is(localEnums[1].querySelector(".name").getAttribute("value"), "aArg",
"Should have the right property name for 'aArg'.");
is(localEnums[1].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'aArg'.");
ok(localEnums[1].querySelector(".value").className.includes("token-other"),
ok(localEnums[1].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'aArg'.");
is(localEnums[2].querySelector(".name").getAttribute("value"), "bArg",
"Should have the right property name for 'bArg'.");
is(localEnums[2].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for 'bArg'.");
ok(localEnums[2].querySelector(".value").className.includes("token-string"),
ok(localEnums[2].querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'bArg'.");
is(localEnums[3].querySelector(".name").getAttribute("value"), "cArg",
"Should have the right property name for 'cArg'.");
is(localEnums[3].querySelector(".value").getAttribute("value"), "3",
"Should have the right property value for 'cArg'.");
ok(localEnums[3].querySelector(".value").className.includes("token-number"),
ok(localEnums[3].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'cArg'.");
is(localEnums[4].querySelector(".name").getAttribute("value"), "dArg",
"Should have the right property name for 'dArg'.");
is(localEnums[4].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for 'dArg'.");
ok(localEnums[4].querySelector(".value").className.includes("token-boolean"),
ok(localEnums[4].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for 'dArg'.");
is(localEnums[5].querySelector(".name").getAttribute("value"), "eArg",
"Should have the right property name for 'eArg'.");
is(localEnums[5].querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'eArg'.");
ok(localEnums[5].querySelector(".value").className.includes("token-null"),
ok(localEnums[5].querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'eArg'.");
is(localEnums[6].querySelector(".name").getAttribute("value"), "fArg",
"Should have the right property name for 'fArg'.");
is(localEnums[6].querySelector(".value").getAttribute("value"), "undefined",
"Should have the right property value for 'fArg'.");
ok(localEnums[6].querySelector(".value").className.includes("token-undefined"),
ok(localEnums[6].querySelector(".value").className.contains("token-undefined"),
"Should have the right token class for 'fArg'.");
is(localEnums[7].querySelector(".name").getAttribute("value"), "a",
"Should have the right property name for 'a'.");
is(localEnums[7].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(localEnums[7].querySelector(".value").className.includes("token-number"),
ok(localEnums[7].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(localEnums[8].querySelector(".name").getAttribute("value"), "arguments",
"Should have the right property name for 'arguments'.");
is(localEnums[8].querySelector(".value").getAttribute("value"), "Arguments",
"Should have the right property value for 'arguments'.");
ok(localEnums[8].querySelector(".value").className.includes("token-other"),
ok(localEnums[8].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'arguments'.");
is(localEnums[9].querySelector(".name").getAttribute("value"), "b",
"Should have the right property name for 'b'.");
is(localEnums[9].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'b'.");
ok(localEnums[9].querySelector(".value").className.includes("token-other"),
ok(localEnums[9].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'b'.");
is(localEnums[10].querySelector(".name").getAttribute("value"), "c",
"Should have the right property name for 'c'.");
is(localEnums[10].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'c'.");
ok(localEnums[10].querySelector(".value").className.includes("token-other"),
ok(localEnums[10].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'c'.");
is(localEnums[11].querySelector(".name").getAttribute("value"), "myVar",
"Should have the right property name for 'myVar'.");
is(localEnums[11].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'myVar'.");
ok(localEnums[11].querySelector(".value").className.includes("token-other"),
ok(localEnums[11].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'myVar'.");
}
@ -157,35 +157,35 @@ function testArgumentsProperties() {
"Should have the right property name for '0'.");
is(argsEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '0'.");
ok(argsEnums[0].querySelector(".value").className.includes("token-other"),
ok(argsEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '0'.");
is(argsEnums[1].querySelector(".name").getAttribute("value"), "1",
"Should have the right property name for '1'.");
is(argsEnums[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for '1'.");
ok(argsEnums[1].querySelector(".value").className.includes("token-string"),
ok(argsEnums[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for '1'.");
is(argsEnums[2].querySelector(".name").getAttribute("value"), "2",
"Should have the right property name for '2'.");
is(argsEnums[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property name for '2'.");
ok(argsEnums[2].querySelector(".value").className.includes("token-number"),
ok(argsEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for '2'.");
is(argsEnums[3].querySelector(".name").getAttribute("value"), "3",
"Should have the right property name for '3'.");
is(argsEnums[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for '3'.");
ok(argsEnums[3].querySelector(".value").className.includes("token-boolean"),
ok(argsEnums[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for '3'.");
is(argsEnums[4].querySelector(".name").getAttribute("value"), "4",
"Should have the right property name for '4'.");
is(argsEnums[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property name for '4'.");
ok(argsEnums[4].querySelector(".value").className.includes("token-null"),
ok(argsEnums[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for '4'.");
is(argsNonEnums[0].querySelector(".name").getAttribute("value"), "callee",
@ -193,21 +193,21 @@ function testArgumentsProperties() {
is(argsNonEnums[0].querySelector(".value").getAttribute("value"),
"test(aArg,bArg,cArg,dArg,eArg,fArg)",
"Should have the right property name for 'callee'.");
ok(argsNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(argsNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'callee'.");
is(argsNonEnums[1].querySelector(".name").getAttribute("value"), "length",
"Should have the right property name for 'length'.");
is(argsNonEnums[1].querySelector(".value").getAttribute("value"), "5",
"Should have the right property value for 'length'.");
ok(argsNonEnums[1].querySelector(".value").className.includes("token-number"),
ok(argsNonEnums[1].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'length'.");
is(argsNonEnums[2].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(argsNonEnums[2].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(argsNonEnums[2].querySelector(".value").className.includes("token-other"),
ok(argsNonEnums[2].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
deferred.resolve();
@ -237,14 +237,14 @@ function testSimpleObject() {
"Should have the right property name for 'a'.");
is(bEnums[0].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(bEnums[0].querySelector(".value").className.includes("token-number"),
ok(bEnums[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(bNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(bNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(bNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(bNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
deferred.resolve();
@ -274,49 +274,49 @@ function testComplexObject() {
"Should have the right property name for 'a'.");
is(cEnums[0].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(cEnums[0].querySelector(".value").className.includes("token-number"),
ok(cEnums[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(cEnums[1].querySelector(".name").getAttribute("value"), "b",
"Should have the right property name for 'b'.");
is(cEnums[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for 'b'.");
ok(cEnums[1].querySelector(".value").className.includes("token-string"),
ok(cEnums[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'b'.");
is(cEnums[2].querySelector(".name").getAttribute("value"), "c",
"Should have the right property name for 'c'.");
is(cEnums[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property value for 'c'.");
ok(cEnums[2].querySelector(".value").className.includes("token-number"),
ok(cEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'c'.");
is(cEnums[3].querySelector(".name").getAttribute("value"), "d",
"Should have the right property name for 'd'.");
is(cEnums[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for 'd'.");
ok(cEnums[3].querySelector(".value").className.includes("token-boolean"),
ok(cEnums[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for 'd'.");
is(cEnums[4].querySelector(".name").getAttribute("value"), "e",
"Should have the right property name for 'e'.");
is(cEnums[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'e'.");
ok(cEnums[4].querySelector(".value").className.includes("token-null"),
ok(cEnums[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'e'.");
is(cEnums[5].querySelector(".name").getAttribute("value"), "f",
"Should have the right property name for 'f'.");
is(cEnums[5].querySelector(".value").getAttribute("value"), "undefined",
"Should have the right property value for 'f'.");
ok(cEnums[5].querySelector(".value").className.includes("token-undefined"),
ok(cEnums[5].querySelector(".value").className.contains("token-undefined"),
"Should have the right token class for 'f'.");
is(cNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(cNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(cNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(cNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
deferred.resolve();
@ -346,49 +346,49 @@ function testArgumentObject() {
"Should have the right property name for 'a'.");
is(argEnums[0].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(argEnums[0].querySelector(".value").className.includes("token-number"),
ok(argEnums[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(argEnums[1].querySelector(".name").getAttribute("value"), "b",
"Should have the right property name for 'b'.");
is(argEnums[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for 'b'.");
ok(argEnums[1].querySelector(".value").className.includes("token-string"),
ok(argEnums[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'b'.");
is(argEnums[2].querySelector(".name").getAttribute("value"), "c",
"Should have the right property name for 'c'.");
is(argEnums[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property value for 'c'.");
ok(argEnums[2].querySelector(".value").className.includes("token-number"),
ok(argEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'c'.");
is(argEnums[3].querySelector(".name").getAttribute("value"), "d",
"Should have the right property name for 'd'.");
is(argEnums[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for 'd'.");
ok(argEnums[3].querySelector(".value").className.includes("token-boolean"),
ok(argEnums[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for 'd'.");
is(argEnums[4].querySelector(".name").getAttribute("value"), "e",
"Should have the right property name for 'e'.");
is(argEnums[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'e'.");
ok(argEnums[4].querySelector(".value").className.includes("token-null"),
ok(argEnums[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'e'.");
is(argEnums[5].querySelector(".name").getAttribute("value"), "f",
"Should have the right property name for 'f'.");
is(argEnums[5].querySelector(".value").getAttribute("value"), "undefined",
"Should have the right property value for 'f'.");
ok(argEnums[5].querySelector(".value").className.includes("token-undefined"),
ok(argEnums[5].querySelector(".value").className.contains("token-undefined"),
"Should have the right token class for 'f'.");
is(argNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(argNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(argNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(argNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
deferred.resolve();
@ -418,49 +418,49 @@ function testInnerArgumentObject() {
"Should have the right property name for 'a'.");
is(argEnums[0].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'a'.");
ok(argEnums[0].querySelector(".value").className.includes("token-number"),
ok(argEnums[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(argEnums[1].querySelector(".name").getAttribute("value"), "b",
"Should have the right property name for 'b'.");
is(argEnums[1].querySelector(".value").getAttribute("value"), "\"beta\"",
"Should have the right property value for 'b'.");
ok(argEnums[1].querySelector(".value").className.includes("token-string"),
ok(argEnums[1].querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'b'.");
is(argEnums[2].querySelector(".name").getAttribute("value"), "c",
"Should have the right property name for 'c'.");
is(argEnums[2].querySelector(".value").getAttribute("value"), "3",
"Should have the right property value for 'c'.");
ok(argEnums[2].querySelector(".value").className.includes("token-number"),
ok(argEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'c'.");
is(argEnums[3].querySelector(".name").getAttribute("value"), "d",
"Should have the right property name for 'd'.");
is(argEnums[3].querySelector(".value").getAttribute("value"), "false",
"Should have the right property value for 'd'.");
ok(argEnums[3].querySelector(".value").className.includes("token-boolean"),
ok(argEnums[3].querySelector(".value").className.contains("token-boolean"),
"Should have the right token class for 'd'.");
is(argEnums[4].querySelector(".name").getAttribute("value"), "e",
"Should have the right property name for 'e'.");
is(argEnums[4].querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'e'.");
ok(argEnums[4].querySelector(".value").className.includes("token-null"),
ok(argEnums[4].querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'e'.");
is(argEnums[5].querySelector(".name").getAttribute("value"), "f",
"Should have the right property name for 'f'.");
is(argEnums[5].querySelector(".value").getAttribute("value"), "undefined",
"Should have the right property value for 'f'.");
ok(argEnums[5].querySelector(".value").className.includes("token-undefined"),
ok(argEnums[5].querySelector(".value").className.contains("token-undefined"),
"Should have the right token class for 'f'.");
is(argNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(argNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(argNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(argNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
deferred.resolve();
@ -490,21 +490,21 @@ function testGetterSetterObject() {
"Should have the right property name for '_prop'.");
is(myVarEnums[0].querySelector(".value").getAttribute("value"), "42",
"Should have the right property value for '_prop'.");
ok(myVarEnums[0].querySelector(".value").className.includes("token-number"),
ok(myVarEnums[0].querySelector(".value").className.contains("token-number"),
"Should have the right token class for '_prop'.");
is(myVarEnums[1].querySelector(".name").getAttribute("value"), "prop",
"Should have the right property name for 'prop'.");
is(myVarEnums[1].querySelector(".value").getAttribute("value"), "",
"Should have the right property value for 'prop'.");
ok(!myVarEnums[1].querySelector(".value").className.includes("token"),
ok(!myVarEnums[1].querySelector(".value").className.contains("token"),
"Should have no token class for 'prop'.");
is(myVarNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(myVarNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(myVarNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(myVarNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
let propEnums = myVarEnums[1].querySelector(".variables-view-element-details.enum").childNodes;
@ -520,7 +520,7 @@ function testGetterSetterObject() {
is(propNonEnums[0].querySelector(".value").getAttribute("value"),
"test/myVar.prop()",
"Should have the right property value for 'get'.");
ok(propNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(propNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'get'.");
is(propNonEnums[1].querySelector(".name").getAttribute("value"), "set",
@ -528,7 +528,7 @@ function testGetterSetterObject() {
is(propNonEnums[1].querySelector(".value").getAttribute("value"),
"test/myVar.prop(val)",
"Should have the right property value for 'set'.");
ok(propNonEnums[1].querySelector(".value").className.includes("token-other"),
ok(propNonEnums[1].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'set'.");
deferred.resolve();

View File

@ -41,7 +41,7 @@ function testFirstWithScope() {
let firstWithScope = gVariables.getScopeAtIndex(0);
is(firstWithScope.expanded, true,
"The first 'with' scope should be expanded by default.");
ok(firstWithScope.target.querySelector(".name").getAttribute("value").includes("[Object]"),
ok(firstWithScope.target.querySelector(".name").getAttribute("value").contains("[Object]"),
"The first 'with' scope should be properly identified.");
let withEnums = firstWithScope._enum.childNodes;
@ -57,28 +57,28 @@ function testFirstWithScope() {
is(withEnums[0].querySelector(".value").getAttribute("value"),
"Window \u2192 doc_with-frame.html",
"Should have the right property value for 'this'.");
ok(withEnums[0].querySelector(".value").className.includes("token-other"),
ok(withEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'this'.");
is(withEnums[1].querySelector(".name").getAttribute("value"), "alpha",
"Should have the right property name for 'alpha'.");
is(withEnums[1].querySelector(".value").getAttribute("value"), "1",
"Should have the right property value for 'alpha'.");
ok(withEnums[1].querySelector(".value").className.includes("token-number"),
ok(withEnums[1].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'alpha'.");
is(withEnums[2].querySelector(".name").getAttribute("value"), "beta",
"Should have the right property name for 'beta'.");
is(withEnums[2].querySelector(".value").getAttribute("value"), "2",
"Should have the right property value for 'beta'.");
ok(withEnums[2].querySelector(".value").className.includes("token-number"),
ok(withEnums[2].querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'beta'.");
is(withNonEnums[0].querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(withNonEnums[0].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(withNonEnums[0].querySelector(".value").className.includes("token-other"),
ok(withNonEnums[0].querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
}
@ -102,7 +102,7 @@ function testSecondWithScope() {
let secondWithScope = gVariables.getScopeAtIndex(1);
is(secondWithScope.expanded, true,
"The second 'with' scope should now be expanded.");
ok(secondWithScope.target.querySelector(".name").getAttribute("value").includes("[Math]"),
ok(secondWithScope.target.querySelector(".name").getAttribute("value").contains("[Math]"),
"The second 'with' scope should be properly identified.");
let withEnums = secondWithScope._enum.childNodes;
@ -117,28 +117,28 @@ function testSecondWithScope() {
"Should have the right property name for 'E'.");
is(secondWithScope.get("E").target.querySelector(".value").getAttribute("value"), "2.718281828459045",
"Should have the right property value for 'E'.");
ok(secondWithScope.get("E").target.querySelector(".value").className.includes("token-number"),
ok(secondWithScope.get("E").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'E'.");
is(secondWithScope.get("PI").target.querySelector(".name").getAttribute("value"), "PI",
"Should have the right property name for 'PI'.");
is(secondWithScope.get("PI").target.querySelector(".value").getAttribute("value"), "3.141592653589793",
"Should have the right property value for 'PI'.");
ok(secondWithScope.get("PI").target.querySelector(".value").className.includes("token-number"),
ok(secondWithScope.get("PI").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'PI'.");
is(secondWithScope.get("random").target.querySelector(".name").getAttribute("value"), "random",
"Should have the right property name for 'random'.");
is(secondWithScope.get("random").target.querySelector(".value").getAttribute("value"), "random()",
"Should have the right property value for 'random'.");
ok(secondWithScope.get("random").target.querySelector(".value").className.includes("token-other"),
ok(secondWithScope.get("random").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'random'.");
is(secondWithScope.get("__proto__").target.querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(secondWithScope.get("__proto__").target.querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for '__proto__'.");
ok(secondWithScope.get("__proto__").target.querySelector(".value").className.includes("token-other"),
ok(secondWithScope.get("__proto__").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
}
@ -159,7 +159,7 @@ function testFunctionScope() {
let funcScope = gVariables.getScopeAtIndex(2);
is(funcScope.expanded, true,
"The function scope should now be expanded.");
ok(funcScope.target.querySelector(".name").getAttribute("value").includes("[test]"),
ok(funcScope.target.querySelector(".name").getAttribute("value").contains("[test]"),
"The function scope should be properly identified.");
let funcEnums = funcScope._enum.childNodes;
@ -174,28 +174,28 @@ function testFunctionScope() {
"Should have the right property name for 'aNumber'.");
is(funcScope.get("aNumber").target.querySelector(".value").getAttribute("value"), "10",
"Should have the right property value for 'aNumber'.");
ok(funcScope.get("aNumber").target.querySelector(".value").className.includes("token-number"),
ok(funcScope.get("aNumber").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'aNumber'.");
is(funcScope.get("a").target.querySelector(".name").getAttribute("value"), "a",
"Should have the right property name for 'a'.");
is(funcScope.get("a").target.querySelector(".value").getAttribute("value"), "314.1592653589793",
"Should have the right property value for 'a'.");
ok(funcScope.get("a").target.querySelector(".value").className.includes("token-number"),
ok(funcScope.get("a").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'a'.");
is(funcScope.get("r").target.querySelector(".name").getAttribute("value"), "r",
"Should have the right property name for 'r'.");
is(funcScope.get("r").target.querySelector(".value").getAttribute("value"), "10",
"Should have the right property value for 'r'.");
ok(funcScope.get("r").target.querySelector(".value").className.includes("token-number"),
ok(funcScope.get("r").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'r'.");
is(funcScope.get("foo").target.querySelector(".name").getAttribute("value"), "foo",
"Should have the right property name for 'foo'.");
is(funcScope.get("foo").target.querySelector(".value").getAttribute("value"), "6.283185307179586",
"Should have the right property value for 'foo'.");
ok(funcScope.get("foo").target.querySelector(".value").className.includes("token-number"),
ok(funcScope.get("foo").target.querySelector(".value").className.contains("token-number"),
"Should have the right token class for 'foo'.");
}

View File

@ -46,21 +46,21 @@ function initialChecks() {
"Should have the right property name for 'buffer'.");
is(bufferVar.target.querySelector(".value").getAttribute("value"), "ArrayBuffer",
"Should have the right property value for 'buffer'.");
ok(bufferVar.target.querySelector(".value").className.includes("token-other"),
ok(bufferVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'buffer'.");
is(arrayVar.target.querySelector(".name").getAttribute("value"), "largeArray",
"Should have the right property name for 'largeArray'.");
is(arrayVar.target.querySelector(".value").getAttribute("value"), "Int8Array[10000]",
"Should have the right property value for 'largeArray'.");
ok(arrayVar.target.querySelector(".value").className.includes("token-other"),
ok(arrayVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'largeArray'.");
is(objectVar.target.querySelector(".name").getAttribute("value"), "largeObject",
"Should have the right property name for 'largeObject'.");
is(objectVar.target.querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'largeObject'.");
ok(objectVar.target.querySelector(".value").className.includes("token-other"),
ok(objectVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'largeObject'.");
is(bufferVar.expanded, false,

View File

@ -25,7 +25,7 @@ function test() {
is(tooltip.querySelector(".devtools-tooltip-simple-text").textContent, textContent,
"The inspected property's value is correct.");
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.includes(className),
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.contains(className),
"The inspected property's value is colorized correctly.");
}

View File

@ -23,7 +23,7 @@ function test() {
is(tooltip.querySelector(".devtools-tooltip-simple-text").textContent, textContent,
"The inspected property's value is correct.");
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.includes(className),
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.contains(className),
"The inspected property's value is colorized correctly.");
}

View File

@ -23,7 +23,7 @@ function test() {
is(tooltip.querySelector(".devtools-tooltip-simple-text").textContent, textContent,
"The inspected property's value is correct.");
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.includes(className),
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.contains(className),
"The inspected property's value is colorized correctly.");
}

View File

@ -25,7 +25,7 @@ function test() {
is(tooltip.querySelector(".devtools-tooltip-simple-text").textContent, textContent,
"The inspected property's value is correct.");
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.includes(className),
ok(tooltip.querySelector(".devtools-tooltip-simple-text").className.contains(className),
"The inspected property's value is colorized correctly.");
}

View File

@ -61,14 +61,14 @@ function performTest() {
"Should have the right property name for 'button'.");
is(buttonVar.target.querySelector(".value").getAttribute("value"), "<button>",
"Should have the right property value for 'button'.");
ok(buttonVar.target.querySelector(".value").className.includes("token-domnode"),
ok(buttonVar.target.querySelector(".value").className.contains("token-domnode"),
"Should have the right token class for 'button'.");
is(buttonAsProtoVar.target.querySelector(".name").getAttribute("value"), "buttonAsProto",
"Should have the right property name for 'buttonAsProto'.");
is(buttonAsProtoVar.target.querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for 'buttonAsProto'.");
ok(buttonAsProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(buttonAsProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'buttonAsProto'.");
is(documentVar.target.querySelector(".name").getAttribute("value"), "document",
@ -76,7 +76,7 @@ function performTest() {
is(documentVar.target.querySelector(".value").getAttribute("value"),
"HTMLDocument \u2192 doc_frame-parameters.html",
"Should have the right property value for 'document'.");
ok(documentVar.target.querySelector(".value").className.includes("token-domnode"),
ok(documentVar.target.querySelector(".value").className.contains("token-domnode"),
"Should have the right token class for 'document'.");
is(buttonVar.expanded, false,
@ -91,42 +91,42 @@ function performTest() {
"Should have the right property name for 'type'.");
is(buttonVar.get("type").target.querySelector(".value").getAttribute("value"), "\"submit\"",
"Should have the right property value for 'type'.");
ok(buttonVar.get("type").target.querySelector(".value").className.includes("token-string"),
ok(buttonVar.get("type").target.querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'type'.");
is(buttonVar.get("childNodes").target.querySelector(".name").getAttribute("value"), "childNodes",
"Should have the right property name for 'childNodes'.");
is(buttonVar.get("childNodes").target.querySelector(".value").getAttribute("value"), "NodeList[1]",
"Should have the right property value for 'childNodes'.");
ok(buttonVar.get("childNodes").target.querySelector(".value").className.includes("token-other"),
ok(buttonVar.get("childNodes").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'childNodes'.");
is(buttonVar.get("onclick").target.querySelector(".name").getAttribute("value"), "onclick",
"Should have the right property name for 'onclick'.");
is(buttonVar.get("onclick").target.querySelector(".value").getAttribute("value"), "onclick(event)",
"Should have the right property value for 'onclick'.");
ok(buttonVar.get("onclick").target.querySelector(".value").className.includes("token-other"),
ok(buttonVar.get("onclick").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'onclick'.");
is(documentVar.get("title").target.querySelector(".name").getAttribute("value"), "title",
"Should have the right property name for 'title'.");
is(documentVar.get("title").target.querySelector(".value").getAttribute("value"), "\"Debugger test page\"",
"Should have the right property value for 'title'.");
ok(documentVar.get("title").target.querySelector(".value").className.includes("token-string"),
ok(documentVar.get("title").target.querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'title'.");
is(documentVar.get("childNodes").target.querySelector(".name").getAttribute("value"), "childNodes",
"Should have the right property name for 'childNodes'.");
is(documentVar.get("childNodes").target.querySelector(".value").getAttribute("value"), "NodeList[3]",
"Should have the right property value for 'childNodes'.");
ok(documentVar.get("childNodes").target.querySelector(".value").className.includes("token-other"),
ok(documentVar.get("childNodes").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'childNodes'.");
is(documentVar.get("onclick").target.querySelector(".name").getAttribute("value"), "onclick",
"Should have the right property name for 'onclick'.");
is(documentVar.get("onclick").target.querySelector(".value").getAttribute("value"), "null",
"Should have the right property value for 'onclick'.");
ok(documentVar.get("onclick").target.querySelector(".value").className.includes("token-null"),
ok(documentVar.get("onclick").target.querySelector(".value").className.contains("token-null"),
"Should have the right token class for 'onclick'.");
let buttonProtoVar = buttonVar.get("__proto__");
@ -137,21 +137,21 @@ function performTest() {
"Should have the right property name for '__proto__'.");
is(buttonProtoVar.target.querySelector(".value").getAttribute("value"), "HTMLButtonElementPrototype",
"Should have the right property value for '__proto__'.");
ok(buttonProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(buttonProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
is(buttonAsProtoProtoVar.target.querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(buttonAsProtoProtoVar.target.querySelector(".value").getAttribute("value"), "<button>",
"Should have the right property value for '__proto__'.");
ok(buttonAsProtoProtoVar.target.querySelector(".value").className.includes("token-domnode"),
ok(buttonAsProtoProtoVar.target.querySelector(".value").className.contains("token-domnode"),
"Should have the right token class for '__proto__'.");
is(documentProtoVar.target.querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(documentProtoVar.target.querySelector(".value").getAttribute("value"), "HTMLDocumentPrototype",
"Should have the right property value for '__proto__'.");
ok(documentProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(documentProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
is(buttonProtoVar.expanded, false,
@ -166,21 +166,21 @@ function performTest() {
"Should have the right property name for 'type'.");
is(buttonAsProtoProtoVar.get("type").target.querySelector(".value").getAttribute("value"), "\"submit\"",
"Should have the right property value for 'type'.");
ok(buttonAsProtoProtoVar.get("type").target.querySelector(".value").className.includes("token-string"),
ok(buttonAsProtoProtoVar.get("type").target.querySelector(".value").className.contains("token-string"),
"Should have the right token class for 'type'.");
is(buttonAsProtoProtoVar.get("childNodes").target.querySelector(".name").getAttribute("value"), "childNodes",
"Should have the right property name for 'childNodes'.");
is(buttonAsProtoProtoVar.get("childNodes").target.querySelector(".value").getAttribute("value"), "NodeList[1]",
"Should have the right property value for 'childNodes'.");
ok(buttonAsProtoProtoVar.get("childNodes").target.querySelector(".value").className.includes("token-other"),
ok(buttonAsProtoProtoVar.get("childNodes").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'childNodes'.");
is(buttonAsProtoProtoVar.get("onclick").target.querySelector(".name").getAttribute("value"), "onclick",
"Should have the right property name for 'onclick'.");
is(buttonAsProtoProtoVar.get("onclick").target.querySelector(".value").getAttribute("value"), "onclick(event)",
"Should have the right property value for 'onclick'.");
ok(buttonAsProtoProtoVar.get("onclick").target.querySelector(".value").className.includes("token-other"),
ok(buttonAsProtoProtoVar.get("onclick").target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for 'onclick'.");
let buttonProtoProtoVar = buttonProtoVar.get("__proto__");
@ -191,21 +191,21 @@ function performTest() {
"Should have the right property name for '__proto__'.");
is(buttonProtoProtoVar.target.querySelector(".value").getAttribute("value"), "HTMLElementPrototype",
"Should have the right property value for '__proto__'.");
ok(buttonProtoProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(buttonProtoProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
is(buttonAsProtoProtoProtoVar.target.querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(buttonAsProtoProtoProtoVar.target.querySelector(".value").getAttribute("value"), "HTMLButtonElementPrototype",
"Should have the right property value for '__proto__'.");
ok(buttonAsProtoProtoProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(buttonAsProtoProtoProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.");
is(documentProtoProtoVar.target.querySelector(".name").getAttribute("value"), "__proto__",
"Should have the right property name for '__proto__'.");
is(documentProtoProtoVar.target.querySelector(".value").getAttribute("value"), "DocumentPrototype",
"Should have the right property value for '__proto__'.");
ok(documentProtoProtoVar.target.querySelector(".value").className.includes("token-other"),
ok(documentProtoProtoVar.target.querySelector(".value").className.contains("token-other"),
"Should have the right token class for '__proto__'.")
is(buttonAsProtoProtoProtoVar.expanded, false,

View File

@ -249,7 +249,7 @@ function waitForSourceShown(aPanel, aUrl) {
let sourceUrl = aSource.url || aSource.introductionUrl;
info("Source shown: " + sourceUrl);
if (!sourceUrl.includes(aUrl)) {
if (!sourceUrl.contains(aUrl)) {
return waitForSourceShown(aPanel, aUrl);
} else {
ok(true, "The correct source has been shown.");
@ -265,7 +265,7 @@ function ensureSourceIs(aPanel, aUrlOrSource, aWaitFlag = false) {
let sources = aPanel.panelWin.DebuggerView.Sources;
if (sources.selectedValue === aUrlOrSource ||
sources.selectedItem.attachment.source.url.includes(aUrlOrSource)) {
sources.selectedItem.attachment.source.url.contains(aUrlOrSource)) {
ok(true, "Expected source is shown: " + aUrlOrSource);
return promise.resolve(null);
}

View File

@ -114,7 +114,7 @@ function test() {
// Bug 1056342: Profiler fails today because of framerate actor, but
// this appears more complex to rework, so leave it for that bug to
// resolve.
if (actor.includes("framerateActor")) {
if (actor.contains("framerateActor")) {
todo(false, "Front for " + actor + " still held in pool!");
continue;
}

View File

@ -48,9 +48,9 @@ function testShortcuts(aToolbox, aIndex) {
let key = gDevTools._tools.get(toolIDs[aIndex]).key;
let toolModifiers = gDevTools._tools.get(toolIDs[aIndex]).modifiers;
let modifiers = {
accelKey: toolModifiers.includes("accel"),
altKey: toolModifiers.includes("alt"),
shiftKey: toolModifiers.includes("shift"),
accelKey: toolModifiers.contains("accel"),
altKey: toolModifiers.contains("alt"),
shiftKey: toolModifiers.contains("shift"),
};
idIndex = aIndex;
info("Testing shortcut for tool " + aIndex + ":" + toolIDs[aIndex] +

View File

@ -216,7 +216,7 @@ add_task(function* () {
info("Waiting for inspector selection to update");
yield onNodeReselected;
ok(content.document.body.outerHTML.includes(clipboard.get()),
ok(content.document.body.outerHTML.contains(clipboard.get()),
"Clipboard content was pasted into the node's outer HTML.");
ok(!getNode(outerHTMLSelector, { expectNoMatch: true }),
"The original node was removed.");

View File

@ -2194,8 +2194,8 @@ ElementEditor.prototype = {
// name="v"a"l"u"e" when editing -> name='v"a"l"u"e"'
// name="v'a"l'u"e" when editing -> name="v'a&quot;l'u&quot;e"
let editValueDisplayed = aAttr.value || "";
let hasDoubleQuote = editValueDisplayed.includes('"');
let hasSingleQuote = editValueDisplayed.includes("'");
let hasDoubleQuote = editValueDisplayed.contains('"');
let hasSingleQuote = editValueDisplayed.contains("'");
let initial = aAttr.name + '="' + editValueDisplayed + '"';
// Can't just wrap value with ' since the value contains both " and '.

View File

@ -901,44 +901,44 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* True if the item should be visible, false otherwise.
*/
isHtml: function({ attachment: { mimeType } })
mimeType && mimeType.includes("/html"),
mimeType && mimeType.contains("/html"),
isCss: function({ attachment: { mimeType } })
mimeType && mimeType.includes("/css"),
mimeType && mimeType.contains("/css"),
isJs: function({ attachment: { mimeType } })
mimeType && (
mimeType.includes("/ecmascript") ||
mimeType.includes("/javascript") ||
mimeType.includes("/x-javascript")),
mimeType.contains("/ecmascript") ||
mimeType.contains("/javascript") ||
mimeType.contains("/x-javascript")),
isXHR: function({ attachment: { isXHR } })
isXHR,
isFont: function({ attachment: { url, mimeType } }) // Fonts are a mess.
(mimeType && (
mimeType.includes("font/") ||
mimeType.includes("/font"))) ||
url.includes(".eot") ||
url.includes(".ttf") ||
url.includes(".otf") ||
url.includes(".woff"),
mimeType.contains("font/") ||
mimeType.contains("/font"))) ||
url.contains(".eot") ||
url.contains(".ttf") ||
url.contains(".otf") ||
url.contains(".woff"),
isImage: function({ attachment: { mimeType } })
mimeType && mimeType.includes("image/"),
mimeType && mimeType.contains("image/"),
isMedia: function({ attachment: { mimeType } }) // Not including images.
mimeType && (
mimeType.includes("audio/") ||
mimeType.includes("video/") ||
mimeType.includes("model/")),
mimeType.contains("audio/") ||
mimeType.contains("video/") ||
mimeType.contains("model/")),
isFlash: function({ attachment: { url, mimeType } }) // Flash is a mess.
(mimeType && (
mimeType.includes("/x-flv") ||
mimeType.includes("/x-shockwave-flash"))) ||
url.includes(".swf") ||
url.includes(".flv"),
mimeType.contains("/x-flv") ||
mimeType.contains("/x-shockwave-flash"))) ||
url.contains(".swf") ||
url.contains(".flv"),
isOther: function(e)
!this.isHtml(e) && !this.isCss(e) && !this.isJs(e) && !this.isXHR(e) &&
@ -1319,7 +1319,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let { mimeType } = aItem.attachment;
let { text, encoding } = aValue.content;
if (mimeType.includes("image/")) {
if (mimeType.contains("image/")) {
let responseBody = yield gNetwork.getString(text);
let node = $(".requests-menu-icon", aItem.target);
node.src = "data:" + mimeType + ";" + encoding + "," + responseBody;
@ -1596,7 +1596,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let { url } = hovered;
let { mimeType, text, encoding } = hovered.responseContent.content;
if (mimeType && mimeType.includes("image/") && (
if (mimeType && mimeType.contains("image/") && (
aTarget.classList.contains("requests-menu-icon") ||
aTarget.classList.contains("requests-menu-file")))
{
@ -1637,7 +1637,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
let copyImageAsDataUriElement = $("#request-menu-context-copy-image-as-data-uri");
copyImageAsDataUriElement.hidden = !selectedItem ||
!selectedItem.attachment.responseContent ||
!selectedItem.attachment.responseContent.content.mimeType.includes("image/");
!selectedItem.attachment.responseContent.content.mimeType.contains("image/");
let separator = $("#request-menu-context-separator");
separator.hidden = !selectedItem;
@ -2357,7 +2357,7 @@ NetworkDetailsView.prototype = {
let contentType = yield gNetwork.getString(contentTypeLongString);
// Handle query strings (e.g. "?foo=bar&baz=42").
if (contentType.includes("x-www-form-urlencoded")) {
if (contentType.contains("x-www-form-urlencoded")) {
for (let section of postData.split(/\r\n|\r|\n/)) {
// Before displaying it, make sure this section of the POST data
// isn't a line containing upload stream headers.
@ -2487,7 +2487,7 @@ NetworkDetailsView.prototype = {
}
}
// Handle images.
else if (mimeType.includes("image/")) {
else if (mimeType.contains("image/")) {
$("#response-content-image-box").setAttribute("align", "center");
$("#response-content-image-box").setAttribute("pack", "center");
$("#response-content-image-box").hidden = false;
@ -2520,7 +2520,7 @@ NetworkDetailsView.prototype = {
// Maybe set a more appropriate mode in the Source Editor if possible,
// but avoid doing this for very large files.
if (responseBody.length < SOURCE_SYNTAX_HIGHLIGHT_MAX_FILE_SIZE) {
let mapping = Object.keys(CONTENT_MIME_TYPE_MAPPINGS).find(key => mimeType.includes(key));
let mapping = Object.keys(CONTENT_MIME_TYPE_MAPPINGS).find(key => mimeType.contains(key));
if (mapping) {
editor.setMode(CONTENT_MIME_TYPE_MAPPINGS[mapping]);
}

View File

@ -59,10 +59,10 @@ function test() {
function checkVisibility(aBox) {
is(tabpanel.querySelector("#request-params-box")
.hasAttribute("hidden"), !aBox.includes("params"),
.hasAttribute("hidden"), !aBox.contains("params"),
"The request params box doesn't have the indended visibility.");
is(tabpanel.querySelector("#request-post-data-textarea-box")
.hasAttribute("hidden"), !aBox.includes("textarea"),
.hasAttribute("hidden"), !aBox.contains("textarea"),
"The request post data textarea box doesn't have the indended visibility.");
}
@ -127,19 +127,19 @@ function test() {
"There should be 0 param values displayed in the post scope.");
return NetMonitorView.editor("#request-post-data-textarea").then((aEditor) => {
ok(aEditor.getText().includes("Content-Disposition: form-data; name=\"text\""),
ok(aEditor.getText().contains("Content-Disposition: form-data; name=\"text\""),
"The text shown in the source editor is incorrect (1.1).");
ok(aEditor.getText().includes("Content-Disposition: form-data; name=\"email\""),
ok(aEditor.getText().contains("Content-Disposition: form-data; name=\"email\""),
"The text shown in the source editor is incorrect (2.1).");
ok(aEditor.getText().includes("Content-Disposition: form-data; name=\"range\""),
ok(aEditor.getText().contains("Content-Disposition: form-data; name=\"range\""),
"The text shown in the source editor is incorrect (3.1).");
ok(aEditor.getText().includes("Content-Disposition: form-data; name=\"Custom field\""),
ok(aEditor.getText().contains("Content-Disposition: form-data; name=\"Custom field\""),
"The text shown in the source editor is incorrect (4.1).");
ok(aEditor.getText().includes("Some text..."),
ok(aEditor.getText().contains("Some text..."),
"The text shown in the source editor is incorrect (2.2).");
ok(aEditor.getText().includes("42"),
ok(aEditor.getText().contains("42"),
"The text shown in the source editor is incorrect (3.2).");
ok(aEditor.getText().includes("Extra data"),
ok(aEditor.getText().contains("Extra data"),
"The text shown in the source editor is incorrect (4.2).");
is(aEditor.getMode(), Editor.modes.text,
"The mode active in the source editor is incorrect.");

View File

@ -77,7 +77,7 @@ function test() {
L10N.getFormatStr("networkMenu.sizeKB", L10N.numberWithDecimals(330/1024, 3)) + ")",
"The response headers scope doesn't have the correct title.");
ok(requestScope.querySelector(".name").getAttribute("value").includes(
ok(requestScope.querySelector(".name").getAttribute("value").contains(
L10N.getStr("requestHeaders") + " (0"),
"The request headers scope doesn't have the correct title.");
// Can't test for full request headers title because the size may

View File

@ -7,8 +7,8 @@ function handleRequest(request, response) {
response.processAsync();
let params = request.queryString.split("&");
let format = (params.filter((s) => s.includes("fmt="))[0] || "").split("=")[1];
let status = (params.filter((s) => s.includes("sts="))[0] || "").split("=")[1] || 200;
let format = (params.filter((s) => s.contains("fmt="))[0] || "").split("=")[1];
let status = (params.filter((s) => s.contains("sts="))[0] || "").split("=")[1] || 200;
let cachedCount = 0;
let cacheExpire = 60; // seconds
@ -51,7 +51,7 @@ function handleRequest(request, response) {
break;
}
case "html": {
let content = params.filter((s) => s.includes("res="))[0].split("=")[1];
let content = params.filter((s) => s.contains("res="))[0].split("=")[1];
response.setStatusLine(request.httpVersion, status, "OK");
response.setHeader("Content-Type", "text/html; charset=utf-8", false);
setCacheHeaders();
@ -93,7 +93,7 @@ function handleRequest(request, response) {
break;
}
case "jsonp": {
let fun = params.filter((s) => s.includes("jsonp="))[0].split("=")[1];
let fun = params.filter((s) => s.contains("jsonp="))[0].split("=")[1];
response.setStatusLine(request.httpVersion, status, "OK");
response.setHeader("Content-Type", "text/json; charset=utf-8", false);
setCacheHeaders();
@ -102,7 +102,7 @@ function handleRequest(request, response) {
break;
}
case "jsonp2": {
let fun = params.filter((s) => s.includes("jsonp="))[0].split("=")[1];
let fun = params.filter((s) => s.contains("jsonp="))[0].split("=")[1];
response.setStatusLine(request.httpVersion, status, "OK");
response.setHeader("Content-Type", "text/json; charset=utf-8", false);
setCacheHeaders();

View File

@ -7,7 +7,7 @@ function handleRequest(request, response) {
response.processAsync();
let params = request.queryString.split("&");
let index = params.filter((s) => s.includes("index="))[0].split("=")[1];
let index = params.filter((s) => s.contains("index="))[0].split("=")[1];
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(() => {

View File

@ -7,7 +7,7 @@ function handleRequest(request, response) {
response.processAsync();
let params = request.queryString.split("&");
let status = params.filter((s) => s.includes("sts="))[0].split("=")[1];
let status = params.filter((s) => s.contains("sts="))[0].split("=")[1];
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.initWithCallback(() => {

View File

@ -63,7 +63,7 @@ function test() {
"The .A node's function cell displays the correct name.");
is($$fun(".call-tree-url")[1].getAttribute("value"), "baz",
"The .A node's function cell displays the correct url.");
ok($$fun(".call-tree-url")[1].getAttribute("tooltiptext").includes("http://foo/bar/baz"),
ok($$fun(".call-tree-url")[1].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
"The .A node's function cell displays the correct url tooltiptext.");
is($$fun(".call-tree-line")[1].getAttribute("value"), ":12",
"The .A node's function cell displays the correct line.");
@ -92,7 +92,7 @@ function test() {
"The .A.B node's function cell displays the correct name.");
is($$fun(".call-tree-url")[2].getAttribute("value"), "baz",
"The .A.B node's function cell displays the correct url.");
ok($$fun(".call-tree-url")[2].getAttribute("tooltiptext").includes("http://foo/bar/baz"),
ok($$fun(".call-tree-url")[2].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
"The .A.B node's function cell displays the correct url tooltiptext.");
is($$fun(".call-tree-line")[2].getAttribute("value"), ":34",
"The .A.B node's function cell displays the correct line.");
@ -111,7 +111,7 @@ function test() {
"The .A.E node's function cell displays the correct name.");
is($$fun(".call-tree-url")[3].getAttribute("value"), "baz",
"The .A.E node's function cell displays the correct url.");
ok($$fun(".call-tree-url")[3].getAttribute("tooltiptext").includes("http://foo/bar/baz"),
ok($$fun(".call-tree-url")[3].getAttribute("tooltiptext").contains("http://foo/bar/baz"),
"The .A.E node's function cell displays the correct url tooltiptext.");
is($$fun(".call-tree-line")[3].getAttribute("value"), ":90",
"The .A.E node's function cell displays the correct line.");

View File

@ -244,8 +244,8 @@ FrameNode.prototype = {
function isContent({ category, location }) {
// Only C++ stack frames have associated category information.
return !category &&
!CHROME_SCHEMES.find(e => location.includes(e)) &&
CONTENT_SCHEMES.find(e => location.includes(e));
!CHROME_SCHEMES.find(e => location.contains(e)) &&
CONTENT_SCHEMES.find(e => location.contains(e));
}
/**

View File

@ -134,8 +134,8 @@ var TextEditor = Class({
let keyUpper = key.getAttribute("key").toUpperCase();
let toolModifiers = key.getAttribute("modifiers");
let modifiers = {
alt: toolModifiers.includes("alt"),
shift: toolModifiers.includes("shift")
alt: toolModifiers.contains("alt"),
shift: toolModifiers.contains("shift")
};
// On the key press, we will dispatch the event within projecteditor.

Some files were not shown because too many files have changed in this diff Show More