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/storage/test/storage-unsecured-iframe-usercontextid.html
devtools/client/webaudioeditor/** devtools/client/webaudioeditor/**
devtools/client/webconsole/net/** 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/test/**
devtools/client/webconsole/webconsole-connection-proxy.js devtools/client/webconsole/webconsole-connection-proxy.js
devtools/client/webconsole/webconsole.js devtools/client/webconsole/webconsole.js

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Check that console.clear() does not clear the output of the browser console.
"use strict"; "use strict";

View file

@ -6,7 +6,7 @@
// Check that we display the expected context menu entries. // Check that we display the expected context menu entries.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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. // Enable net messages in the console for this test.
@ -64,6 +64,6 @@ function getSimplifiedContextMenu(popupElement) {
.map(entry => { .map(entry => {
const key = entry.getAttribute("accesskey"); const key = entry.getAttribute("accesskey");
const disabled = entry.hasAttribute("disabled"); 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"; "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); await addTab(TEST_URI);
const hud = await HUDService.toggleBrowserConsole(); const hud = await HUDService.toggleBrowserConsole();

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // 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. // 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test that user input that is not submitted in the command line input is not
// lost after navigating in history. // lost after navigating in history.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=817834 // 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); let { jsterm } = await openNewTabAndConsole(TEST_URI);
const { const {
autocompletePopup: popup, autocompletePopup: popup
completeNode,
inputNode,
} = jsterm; } = jsterm;
let onPopUpOpen = popup.once("popup-opened"); let onPopUpOpen = popup.once("popup-opened");

View file

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

View file

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

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that, when the user types an extraneous closing bracket, no error // Tests that, when the user types an extraneous closing bracket, no error
// appears. See Bug 592442. // appears. See Bug 592442.
@ -17,6 +19,6 @@ add_task(async function () {
await jstermSetValueAndComplete(jsterm, "document.getElementById)"); await jstermSetValueAndComplete(jsterm, "document.getElementById)");
ok(true, "no error was thrown when an extraneous bracket was inserted"); ok(true, "no error was thrown when an extraneous bracket was inserted");
} catch (ex) { } 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the autocompletion results contain the names of JSTerm helpers. // Tests that the autocompletion results contain the names of JSTerm helpers.
// See Bug 686937. // See Bug 686937.
"use strict"; "use strict";
const TEST_URI = "data:text/html;charset=utf8,<p>test JSTerm Helpers autocomplete"; const TEST_URI = "data:text/html;charset=utf8,<p>test JSTerm Helpers autocomplete";
add_task(async function () { add_task(async function () {
@ -34,4 +35,4 @@ function complete(jsterm) {
function getPopupItemsLabel(popup) { function getPopupItemsLabel(popup) {
return popup.getItems().map(item => item.label); return popup.getItems().map(item => item.label);
} }

View file

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

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Tests that native getters (e.g. document.body) autocompletes in the web console.
// See Bug 651501. // See Bug 651501.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test navigation of webconsole contents via ctrl-a, ctrl-e, ctrl-p, ctrl-n
// see https://bugzilla.mozilla.org/show_bug.cgi?id=804845 // 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]; let title = ErrorDocs.GetURL({ errorMessageName }).split("?")[0];
jsterm.clearOutput(); jsterm.clearOutput();
const onMessage = waitForMessage(hud, "RangeError:") const onMessage = waitForMessage(hud, "RangeError:");
jsterm.execute(expression); jsterm.execute(expression);
const {node} = await onMessage; const {node} = await onMessage;
const learnMoreLink = node.querySelector(".learn-more-link"); const learnMoreLink = node.querySelector(".learn-more-link");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Tests the console history feature accessed via the up and down arrow keys.
"use strict"; "use strict";

View file

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

View file

@ -9,7 +9,7 @@
const TEST_URI = "data:text/html,Testing jsterm with no input"; 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); let hud = await openNewTabAndConsole(TEST_URI);
testCompletion(hud); testCompletion(hud);
}); });

View file

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

View file

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

View file

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

View file

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

View file

@ -3,15 +3,18 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test to see if the cached messages are displayed when the console UI is
// opened. // opened.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 // On e10s, the exception is triggered in child process
// and is ignored by test harness // and is ignored by test harness
if (!Services.appinfo.browserTabsRemoteAutostart) { if (!Services.appinfo.browserTabsRemoteAutostart) {

View file

@ -3,12 +3,14 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Test that the cd() jsterm helper function works as expected. See bug 609872.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 () { add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI); const hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate) // Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate)
"use strict"; "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 SHA256_URL = "https://sha256ee.example.com" + TEST_URI_PATH;
const TRIGGER_MSG = "If you haven't seen ssl warnings yet, you won't"; 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 () { add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI); 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("SSL 3.0"), "There is no warning message for SSL 3.0");
ok(!textContent.includes("RC4"), "There is no warning message for RC4"); 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Tests that clicking on a function displays its source in the debugger. See Bug 1050691.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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) // Force the old debugger UI since it's directly used (see Bug 1301705)
pushPref("devtools.debugger.new-debugger-frontend", false); pushPref("devtools.debugger.new-debugger-frontend", false);
@ -20,16 +23,16 @@ add_task(async function () {
const {panel} = await openDebugger(); const {panel} = await openDebugger();
let panelWin = panel.panelWin; 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(); await openConsole();
info("Log a function"); info("Log a function");
const onLoggedFunction = waitForMessage(hud, "function foo") const onLoggedFunction = waitForMessage(hud, "function foo");
ContentTask.spawn(gBrowser.selectedBrowser, {}, function () { ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
content.wrappedJSObject.foo(); content.wrappedJSObject.foo();
}); });
const {node} = await onLoggedFunction; 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"); ok(jumpIcon, "A jump to definition button is rendered, as expected");
info("Click on the jump to definition button."); info("Click on the jump to definition button.");
@ -40,5 +43,6 @@ add_task(async function () {
const {editor} = panelWin.DebuggerView; const {editor} = panelWin.DebuggerView;
const {line, ch} = editor.getCursor(); const {line, ch} = editor.getCursor();
// Source editor starts counting line and column numbers from 0. // 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// When strings containing URLs are entered into the webconsole, // When strings containing URLs are entered into the webconsole,
// ensure that the output can be clicked to open those URLs. // ensure that the output can be clicked to open those URLs.
// This test only check that clicking on a link works as expected, // 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Test that the sidebar is hidden for all methods of closing it. // Test that the sidebar is hidden for all methods of closing it.
"use strict"; "use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests to ensure that errors don't appear when the console is closed while a
// completion is being performed. See Bug 580001. // completion is being performed. See Bug 580001.

View file

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

View file

@ -17,7 +17,7 @@ add_task(async function () {
await waitFor(() => findMessage(hud, loggedString)); await waitFor(() => findMessage(hud, loggedString));
ok(true, "The initial message is displayed in the console"); ok(true, "The initial message is displayed in the console");
// Create a promise for the message logged after the reload. // Create a promise for the message logged after the reload.
const onMessage = waitForMessage(hud, loggedString) const onMessage = waitForMessage(hud, loggedString);
BrowserReload(); BrowserReload();
await onMessage; await onMessage;
ok(true, "The message is also displayed after a page reload"); 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Make sure that the Web Console output does not break after we try to call
// console.dir() for objects that are not inspectable. // console.dir() for objects that are not inspectable.

View file

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

View file

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

View file

@ -8,7 +8,8 @@
// Check console.table calls with all the test cases shown // 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) // 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* () { add_task(function* () {
let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole");

View file

@ -25,27 +25,27 @@ add_task(async function testTraceMessages() {
variable: "console.trace()", variable: "console.trace()",
repeats: 3, repeats: 3,
filename: "test-console-trace-duplicates.html", filename: "test-console-trace-duplicates.html",
line: 23, line: 24,
column: 3, column: 3,
stack: [{ stack: [{
functionName: "foo3", functionName: "foo3",
filename: TEST_URI, filename: TEST_URI,
line: 23, line: 24,
column: 3 column: 3
}, { }, {
functionName: "foo2", functionName: "foo2",
filename: TEST_URI, filename: TEST_URI,
line: 19, line: 20,
column: 3 column: 3
}, { }, {
functionName: "foo1", functionName: "foo1",
filename: TEST_URI, filename: TEST_URI,
line: 11, line: 12,
column: 3 column: 3
}, { }, {
functionName: "<anonymous>", functionName: "<anonymous>",
filename: TEST_URI, filename: TEST_URI,
line: 26, line: 27,
column: 1 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 // Test the Copy menu item of the webconsole copies the expected clipboard text for
// different log messages. // different log messages.
add_task(async function() { add_task(async function () {
let observer = new PrefObserver(""); let observer = new PrefObserver("");
let onPrefUpdated = observer.once(PREF_MESSAGE_TIMESTAMP, () => {}); let onPrefUpdated = observer.once(PREF_MESSAGE_TIMESTAMP, () => {});
Services.prefs.setBoolPref(PREF_MESSAGE_TIMESTAMP, true); Services.prefs.setBoolPref(PREF_MESSAGE_TIMESTAMP, true);

View file

@ -3,16 +3,19 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test the Copy Link Location menu item of the webconsole is displayed for network
// messages and copies the expected URL. // messages and copies the expected URL.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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"; 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. // Enable net messages in the console for this test.
await pushPref("devtools.webconsole.filter.net", true); await pushPref("devtools.webconsole.filter.net", true);

View file

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

View file

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

View file

@ -3,15 +3,17 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test that the Open URL in new Tab menu item is displayed for network logs and works as
// expected. // expected.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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. // Enable net messages in the console for this test.
await pushPref("devtools.webconsole.filter.net", true); await pushPref("devtools.webconsole.filter.net", true);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // 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. // 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); console.log("foo", window.symbol);
</script>`; </script>`;
add_task(async function() { add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI); let hud = await openNewTabAndConsole(TEST_URI);
let messages = await waitFor(() => findMessages(hud, "foo")); let messages = await waitFor(() => findMessages(hud, "foo"));
@ -57,7 +59,8 @@ add_task(async function() {
content.console.log("foo", obj); content.console.log("foo", obj);
}); });
let msgInvisible = (await onMessageInvisible).node; 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) { async function storeAsVariable(hud, msg, type, varIdx, equalTo) {

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that a file with an unsupported CSP directive ('reflected-xss filter') // Tests that a file with an unsupported CSP directive ('reflected-xss filter')
// displays the appropriate message to the console. See Bug 1045902. // displays the appropriate message to the console. See Bug 1045902.
@ -10,16 +12,13 @@
const EXPECTED_RESULT = "Not supporting directive \u2018reflected-xss\u2019. " + const EXPECTED_RESULT = "Not supporting directive \u2018reflected-xss\u2019. " +
"Directive and values will be ignored."; "Directive and values will be ignored.";
const TEST_FILE = const TEST_FILE = "http://example.com/browser/devtools/client/webconsole/" +
"http://example.com/browser/devtools/client/webconsole/new-console-output/test/" + "new-console-output/test/mochitest/" +
"mochitest/test_console_csp_ignore_reflected_xss_message.html"; "test_console_csp_ignore_reflected_xss_message.html";
const TEST_URI = const TEST_URI =
"data:text/html;charset=utf8,Web Console CSP ignoring reflected XSS (bug 1045902)"; "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 () { add_task(async function () {
const hud = await openNewTabAndConsole(TEST_URI); const hud = await openNewTabAndConsole(TEST_URI);
await loadDocument(TEST_FILE); await loadDocument(TEST_FILE);
@ -27,5 +26,5 @@ add_task(async function () {
await waitFor(() => findMessage(hud, EXPECTED_RESULT, ".message.warn")); await waitFor(() => findMessage(hud, EXPECTED_RESULT, ".message.warn"));
ok(true, `CSP logs displayed in console when using "reflected-xss" directive`); 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the Web Console CSP messages for two META policies // Tests that the Web Console CSP messages for two META policies
// are correctly displayed. See Bug 1247459. // are correctly displayed. See Bug 1247459.

View file

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

View file

@ -1,14 +1,15 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests that exceptions thrown by content don't show up twice in the Web
// Console. See Bug 582201. // Console. See Bug 582201.
"use strict"; "use strict";
const INIT_URI = "data:text/html;charset=utf8,hello world";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 () { add_task(async function () {
// On e10s, the exception is triggered in child process // On e10s, the exception is triggered in child process
@ -23,5 +24,5 @@ add_task(async function () {
const errorMessages = hud.outputNode.querySelectorAll(".message.error"); const errorMessages = hud.outputNode.querySelectorAll(".message.error");
is(errorMessages.length, 1, "There's only one error message for fooDuplicateError1"); is(errorMessages.length, 1, "There's only one error message for fooDuplicateError1");
is(errorMessages[0].querySelector(".message-repeats"), null, 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // 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. // See bug 580030: the error handler fails silently after page reload.
// https://bugzilla.mozilla.org/show_bug.cgi?id=580030 // https://bugzilla.mozilla.org/show_bug.cgi?id=580030

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test that makes sure web console eval happens in the user-selected stackframe
// from the js debugger. // from the js debugger.
@ -76,7 +78,7 @@ add_task(async function () {
await onResultMessage; await onResultMessage;
ok(true, "`foo + foo3` updated in `firstCall()`"); 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.foo, "globalFooBug783499", "`foo` in content window");
is(content.wrappedJSObject.foo2, "newFoo", "`foo2` in content window"); is(content.wrappedJSObject.foo2, "newFoo", "`foo2` in content window");
ok(!content.wrappedJSObject.foo3, "`foo3` was not added to the 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // 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 // breakpoint that was triggered from a JS call. Relies on asynchronous js
// evaluation over the protocol - see Bug 1088861. // evaluation over the protocol - see Bug 1088861.

View file

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

View file

@ -8,7 +8,8 @@
// See Bug 597136. // See Bug 597136.
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 () { add_task(async function () {
// On e10s, the exception is triggered in child process // On e10s, the exception is triggered in child process

View file

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

View file

@ -9,7 +9,8 @@
"use strict"; "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 () {
const hud = await openNewTabAndConsole(TEST_URI); const hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,13 +3,16 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests all filters persist. // Tests all filters persist.
"use strict"; "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 hud = await openNewTabAndConsole(TEST_URI);
let filterButtons = await getFilterButtons(hud); let filterButtons = await getFilterButtons(hud);

View file

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

View file

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

View file

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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. // Tests that errors about invalid HSTS security headers are logged to the web console.
"use strict"; "use strict";

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that warnings about ineffective iframe sandboxing are logged to the // Tests that warnings about ineffective iframe sandboxing are logged to the
// web console when necessary (and not otherwise). See Bug 752559. // 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"); const warning = findMessage(hud, INEFFECTIVE_IFRAME_SANDBOXING_MSG, ".message.warn");
is(!!warning, visible, 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"; "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* () { add_task(function* () {
let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole"); let toolbox = yield openNewTabAndToolbox(TEST_URI, "webconsole");

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test that the JS input field is focused when the user switches back to the
// web console from other tools, see bug 891581. // web console from other tools, see bug 891581.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that the input field is focused when the console is opened. // Tests that the input field is focused when the console is opened.
"use strict"; "use strict";
@ -13,7 +15,7 @@ const TEST_URI =
console.log("console message 1"); console.log("console message 1");
</script>`; </script>`;
add_task(async function() { add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI); let hud = await openNewTabAndConsole(TEST_URI);
let inputNode = hud.jsterm.inputNode; let inputNode = hud.jsterm.inputNode;
@ -24,7 +26,7 @@ add_task(async function() {
ok(hasFocus(inputNode), "input node is focused after output is cleared"); ok(hasFocus(inputNode), "input node is focused after output is cleared");
info("Focus during message logging"); info("Focus during message logging");
ContentTask.spawn(gBrowser.selectedBrowser, {}, function() { ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
content.wrappedJSObject.console.log("console message 2"); content.wrappedJSObject.console.log("console message 2");
}); });
let msg = await waitFor(() => findMessage(hud, "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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Tests that errors about insecure passwords are logged to the web console. // Tests that errors about insecure passwords are logged to the web console.
// See Bug 762593. // See Bug 762593.
"use strict"; "use strict";
const TEST_URI = const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"http://example.com/browser/devtools/client/webconsole/new-console-output/test/" + "new-console-output/test/mochitest/" +
"mochitest/test-insecure-passwords-about-blank-web-console-warning.html"; "test-insecure-passwords-about-blank-web-console-warning.html";
const INSECURE_PASSWORD_MSG = "Password fields present on an insecure (http://) iframe." + 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."; " 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. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that users can inspect objects logged from cross-domain iframes - // Check that users can inspect objects logged from cross-domain iframes -
// bug 869003. // bug 869003.

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Test that message source links for js errors and console API calls open in
// the jsdebugger when clicked. // the jsdebugger when clicked.
@ -10,9 +12,9 @@
requestLongerTimeout(2); requestLongerTimeout(2);
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 // Force the new debugger UI, in case this gets uplifted with the old
// debugger still turned on // debugger still turned on
await pushPref("devtools.debugger.new-debugger-frontend", true); await pushPref("devtools.debugger.new-debugger-frontend", true);

View file

@ -5,7 +5,9 @@
"use strict"; "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 () { add_task(async function () {
await pushPref("devtools.webconsole.filter.css", true); await pushPref("devtools.webconsole.filter.css", true);

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests that the Web Console doesn't leak when multiple tabs and windows are
// opened and then closed. See Bug 595350. // opened and then closed. See Bug 595350.

View file

@ -4,7 +4,8 @@
"use strict"; "use strict";
const TEST_FILE = "test-network-request.html"; 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 TEST_URI = TEST_PATH + TEST_FILE;
add_task(async function task() { add_task(async function task() {

View file

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

View file

@ -4,7 +4,8 @@
"use strict"; "use strict";
const TEST_FILE = "test-network-request.html"; 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 TEST_URI = TEST_PATH + TEST_FILE;
const NET_PREF = "devtools.webconsole.filter.net"; 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 TEST_FILE = "test-network-request.html";
const JSON_TEST_URL = "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 NET_PREF = "devtools.webconsole.filter.net";
const XHR_PREF = "devtools.webconsole.filter.netxhr"; const XHR_PREF = "devtools.webconsole.filter.netxhr";

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests that network requests from chrome don't cause the Web Console to
// throw exceptions. See Bug 597136. // throw exceptions. See Bug 597136.

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests that network log messages bring up the network panel and select the
// right request even if it was previously filtered off. // 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); 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 hud = await openNewTabAndConsole(TEST_URI);
const toolbox = gDevTools.getToolbox(hud.target); const toolbox = gDevTools.getToolbox(hud.target);

View file

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

View file

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

View file

@ -3,13 +3,16 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that inspecting an optimized out variable works when execution is // Check that inspecting an optimized out variable works when execution is
// paused. // paused.
"use strict"; "use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" + 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 () { add_task(async function () {
// Force the old debugger UI since it's directly used (see Bug 1301705) // 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 // Test that multiple messages are copied into the clipboard and that they are
// separated by new lines. See bug 916997. // separated by new lines. See bug 916997.
const TEST_URI = "data:text/html,<meta charset=utf8>" + 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 () { add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI); let hud = await openNewTabAndConsole(TEST_URI);

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Tests that any output created from calls to the console API comes before the
// echoed JavaScript. // echoed JavaScript.

View file

@ -3,11 +3,14 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that message persistence works - bug 705921 / bug 1307881 // Check that message persistence works - bug 705921 / bug 1307881
"use strict"; "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(() => { registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.webconsole.persistlog"); Services.prefs.clearUserPref("devtools.webconsole.persistlog");

View file

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

View file

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

View file

@ -3,6 +3,8 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // 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 // domain to another, in order to avoid permission denied errors with a sandbox
// created for a different origin. See Bug 664688. // created for a different origin. See Bug 664688.

View file

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

View file

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

View file

@ -7,7 +7,8 @@
// Test that a missing source map is reported. // 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 () { add_task(async function () {
for (let test of ["test-sourcemap-error-01.html", "test-sourcemap-error-02.html"]) { 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