Bug 1103588 - Part 2: Replace deprecated String#contains with String#includes in devtools tests. r=jryans

This commit is contained in:
Chris Peterson 2016-04-09 16:04:36 -07:00
Родитель 053a2f3273
Коммит 5cf84aa32d
8 изменённых файлов: 13 добавлений и 11 удалений

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

@ -1,6 +1,8 @@
// Check to make sure that a worker can be attached to a toolbox
// directly, and that the toolbox has expected properties.
"use strict";
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejections should be fixed.
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("[object Object]");
@ -33,7 +35,7 @@ add_task(function* () {
Toolbox.HostType.WINDOW);
is(toolbox._host.type, "window", "correct host");
ok(toolbox._host._window.document.title.contains(WORKER_URL),
ok(toolbox._host._window.document.title.includes(WORKER_URL),
"worker URL in host title");
let toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");

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

@ -16,7 +16,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-actor-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

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

@ -18,7 +18,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-actor-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

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

@ -15,7 +15,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-object-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

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

@ -16,7 +16,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("test-promises-timetosettle");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

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

@ -17,7 +17,7 @@ add_task(function*() {
let chromeActors = yield getChromeActors(client);
yield attachTab(client, chromeActors);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

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

@ -664,12 +664,12 @@ function makeFilterPredicate(filterString) {
}
if (isSavedFrame(node.name)) {
return node.name.source.contains(filterString)
|| (node.name.functionDisplayName || "").contains(filterString)
|| (node.name.asyncCause || "").contains(filterString);
return node.name.source.includes(filterString)
|| (node.name.functionDisplayName || "").includes(filterString)
|| (node.name.asyncCause || "").includes(filterString);
}
return String(node.name).contains(filterString);
return String(node.name).includes(filterString);
};
}

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

@ -33,7 +33,7 @@ do_register_cleanup(() => {
add_task(function* test_normal() {
yield DevToolsUtils.fetch(NORMAL_URL).then(({content}) => {
ok(content.contains("The content looks correct."),
ok(content.includes("The content looks correct."),
"The content looks correct.");
});
});