Bug 1442813 - Web console eslint fixes r=nchevobbe

MozReview-Commit-ID: AjhsU2lrqKT

--HG--
extra : rebase_source : a30618ea210524cb2e630e9bccbed6508ff83ebf
This commit is contained in:
Michael Ratcliffe 2018-03-03 00:34:35 +00:00
parent dc83850d63
commit c8711eda63
168 changed files with 412 additions and 180 deletions

View file

@ -142,7 +142,7 @@ devtools/client/storage/test/*.html
!devtools/client/storage/test/storage-unsecured-iframe-usercontextid.html
devtools/client/webaudioeditor/**
devtools/client/webconsole/net/**
devtools/client/webconsole/new-console-output/test/mochitest/**
!devtools/client/webconsole/new-console-output/test/mochitest/**
devtools/client/webconsole/test/**
devtools/client/webconsole/webconsole-connection-proxy.js
devtools/client/webconsole/webconsole.js

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that exceptions from scripts loaded with the addon-sdk loader are
// opened correctly in View Source from the Browser Console.
// See bug 866950.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that console.clear() does not clear the output of the browser console.
"use strict";

View file

@ -6,7 +6,7 @@
// Check that we display the expected context menu entries.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html";
"new-console-output/test/mochitest/test-console.html";
add_task(async function () {
// Enable net messages in the console for this test.
@ -64,6 +64,6 @@ function getSimplifiedContextMenu(popupElement) {
.map(entry => {
const key = entry.getAttribute("accesskey");
const disabled = entry.hasAttribute("disabled");
return `#${entry.id} (${key})${disabled ? " [disabled]": ""}`
return `#${entry.id} (${key})${disabled ? " [disabled]" : ""}`;
});
}

View file

@ -6,10 +6,9 @@
"use strict";
const TEST_URI = `data:text/html,<meta charset=utf8>console API calls`;
const TEST_URI = `data:text/html,<meta charset=utf8>console API calls`
add_task(async function() {
add_task(async function () {
await addTab(TEST_URI);
const hud = await HUDService.toggleBrowserConsole();

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Bug 874061: test for how the browser and web consoles display messages coming
// from private windows. See bug for description of expected behavior.
@ -24,8 +26,9 @@ function test() {
start();
function start() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "data:text/html;charset=utf8," +
"<p>hello world! I am not private!");
gBrowser.selectedTab =
BrowserTestUtils.addTab(gBrowser, "data:text/html;charset=utf8," +
"<p>hello world! I am not private!");
gBrowser.selectedBrowser.addEventListener("load", onLoadTab, true);
}

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the autocomplete input is being blurred and focused when selecting a value.
// This will help screen-readers notify users of the value that was set in the input.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that user input that is not submitted in the command line input is not
// lost after navigating in history.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=817834

View file

@ -19,9 +19,7 @@ add_task(async function () {
let { jsterm } = await openNewTabAndConsole(TEST_URI);
const {
autocompletePopup: popup,
completeNode,
inputNode,
autocompletePopup: popup
} = jsterm;
let onPopUpOpen = popup.once("popup-opened");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the cached autocomplete results are used when the new
// user input is a subset of the existing completion results.

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that autocomplete doesn't break when trying to reach into objects from
// a different domain. See Bug 989025.

View file

@ -29,7 +29,6 @@ add_task(async function () {
const {
autocompletePopup: popup,
completeNode,
inputNode,
} = jsterm;
let onPopUpOpen = popup.once("popup-opened");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that, when the user types an extraneous closing bracket, no error
// appears. See Bug 592442.
@ -17,6 +19,6 @@ add_task(async function () {
await jstermSetValueAndComplete(jsterm, "document.getElementById)");
ok(true, "no error was thrown when an extraneous bracket was inserted");
} catch (ex) {
ok(false, "an error was thrown when an extraneous bracket was inserted")
ok(false, "an error was thrown when an extraneous bracket was inserted");
}
});

View file

@ -3,12 +3,13 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the autocompletion results contain the names of JSTerm helpers.
// See Bug 686937.
"use strict";
const TEST_URI = "data:text/html;charset=utf8,<p>test JSTerm Helpers autocomplete";
add_task(async function () {
@ -34,4 +35,4 @@ function complete(jsterm) {
function getPopupItemsLabel(popup) {
return popup.getItems().map(item => item.label);
}
}

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that code completion works properly in chrome tabs, like about:config.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that makes sure web console autocomplete happens in the user-selected
// stackframe from the js debugger.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that native getters (e.g. document.body) autocompletes in the web console.
// See Bug 651501.

View file

@ -31,7 +31,6 @@ add_task(async function () {
const {
autocompletePopup: popup,
completeNode,
inputNode,
} = jsterm;
ok(!popup.isOpen, "popup is not open");

View file

@ -34,7 +34,6 @@ add_task(async function () {
const {
autocompletePopup: popup,
completeNode,
inputNode,
} = jsterm;
let onPopUpOpen = popup.once("popup-opened");

View file

@ -21,7 +21,6 @@ add_task(async function () {
const {
autocompletePopup: popup,
completeNode,
inputNode,
} = jsterm;
const onPopUpOpen = popup.once("popup-opened");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that code completion works properly.
"use strict";
@ -27,7 +29,8 @@ add_task(async function () {
// Test typing 'window.Ob' and press tab. Just 'window.O' is
// ambiguous: could be window.Object, window.Option, etc.
await jstermSetValueAndComplete(jsterm, "window.Ob", undefined, jsterm.COMPLETE_FORWARD);
await jstermSetValueAndComplete(jsterm, "window.Ob", undefined,
jsterm.COMPLETE_FORWARD);
is(input.value, "window.Object", "'window.Ob' tab completion");
// Test typing 'document.getElem'.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the `copy` console helper works as intended.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Map Control + A to Select All, In the web console input
/* import-globals-from head.js */

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test navigation of webconsole contents via ctrl-a, ctrl-e, ctrl-p, ctrl-n
// see https://bugzilla.mozilla.org/show_bug.cgi?id=804845
//

