--- a/devtools/client/webconsole/test/mochitest/browser_webconsole_context_menu_copy_entire_message.js
+++ b/devtools/client/webconsole/test/mochitest/browser_webconsole_context_menu_copy_entire_message.js
@@ -12,17 +12,17 @@ const LOG_FORMAT_WITH_TIMESTAMP = /^[\d:
const LOG_FORMAT_WITHOUT_TIMESTAMP = /^.+ (\d+ )?.+:\d+$/;
// RegExp that validates copied text for stacktrace lines.
const TRACE_FORMAT = /^\t.+ .+:\d+:\d+$/;
const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
const TEST_URI = `data:text/html;charset=utf-8,<script>
window.logStuff = function () {
- console.log("simple text message");
+ console.log("simple " + "text message");
function wrapper() {
console.trace();
}
wrapper();
};
</script>`;
// Test the Copy menu item of the webconsole copies the expected clipboard text for
@@ -44,29 +44,29 @@ add_task(async function() {
info("Test copy menu item for the simple log");
let message = await waitFor(() => findMessage(hud, "simple text message"));
let clipboardText = await copyMessageContent(hud, message);
ok(true, "Clipboard text was found and saved");
info("Check copied text for simple log message");
let lines = clipboardText.split("\n");
- ok(lines.length, 2, "There are 2 lines in the copied text");
+ is(lines.length, 2, "There are 2 lines in the copied text");
is(lines[1], "", "The last line is an empty new line");
ok(LOG_FORMAT_WITH_TIMESTAMP.test(lines[0]),
"Log line has the right format:\n" + lines[0]);
info("Test copy menu item for the stack trace message");
message = await waitFor(() => findMessage(hud, "console.trace"));
clipboardText = await copyMessageContent(hud, message);
ok(true, "Clipboard text was found and saved");
info("Check copied text for stack trace message");
lines = clipboardText.split("\n");
- ok(lines.length, 4, "There are 4 lines in the copied text");
+ is(lines.length, 4, "There are 4 lines in the copied text");
is(lines[3], "", "The last line is an empty new line");
ok(LOG_FORMAT_WITH_TIMESTAMP.test(lines[0]),
"Log line has the right format:\n" + lines[0]);
ok(TRACE_FORMAT.test(lines[1]), "Stacktrace line has the right format:\n" + lines[1]);
ok(TRACE_FORMAT.test(lines[2]), "Stacktrace line has the right format:\n" + lines[2]);
info("Test copy menu item without timestamp");
@@ -76,29 +76,29 @@ add_task(async function() {
info("Test copy menu item for the simple log");
message = await waitFor(() => findMessage(hud, "simple text message"));
clipboardText = await copyMessageContent(hud, message);
ok(true, "Clipboard text was found and saved");
info("Check copied text for simple log message");
lines = clipboardText.split("\n");
- ok(lines.length, 2, "There are 2 lines in the copied text");
+ is(lines.length, 2, "There are 2 lines in the copied text");
is(lines[1], "", "The last line is an empty new line");
ok(LOG_FORMAT_WITHOUT_TIMESTAMP.test(lines[0]),
"Log line has the right format:\n" + lines[0]);
info("Test copy menu item for the stack trace message");
message = await waitFor(() => findMessage(hud, "console.trace"));
clipboardText = await copyMessageContent(hud, message);
ok(true, "Clipboard text was found and saved");
info("Check copied text for stack trace message");
lines = clipboardText.split("\n");
- ok(lines.length, 4, "There are 4 lines in the copied text");
+ is(lines.length, 4, "There are 4 lines in the copied text");
is(lines[3], "", "The last line is an empty new line");
ok(LOG_FORMAT_WITHOUT_TIMESTAMP.test(lines[0]),
"Log line has the right format:\n" + lines[0]);
ok(TRACE_FORMAT.test(lines[1]), "Stacktrace line has the right format:\n" + lines[1]);
ok(TRACE_FORMAT.test(lines[2]), "Stacktrace line has the right format:\n" + lines[2]);
observer.destroy();
Services.prefs.clearUserPref(PREF_MESSAGE_TIMESTAMP);