View file

@ -23,7 +23,7 @@ add_task(async function () {
let title = ErrorDocs.GetURL({ errorMessageName }).split("?")[0];
jsterm.clearOutput();
const onMessage = waitForMessage(hud, "RangeError:")
const onMessage = waitForMessage(hud, "RangeError:");
jsterm.execute(expression);
const {node} = await onMessage;
const learnMoreLink = node.querySelector(".learn-more-link");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests the console history feature accessed via the up and down arrow keys.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that console command input is persisted across toolbox loads.
// See Bug 943306.
@ -14,7 +16,7 @@ const TEST_URI = "data:text/html;charset=utf-8,Web Console test for " +
"persisting history - bug 943306";
const INPUT_HISTORY_COUNT = 10;
add_task(async function() {
add_task(async function () {
info("Setting custom input history pref to " + INPUT_HISTORY_COUNT);
Services.prefs.setIntPref("devtools.webconsole.inputHistoryCount", INPUT_HISTORY_COUNT);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that the inspect() jsterm helper function works.
"use strict";

View file

@ -9,7 +9,7 @@
const TEST_URI = "data:text/html,Testing jsterm with no input";
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
testCompletion(hud);
});

View file

@ -9,7 +9,7 @@
const TEST_URI = "data:text/html,Testing jsterm focus";
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
let jsterm = hud.jsterm;
let input = jsterm.inputNode;

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the autocomplete popup closes on switching tabs. See bug 900448.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// The test loads a web page with mixed active and display content
// on it while the "block mixed content" settings are _off_.
// It then checks that the loading mixed content warning messages
@ -14,9 +16,10 @@
"use strict";
const TEST_URI = "https://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-mixedcontent-securityerrors.html";
const LEARN_MORE_URI =
"https://developer.mozilla.org/docs/Web/Security/Mixed_content" + DOCS_GA_PARAMS;
"new-console-output/test/mochitest/" +
"test-mixedcontent-securityerrors.html";
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
"Mixed_content" + DOCS_GA_PARAMS;
add_task(async function () {
await Promise.all([
@ -47,7 +50,7 @@ add_task(async function () {
const checkLink = ({ link, where, expectedLink, expectedTab }) => {
is(link, expectedLink, `Clicking the provided link opens ${link}`);
is(where, expectedTab, `Clicking the provided link opens in expected tab`);
}
};
info("Clicking on the Learn More link");
const learnMoreLink = mixedActiveContentMessage.querySelector(".learn-more-link");

View file

@ -7,10 +7,11 @@
// Check adding console calls as batch keep the order of the message.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-batching.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-batching.html";
const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
const messageNumber = 100;
await testSimpleBatchLogging(hud, messageNumber);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// The test loads a web page with mixed active and display content
// on it while the "block mixed content" settings are _on_.
// It then checks that the blocked mixed content warning messages
@ -17,9 +19,10 @@
"use strict";
const TEST_URI = "https://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-mixedcontent-securityerrors.html";
const LEARN_MORE_URI =
"https://developer.mozilla.org/docs/Web/Security/Mixed_content" + DOCS_GA_PARAMS;
"new-console-output/test/mochitest/" +
"test-mixedcontent-securityerrors.html";
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
"Mixed_content" + DOCS_GA_PARAMS;
const blockedActiveContentText = "Blocked loading mixed active content " +
"\u201chttp://example.com/\u201d";
@ -28,9 +31,10 @@ const blockedDisplayContentText = "Blocked loading mixed display content " +
const activeContentText = "Loading mixed (insecure) active content " +
"\u201chttp://example.com/\u201d on a secure page";
const displayContentText = "Loading mixed (insecure) display content " +
"\u201chttp://example.com/tests/image/test/mochitest/blue.png\u201d on a secure page";
"\u201chttp://example.com/tests/image/test/mochitest/blue.png\u201d on a " +
"secure page";
add_task(async function() {
add_task(async function () {
await pushPrefEnv();
const hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,15 +3,18 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test to see if the cached messages are displayed when the console UI is
// opened.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-webconsole-error-observer.html";
"new-console-output/test/mochitest/" +
"test-webconsole-error-observer.html";
add_task(async function() {
add_task(async function () {
// On e10s, the exception is triggered in child process
// and is ignored by test harness
if (!Services.appinfo.browserTabsRemoteAutostart) {

View file

@ -3,12 +3,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the cd() jsterm helper function works as expected. See bug 609872.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-cd-iframe-parent.html";
"new-console-output/test/mochitest/test-cd-iframe-parent.html";
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate)
"use strict";
@ -15,9 +17,6 @@ const SHA1_URL = "https://sha1ee.example.com" + TEST_URI_PATH;
const SHA256_URL = "https://sha256ee.example.com" + TEST_URI_PATH;
const TRIGGER_MSG = "If you haven't seen ssl warnings yet, you won't";
const cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
@ -41,5 +40,5 @@ add_task(async function () {
ok(!textContent.includes("SSL 3.0"), "There is no warning message for SSL 3.0");
ok(!textContent.includes("RC4"), "There is no warning message for RC4");
cache.clear();
Services.cache2.clear();
});

View file

@ -3,12 +3,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that clicking on a function displays its source in the debugger. See Bug 1050691.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-click-function-to-source.html";
"new-console-output/test/mochitest/" +
"test-click-function-to-source.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
pushPref("devtools.debugger.new-debugger-frontend", false);
@ -20,16 +23,16 @@ add_task(async function () {
const {panel} = await openDebugger();
let panelWin = panel.panelWin;
info("And right after come back to the Console panel.")
info("And right after come back to the Console panel.");
await openConsole();
info("Log a function");
const onLoggedFunction = waitForMessage(hud, "function foo")
const onLoggedFunction = waitForMessage(hud, "function foo");
ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
content.wrappedJSObject.foo();
});
const {node} = await onLoggedFunction;
const jumpIcon = node.querySelector(".jump-definition")
const jumpIcon = node.querySelector(".jump-definition");
ok(jumpIcon, "A jump to definition button is rendered, as expected");
info("Click on the jump to definition button.");
@ -40,5 +43,6 @@ add_task(async function () {
const {editor} = panelWin.DebuggerView;
const {line, ch} = editor.getCursor();
// Source editor starts counting line and column numbers from 0.
ok(line === 6 && ch === 0, "Debugger is open at the expected position");
is(line, 8, "Debugger is open at the expected line");
is(ch, 0, "Debugger is open at the expected character");
});

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// When strings containing URLs are entered into the webconsole,
// ensure that the output can be clicked to open those URLs.
// This test only check that clicking on a link works as expected,

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the sidebar is hidden for all methods of closing it.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests to ensure that errors don't appear when the console is closed while a
// completion is being performed. See Bug 580001.

View file

@ -38,7 +38,8 @@ function test() {
let deferred = defer();
fetchScopes(hud, toolbox, panelWin, deferred);
ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
// eslint-disable-next-line
ContentTask.spawn(gBrowser.selectedBrowser, {}, () => {
let button = content.document.querySelector("button");
ok(button, "button element found");
button.click();

View file

@ -17,7 +17,7 @@ add_task(async function () {
await waitFor(() => findMessage(hud, loggedString));
ok(true, "The initial message is displayed in the console");
// Create a promise for the message logged after the reload.
const onMessage = waitForMessage(hud, loggedString)
const onMessage = waitForMessage(hud, loggedString);
BrowserReload();
await onMessage;
ok(true, "The message is also displayed after a page reload");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Make sure that the Web Console output does not break after we try to call
// console.dir() for objects that are not inspectable.

View file

@ -8,8 +8,10 @@
// Check console.group, console.groupCollapsed and console.groupEnd calls
// behave as expected.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console-group.html";
const { INDENT_WIDTH } = require("devtools/client/webconsole/new-console-output/components/MessageIndent");
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console-group.html";
const { INDENT_WIDTH } =
require("devtools/client/webconsole/new-console-output/components/MessageIndent");
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
@ -30,8 +32,8 @@ add_task(async function () {
node,
store,
shouldBeOpen: true,
visibleMessageIdsAfterExpand: ["1","2","3","4","6","8","9","12"],
visibleMessageIdsAfterCollapse: ["1","8","9","12"],
visibleMessageIdsAfterExpand: ["1", "2", "3", "4", "6", "8", "9", "12"],
visibleMessageIdsAfterCollapse: ["1", "8", "9", "12"],
});
info("Test a message in a 1 level deep group");
@ -47,8 +49,8 @@ add_task(async function () {
node,
store,
shouldBeOpen: true,
visibleMessageIdsAfterExpand: ["1","2","3","4","6","8","9","12"],
visibleMessageIdsAfterCollapse: ["1","2","3","6","8","9","12"],
visibleMessageIdsAfterExpand: ["1", "2", "3", "4", "6", "8", "9", "12"],
visibleMessageIdsAfterCollapse: ["1", "2", "3", "6", "8", "9", "12"],
});
info("Test a message in a 2 level deep group");
@ -74,8 +76,8 @@ add_task(async function () {
node,
store,
shouldBeOpen: false,
visibleMessageIdsAfterExpand: ["1","2","3","4","6","8","9","10","12"],
visibleMessageIdsAfterCollapse: ["1","2","3","4","6","8","9","12"]
visibleMessageIdsAfterExpand: ["1", "2", "3", "4", "6", "8", "9", "10", "12"],
visibleMessageIdsAfterCollapse: ["1", "2", "3", "4", "6", "8", "9", "12"]
});
info("Test a message at root level, after closing a collapsed group");
@ -104,23 +106,23 @@ async function testGroupToggle({
visibleMessageIdsAfterCollapse
}) {
let toggleArrow = node.querySelector(".theme-twisty");
const isOpen = node => node.classList.contains("open");
const isOpen = node2 => node2.classList.contains("open");
const assertVisibleMessageIds = (expanded) => {
let visibleMessageIds = store.getState().messages.visibleMessages;
expanded ? is(visibleMessageIds.toString(), visibleMessageIdsAfterExpand.toString()) :
is(visibleMessageIds.toString(), visibleMessageIdsAfterCollapse.toString());
}
};
await waitFor(() => isOpen(node) === shouldBeOpen)
await waitFor(() => isOpen(node) === shouldBeOpen);
assertVisibleMessageIds(shouldBeOpen);
toggleArrow.click();
shouldBeOpen = !shouldBeOpen;
await waitFor(() => isOpen(node) === shouldBeOpen)
await waitFor(() => isOpen(node) === shouldBeOpen);
assertVisibleMessageIds(shouldBeOpen);
toggleArrow.click();
shouldBeOpen = !shouldBeOpen;
await waitFor(() => isOpen(node) === shouldBeOpen)
await waitFor(() => isOpen(node) === shouldBeOpen);
assertVisibleMessageIds(shouldBeOpen);
}
}

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the basic console.log()-style APIs and filtering work for
// sharedWorkers

View file

@ -8,7 +8,8 @@
// Check console.table calls with all the test cases shown
// in the MDN doc (https://developer.mozilla.org/en-US/docs/Web/API/Console/table)
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console-table.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console-table.html";
add_task(function* () {
let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole");

View file

@ -25,27 +25,27 @@ add_task(async function testTraceMessages() {
variable: "console.trace()",
repeats: 3,
filename: "test-console-trace-duplicates.html",
line: 23,
line: 24,
column: 3,
stack: [{
functionName: "foo3",
filename: TEST_URI,
line: 23,
line: 24,
column: 3
}, {
functionName: "foo2",
filename: TEST_URI,
line: 19,
line: 20,
column: 3
}, {
functionName: "foo1",
filename: TEST_URI,
line: 11,
line: 12,
column: 3
}, {
functionName: "<anonymous>",
filename: TEST_URI,
line: 26,
line: 27,
column: 1
}]
});

View file

@ -28,7 +28,7 @@ const TEST_URI = `data:text/html;charset=utf-8,<script>
// Test the Copy menu item of the webconsole copies the expected clipboard text for
// different log messages.
add_task(async function() {
add_task(async function () {
let observer = new PrefObserver("");
let onPrefUpdated = observer.once(PREF_MESSAGE_TIMESTAMP, () => {});
Services.prefs.setBoolPref(PREF_MESSAGE_TIMESTAMP, true);

View file

@ -3,16 +3,19 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test the Copy Link Location menu item of the webconsole is displayed for network
// messages and copies the expected URL.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html?_date=" + Date.now();
"new-console-output/test/mochitest/test-console.html?_date=" +
Date.now();
const CONTEXT_MENU_ID = "#console-menu-copy-url";
add_task(async function() {
add_task(async function () {
// Enable net messages in the console for this test.
await pushPref("devtools.webconsole.filter.net", true);

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test the "Copy object" menu item of the webconsole is enabled only when
// clicking on messages that are associated with an object actor.
@ -22,7 +24,7 @@ const TEST_URI = `data:text/html;charset=utf-8,<script>
</script>`;
const copyObjectMenuItemId = "#console-menu-copy-object";
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
let [msgWithText, msgWithObj, msgNested] =

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the "Open in sidebar" context menu entry is active for
// the correct objects and opens the sidebar when clicked.

View file

@ -3,15 +3,17 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the Open URL in new Tab menu item is displayed for network logs and works as
// expected.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html";
"new-console-output/test/mochitest/test-console.html";
add_task(async function() {
add_task(async function () {
// Enable net messages in the console for this test.
await pushPref("devtools.webconsole.filter.net", true);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test the "Store as global variable" menu item of the webconsole is enabled only when
// clicking on messages that are associated with an object actor.
@ -20,7 +22,7 @@ const TEST_URI = `data:text/html;charset=utf-8,<script>
console.log("foo", window.symbol);
</script>`;
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
let messages = await waitFor(() => findMessages(hud, "foo"));
@ -57,7 +59,8 @@ add_task(async function() {
content.console.log("foo", obj);
});
let msgInvisible = (await onMessageInvisible).node;
await storeAsVariable(hud, msgInvisible, "object", varIdx++, "window.invisibleToDebugger");
await storeAsVariable(hud, msgInvisible, "object", varIdx++,
"window.invisibleToDebugger");
});
async function storeAsVariable(hud, msg, type, varIdx, equalTo) {

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that a file with an unsupported CSP directive ('reflected-xss filter')
// displays the appropriate message to the console. See Bug 1045902.
@ -10,16 +12,13 @@
const EXPECTED_RESULT = "Not supporting directive \u2018reflected-xss\u2019. " +
"Directive and values will be ignored.";
const TEST_FILE =
"http://example.com/browser/devtools/client/webconsole/new-console-output/test/" +
"mochitest/test_console_csp_ignore_reflected_xss_message.html";
const TEST_FILE = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/" +
"test_console_csp_ignore_reflected_xss_message.html";
const TEST_URI =
"data:text/html;charset=utf8,Web Console CSP ignoring reflected XSS (bug 1045902)";
const cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
await loadDocument(TEST_FILE);
@ -27,5 +26,5 @@ add_task(async function () {
await waitFor(() => findMessage(hud, EXPECTED_RESULT, ".message.warn"));
ok(true, `CSP logs displayed in console when using "reflected-xss" directive`);
cache.clear();
Services.cache2.clear();
});

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the Web Console CSP messages for two META policies
// are correctly displayed. See Bug 1247459.

View file

@ -16,9 +16,7 @@ add_task(async function () {
info("Closing console");
await closeConsole();
const isFocused = await ContentTask.spawn(gBrowser.selectedBrowser, { }, function () {
const cmp = "@mozilla.org/focus-manager;1";
const fm = Cc[cmp].getService(Ci.nsIFocusManager);
return fm.focusedWindow == content;
return Services.focus.focusedWindow == content;
});
ok(isFocused, "content document has focus after closing the console");
});

View file

@ -1,14 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that exceptions thrown by content don't show up twice in the Web
// Console. See Bug 582201.
"use strict";
const INIT_URI = "data:text/html;charset=utf8,hello world";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-duplicate-error.html";
"new-console-output/test/mochitest/test-duplicate-error.html";
add_task(async function () {
// On e10s, the exception is triggered in child process
@ -23,5 +24,5 @@ add_task(async function () {
const errorMessages = hud.outputNode.querySelectorAll(".message.error");
is(errorMessages.length, 1, "There's only one error message for fooDuplicateError1");
is(errorMessages[0].querySelector(".message-repeats"), null,
"There is no repeat bubble on the error message")
"There is no repeat bubble on the error message");
});

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that errors still show up in the Web Console after a page reload.
// See bug 580030: the error handler fails silently after page reload.
// https://bugzilla.mozilla.org/show_bug.cgi?id=580030

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that makes sure web console eval happens in the user-selected stackframe
// from the js debugger.
@ -76,7 +78,7 @@ add_task(async function () {
await onResultMessage;
ok(true, "`foo + foo3` updated in `firstCall()`");
await ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
await ContentTask.spawn(gBrowser.selectedBrowser, null, function () {
is(content.wrappedJSObject.foo, "globalFooBug783499", "`foo` in content window");
is(content.wrappedJSObject.foo2, "newFoo", "`foo2` in content window");
ok(!content.wrappedJSObject.foo3, "`foo3` was not added to the content window");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test to make sure that web console commands can fire while paused at a
// breakpoint that was triggered from a JS call. Relies on asynchronous js
// evaluation over the protocol - see Bug 1088861.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that commands run by the user are executed in content space.
"use strict";

View file

@ -8,7 +8,8 @@
// See Bug 597136.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-external-script-errors.html";
"new-console-output/test/mochitest/" +
"test-external-script-errors.html";
add_task(async function () {
// On e10s, the exception is triggered in child process

View file

@ -61,7 +61,6 @@ add_task(async function () {
await onMessagesUnFiltered;
is(outputContainer.scrollTop, 0,
"The console is still scrolled to the top after clearing the filter");
});
function hasVerticalOverflow(container) {

View file

@ -9,7 +9,8 @@
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console-filters.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console-filters.html";
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,13 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests all filters persist.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console-filters.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console-filters.html";
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
let filterButtons = await getFilterButtons(hud);

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the $0 console helper works as intended. See Bug 653531.
"use strict";

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that errors about invalid HPKP security headers are logged to the web console.
"use strict";
@ -8,8 +10,8 @@
const TEST_URI = "data:text/html;charset=utf-8,Web Console HPKP invalid header test";
const SJS_URL = "https://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test_hpkp-invalid-headers.sjs";
const LEARN_MORE_URI =
"https://developer.mozilla.org/docs/Web/HTTP/Public_Key_Pinning" + DOCS_GA_PARAMS;
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/HTTP/" +
"Public_Key_Pinning" + DOCS_GA_PARAMS;
const NON_BUILTIN_ROOT_PREF =
"security.cert_pinning.process_headers_from_non_builtin_roots";

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that errors about invalid HSTS security headers are logged to the web console.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that warnings about ineffective iframe sandboxing are logged to the
// web console when necessary (and not otherwise). See Bug 752559.
@ -47,5 +49,5 @@ async function testWarningMessageVisibility(uri, visible) {
const warning = findMessage(hud, INEFFECTIVE_IFRAME_SANDBOXING_MSG, ".message.warn");
is(!!warning, visible,
`The warning message is${visible ? "": " not"} visible on ${uri}`);
`The warning message is${visible ? "" : " not"} visible on ${uri}`);
}

View file

@ -5,7 +5,8 @@
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html";
add_task(function* () {
let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the JS input field is focused when the user switches back to the
// web console from other tools, see bug 891581.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the input field is focused when the console is opened.
"use strict";
@ -13,7 +15,7 @@ const TEST_URI =
console.log("console message 1");
</script>`;
add_task(async function() {
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
let inputNode = hud.jsterm.inputNode;
@ -24,7 +26,7 @@ add_task(async function() {
ok(hasFocus(inputNode), "input node is focused after output is cleared");
info("Focus during message logging");
ContentTask.spawn(gBrowser.selectedBrowser, {}, function() {
ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
content.wrappedJSObject.console.log("console message 2");
});
let msg = await waitFor(() => findMessage(hud, "console message 2"));

View file

@ -3,14 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that errors about insecure passwords are logged to the web console.
// See Bug 762593.
"use strict";
const TEST_URI =
"http://example.com/browser/devtools/client/webconsole/new-console-output/test/" +
"mochitest/test-insecure-passwords-about-blank-web-console-warning.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/" +
"test-insecure-passwords-about-blank-web-console-warning.html";
const INSECURE_PASSWORD_MSG = "Password fields present on an insecure (http://) iframe." +
" This is a security risk that allows user login credentials to be stolen.";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that users can inspect objects logged from cross-domain iframes -
// bug 869003.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that basic keyboard shortcuts work in the web console.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that message source links for js errors and console API calls open in
// the jsdebugger when clicked.
@ -10,9 +12,9 @@
requestLongerTimeout(2);
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-location-debugger-link.html";
"new-console-output/test/mochitest/test-location-debugger-link.html";
add_task(async function() {
add_task(async function () {
// Force the new debugger UI, in case this gets uplifted with the old
// debugger still turned on
await pushPref("devtools.debugger.new-debugger-frontend", true);

View file

@ -5,7 +5,9 @@
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-location-styleeditor-link.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/" +
"test-location-styleeditor-link.html";
add_task(async function () {
await pushPref("devtools.webconsole.filter.css", true);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that long strings can be expanded in the console output.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the Web Console doesn't leak when multiple tabs and windows are
// opened and then closed. See Bug 595350.

View file

@ -4,7 +4,8 @@
"use strict";
const TEST_FILE = "test-network-request.html";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/";
const TEST_URI = TEST_PATH + TEST_FILE;
add_task(async function task() {

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that we report JS exceptions in event handlers coming from
// network requests, like onreadystate for XHR. See bug 618078.

View file

@ -4,7 +4,8 @@
"use strict";
const TEST_FILE = "test-network-request.html";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/";
const TEST_URI = TEST_PATH + TEST_FILE;
const NET_PREF = "devtools.webconsole.filter.net";

View file

@ -8,7 +8,8 @@ const TEST_URI = "data:text/html;charset=utf8,Test that 'Open in Network Panel'
const TEST_FILE = "test-network-request.html";
const JSON_TEST_URL = "test-network-request.html";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/";
const NET_PREF = "devtools.webconsole.filter.net";
const XHR_PREF = "devtools.webconsole.filter.netxhr";

View file

@ -4,7 +4,8 @@
"use strict";
const TEST_FILE = "test-network-request.html";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/";
const TEST_PATH = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/";
const TEST_URI = TEST_PATH + TEST_FILE;
const NET_PREF = "devtools.webconsole.filter.net";
@ -34,7 +35,6 @@ add_task(async function task() {
let xhrUrl = TEST_PATH + "test-data.json";
let messageNode = await waitFor(() => findMessage(hud, xhrUrl));
let urlNode = messageNode.querySelector(".url");
let statusCodeNode = messageNode.querySelector(".status-code");
info("Network message found.");
@ -56,8 +56,10 @@ add_task(async function task() {
for (let testCase of testCases) {
const { clickEvent } = testCase;
let onConsoleMenuOpened = [rightClickMouseEvent, rightClickCtrlOrCmdKeyMouseEvent].includes(clickEvent) ?
hud.ui.newConsoleOutput.once("menu-open") : null;
let onConsoleMenuOpened = [
rightClickMouseEvent,
rightClickCtrlOrCmdKeyMouseEvent
].includes(clickEvent) ? hud.ui.newConsoleOutput.once("menu-open") : null;
let { link, where } = await simulateLinkClick(statusCodeNode, testCase.clickEvent);
is(link, testCase.link, `Clicking the provided link opens ${link}`);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that network requests from chrome don't cause the Web Console to
// throw exceptions. See Bug 597136.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that network log messages bring up the network panel and select the
// right request even if it was previously filtered off.

View file

@ -21,7 +21,7 @@ const HTML = `
`;
const TEST_URI = "data:text/html;charset=utf-8," + encodeURI(HTML);
add_task(async function() {
add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI);
const toolbox = gDevTools.getToolbox(hud.target);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the ObjectInspector is rendered correctly in the sidebar.
"use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that makes sure web console eval works while the js debugger paused the
// page, and while the inspector is active. See bug 886137.

View file

@ -3,13 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that inspecting an optimized out variable works when execution is
// paused.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-closure-optimized-out.html";
"new-console-output/test/mochitest/" +
"test-closure-optimized-out.html";
add_task(async function () {
// Force the old debugger UI since it's directly used (see Bug 1301705)

View file

@ -10,7 +10,7 @@
// Test that multiple messages are copied into the clipboard and that they are
// separated by new lines. See bug 916997.
const TEST_URI = "data:text/html,<meta charset=utf8>" +
"Test copy multiple messages to clipboard";
"Test copy multiple messages to clipboard";
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that any output created from calls to the console API comes before the
// echoed JavaScript.

View file

@ -3,11 +3,14 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that message persistence works - bug 705921 / bug 1307881
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console.html";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-console.html";
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.webconsole.persistlog");

View file

@ -5,15 +5,15 @@
"use strict";
// See Bug 597756. Check that errors are still displayed in the console after reloading a
// page.
// See Bug 597756. Check that errors are still displayed in the console after
// reloading a page.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/test-reopen-closed-tab.html";
add_task(async function () {
// If we persist log, the test might be successful even if only the first error log is
// shown
// If we persist log, the test might be successful even if only the first
// error log is shown.
pushPref("devtools.webconsole.persistlog", false);
info("Open console and refresh tab.");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that makes sure messages are not considered repeated when console.log()
// is invoked with different objects, see bug 865288.
@ -23,7 +25,7 @@ add_task(async function () {
});
ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
for (var i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
const o = { id: "abba" };
content.console.log("abba", o);
}

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests if the JSTerm sandbox is updated when the user navigates from one
// domain to another, in order to avoid permission denied errors with a sandbox
// created for a different origin. See Bug 664688.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Ensure non-toplevel security errors are displayed
"use strict";

View file

@ -27,7 +27,7 @@ const PAGE_URL = `data:text/html,
</html>`;
add_task(async function() {
add_task(async function () {
await pushPref("devtools.source-map.client-service.enabled", true);
await pushPref("devtools.webconsole.filter.css", true);

View file

@ -7,7 +7,8 @@
// Test that a missing source map is reported.
const BASE = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/";
const BASE = "http://example.com/browser/devtools/client/webconsole/" +
"new-console-output/test/mochitest/";
add_task(async function () {
for (let test of ["test-sourcemap-error-01.html", "test-sourcemap-error-02.html"]) {

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