Bug 1757397 - [devtools] Enable strict eslint rule in the debugger. r=nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D139843
This commit is contained in:
Alexandre Poirot 2022-02-28 17:59:32 +00:00
Родитель 44b441005d
Коммит 26c5ba2c1a
184 изменённых файлов: 432 добавлений и 11 удалений

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

@ -78,7 +78,7 @@ module.exports = {
}, },
}, },
{ {
files: ["client/framework/**", "client/debugger/test/**"], files: ["client/framework/**"],
rules: { rules: {
strict: "off", strict: "off",
}, },

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
// General rule from /.eslintrc.js only accept folders matching **/test*/browser*/ // General rule from /.eslintrc.js only accept folders matching **/test*/browser*/
// where is this folder doesn't match, so manually apply browser test config // where is this folder doesn't match, so manually apply browser test config
module.exports = { module.exports = {

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-asm.html"); const dbg = await initDebugger("doc-asm.html");
await reload(dbg); await reload(dbg);

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Tests async stepping will step over await statements // Tests async stepping will step over await statements
"use strict";
add_task(async function test() { add_task(async function test() {
await pushPref("devtools.debugger.features.async-stepping", true); await pushPref("devtools.debugger.features.async-stepping", true);
const dbg = await initDebugger("doc-async.html", "async.js"); const dbg = await initDebugger("doc-async.html", "async.js");

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

@ -4,6 +4,8 @@
// Tests that async stacks include the async separator // Tests that async stacks include the async separator
"use strict";
add_task(async function() { add_task(async function() {
pushPref("devtools.debugger.features.async-captured-stacks", true); pushPref("devtools.debugger.features.async-captured-stacks", true);
const dbg = await initDebugger("doc-frames-async.html"); const dbg = await initDebugger("doc-frames-async.html");

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

@ -5,6 +5,8 @@
// Test the AudioContext are paused and resume appropriately when using the // Test the AudioContext are paused and resume appropriately when using the
// debugger. // debugger.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-audiocontext.html"); const dbg = await initDebugger("doc-audiocontext.html");

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

@ -2,10 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
// Test the debugger when navigating using the BFCache. // Test the debugger when navigating using the BFCache.
"use strict";
PromiseTestUtils.allowMatchingRejectionsGlobally(/Connection closed/);
add_task(async function() { add_task(async function() {
info("Run test with bfcacheInParent DISABLED"); info("Run test with bfcacheInParent DISABLED");
await pushPref("fission.bfcacheInParent", false); await pushPref("fission.bfcacheInParent", false);

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

@ -9,6 +9,8 @@
// - 'Un/Blackbox files in this directory' // - 'Un/Blackbox files in this directory'
// - 'Un/Blackbox files outside this directory' // - 'Un/Blackbox files outside this directory'
"use strict";
const SOURCE_FILES = { const SOURCE_FILES = {
nestedSource: "nested-source.js", nestedSource: "nested-source.js",
codeReload1: "code_reload_1.js", codeReload1: "code_reload_1.js",

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// This source map does not have source contents, so it's fetched separately // This source map does not have source contents, so it's fetched separately
"use strict";
add_task(async function() { add_task(async function() {
// NOTE: the CORS call makes the test run times inconsistent // NOTE: the CORS call makes the test run times inconsistent
const dbg = await initDebugger("doc-sourcemaps3.html"); const dbg = await initDebugger("doc-sourcemaps3.html");

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

@ -5,6 +5,8 @@
// This test covers all the blackboxing functionality relating to a selected // This test covers all the blackboxing functionality relating to a selected
// source open in the debugger editor. // source open in the debugger editor.
"use strict";
requestLongerTimeout(5); requestLongerTimeout(5);
const contextMenuItems = { const contextMenuItems = {

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const testServer = createVersionizedHttpTestServer("sourcemaps-reload"); const testServer = createVersionizedHttpTestServer("sourcemaps-reload");
const TEST_URL = testServer.urlFor("index.html"); const TEST_URL = testServer.urlFor("index.html");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const testServer = createVersionizedHttpTestServer("sourcemaps-reload"); const testServer = createVersionizedHttpTestServer("sourcemaps-reload");
const TEST_URL = testServer.urlFor("index.html"); const TEST_URL = testServer.urlFor("index.html");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
// Tests that `debugger` statements are hit before the debugger even // Tests that `debugger` statements are hit before the debugger even
// initializes and it properly highlights the right location in the // initializes and it properly highlights the right location in the
// debugger. // debugger.

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
// Tests the breakpoints are hit in various situations. // Tests the breakpoints are hit in various situations.
add_task(async function() { add_task(async function() {

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

@ -7,6 +7,8 @@
* skip pausing is enabled. * skip pausing is enabled.
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const toolbox = await initPane("doc-scripts.html", "webconsole", [ const toolbox = await initPane("doc-scripts.html", "webconsole", [
["devtools.debugger.skip-pausing", true], ["devtools.debugger.skip-pausing", true],

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

@ -7,6 +7,8 @@
* invoking functions without pausing. * invoking functions without pausing.
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html"); const dbg = await initDebugger("doc-scripts.html");
await selectSource(dbg, "simple3.js"); await selectSource(dbg, "simple3.js");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
// Tests to see if we can trigger a breakpoint action via the context menu // Tests to see if we can trigger a breakpoint action via the context menu
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple2.js"); const dbg = await initDebugger("doc-scripts.html", "simple2.js");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple1.js"); const dbg = await initDebugger("doc-scripts.html", "simple1.js");
await selectSource(dbg, "long.js"); await selectSource(dbg, "long.js");

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

@ -5,6 +5,8 @@
// Test opening conditional panel using keyboard shortcut. // Test opening conditional panel using keyboard shortcut.
// Should access the closest breakpoint to a passed in cursorPosition. // Should access the closest breakpoint to a passed in cursorPosition.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "long.js"); const dbg = await initDebugger("doc-scripts.html", "long.js");

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

@ -4,6 +4,9 @@
// Confirms that a conditional panel is opened at the // Confirms that a conditional panel is opened at the
// correct location in generated files. // correct location in generated files.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-sourcemaps.html", "entry.js"); const dbg = await initDebugger("doc-sourcemaps.html", "entry.js");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple2.js"); const dbg = await initDebugger("doc-scripts.html", "simple2.js");
await pushPref("devtools.debugger.features.column-breakpoints", true); await pushPref("devtools.debugger.features.column-breakpoints", true);

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Test enabling and disabling a debugger statement using editor context menu // Test enabling and disabling a debugger statement using editor context menu
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-pause-points.html", "pause-points.js"); const dbg = await initDebugger("doc-pause-points.html", "pause-points.js");
await selectSource(dbg, "pause-points.js"); await selectSource(dbg, "pause-points.js");

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

@ -5,6 +5,9 @@
// Tests to make sure we do not accidentally slide the breakpoint up to the first // Tests to make sure we do not accidentally slide the breakpoint up to the first
// function with the same name in the file. // function with the same name in the file.
// TODO: Likely to remove this test when removing the breakpoint sliding functionality // TODO: Likely to remove this test when removing the breakpoint sliding functionality
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger( const dbg = await initDebugger(
"doc-duplicate-functions.html", "doc-duplicate-functions.html",

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

@ -7,6 +7,9 @@
// We wrap it in a setTimeout to avoid errors in the webconsole actor which // We wrap it in a setTimeout to avoid errors in the webconsole actor which
// would still be processing the outcome of the evaluation after we destroy // would still be processing the outcome of the evaluation after we destroy
// the thread actor. // the thread actor.
"use strict";
const EVALED_SOURCE_TEXT = `setTimeout(function() { const EVALED_SOURCE_TEXT = `setTimeout(function() {
debugger; debugger;
console.log("SECOND LINE"); console.log("SECOND LINE");

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

@ -5,6 +5,8 @@
// Testing displaying breakpoints in the breakpoints list and the tooltip // Testing displaying breakpoints in the breakpoints list and the tooltip
// shows the thread information. // shows the thread information.
"use strict";
add_task(async function testBreakpointsListForMultipleTargets() { add_task(async function testBreakpointsListForMultipleTargets() {
const dbg = await initDebugger( const dbg = await initDebugger(
"doc_dbg-fission-frame-sources.html", "doc_dbg-fission-frame-sources.html",

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

@ -4,6 +4,8 @@
// Verify that we hit breakpoints on popups // Verify that we hit breakpoints on popups
"use strict";
const TEST_URI = "https://example.org/document-builder.sjs?html=main page"; const TEST_URI = "https://example.org/document-builder.sjs?html=main page";
const POPUP_URL = `https://example.com/document-builder.sjs?html=${escape(`popup for breakpoints const POPUP_URL = `https://example.com/document-builder.sjs?html=${escape(`popup for breakpoints
<script> <script>

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

@ -10,6 +10,8 @@
// removed in which case the correct behaviours should begin to pass. To see the // removed in which case the correct behaviours should begin to pass. To see the
// failures with breakpoints shifting make flag IS_BREAKPOINT_SHIFTING_ENABLED = false // failures with breakpoints shifting make flag IS_BREAKPOINT_SHIFTING_ENABLED = false
"use strict";
const IS_BREAKPOINT_SHIFTING_ENABLED = true; const IS_BREAKPOINT_SHIFTING_ENABLED = true;
const httpServer = createTestHTTPServer(); const httpServer = createTestHTTPServer();

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Tests breakpoints syncing when reloading // Tests breakpoints syncing when reloading
"use strict";
requestLongerTimeout(3); requestLongerTimeout(3);
// Tests that a breakpoint set is correctly synced after reload // Tests that a breakpoint set is correctly synced after reload

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

@ -7,6 +7,8 @@
* source content changes of reload. * source content changes of reload.
*/ */
"use strict";
const testServer = createVersionizedHttpTestServer("sourcemaps-reload"); const testServer = createVersionizedHttpTestServer("sourcemaps-reload");
const TEST_URL = testServer.urlFor("index.html"); const TEST_URL = testServer.urlFor("index.html");

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Test enabling and disabling a breakpoint using the check boxes // Test enabling and disabling a breakpoint using the check boxes
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple2.js"); const dbg = await initDebugger("doc-scripts.html", "simple2.js");

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

@ -6,6 +6,8 @@
* Tests that the debugger is succesfully loaded in the Browser Content Toolbox. * Tests that the debugger is succesfully loaded in the Browser Content Toolbox.
*/ */
"use strict";
const { const {
gDevToolsBrowser, gDevToolsBrowser,
} = require("devtools/client/framework/devtools-browser"); } = require("devtools/client/framework/devtools-browser");

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

@ -5,6 +5,8 @@
// Test that the debugger pauses in the multiprocess browser toolbox even when // Test that the debugger pauses in the multiprocess browser toolbox even when
// it hasn't been opened. // it hasn't been opened.
"use strict";
requestLongerTimeout(4); requestLongerTimeout(4);
/* import-globals-from ../../../framework/browser-toolbox/test/helpers-browser-toolbox.js */ /* import-globals-from ../../../framework/browser-toolbox/test/helpers-browser-toolbox.js */

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

@ -5,6 +5,8 @@
// Test that all kinds of workers show up properly in the multiprocess browser // Test that all kinds of workers show up properly in the multiprocess browser
// toolbox. // toolbox.
"use strict";
requestLongerTimeout(4); requestLongerTimeout(4);
/* import-globals-from ../../../framework/browser-toolbox/test/helpers-browser-toolbox.js */ /* import-globals-from ../../../framework/browser-toolbox/test/helpers-browser-toolbox.js */

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
// Ignore strange errors when shutting down. // Ignore strange errors when shutting down.
PromiseTestUtils.allowMatchingRejectionsGlobally(/No such actor/); PromiseTestUtils.allowMatchingRejectionsGlobally(/No such actor/);

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

@ -6,6 +6,8 @@
* Tests that a chrome debugger can be created in a new process. * Tests that a chrome debugger can be created in a new process.
*/ */
"use strict";
// There are shutdown issues for which multiple rejections are left uncaught. // There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues. // See bug 1018184 for resolving these issues.
PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/);

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

@ -4,6 +4,9 @@
// This test checks to see if holding down the command key and clicking on function call // This test checks to see if holding down the command key and clicking on function call
// will jump the debugger to that call. // will jump the debugger to that call.
"use strict";
add_task(async function() { add_task(async function() {
await pushPref("devtools.debugger.features.command-click", true); await pushPref("devtools.debugger.features.command-click", true);
info( info(

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

@ -6,6 +6,8 @@
// console if necessary. This cleans up the split console pref so // console if necessary. This cleans up the split console pref so
// it won't pollute other tests. // it won't pollute other tests.
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
Services.prefs.setBoolPref( Services.prefs.setBoolPref(

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

@ -5,6 +5,8 @@
// Tests that clicking the DOM node button in any ObjectInspect // Tests that clicking the DOM node button in any ObjectInspect
// opens the Inspector panel // opens the Inspector panel
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple2.js"); const dbg = await initDebugger("doc-scripts.html", "simple2.js");

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

@ -5,6 +5,8 @@
// Tests opening the console first, clicking a link // Tests opening the console first, clicking a link
// opens the editor at the correct location. // opens the editor at the correct location.
"use strict";
add_task(async function() { add_task(async function() {
const toolbox = await initPane("doc-script-switching.html", "webconsole"); const toolbox = await initPane("doc-script-switching.html", "webconsole");
const node = await waitForLink(toolbox, "hi"); const node = await waitForLink(toolbox, "hi");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
const dbg = await initDebugger("doc-strict.html"); const dbg = await initDebugger("doc-strict.html");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
const dbg = await initDebugger( const dbg = await initDebugger(

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

@ -4,6 +4,8 @@
// Tests that the content scripts are listed in the source tree. // Tests that the content scripts are listed in the source tree.
"use strict";
add_task(async function() { add_task(async function() {
await pushPref("devtools.chrome.enabled", true); await pushPref("devtools.chrome.enabled", true);
const extension = await installAndStartExtension(); const extension = await installAndStartExtension();

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

@ -4,6 +4,8 @@
// Test cmd+click continuing to a line // Test cmd+click continuing to a line
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-pause-points.html", "pause-points.js"); const dbg = await initDebugger("doc-pause-points.html", "pause-points.js");
await selectSource(dbg, "pause-points.js"); await selectSource(dbg, "pause-points.js");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-pause-points.html", "pause-points.js"); const dbg = await initDebugger("doc-pause-points.html", "pause-points.js");
await selectSource(dbg, "pause-points.js"); await selectSource(dbg, "pause-points.js");

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

@ -4,6 +4,9 @@
// Test ensures zombie debug lines do not persist // Test ensures zombie debug lines do not persist
// https://github.com/firefox-devtools/debugger/issues/7755 // https://github.com/firefox-devtools/debugger/issues/7755
"use strict";
add_task(async function() { add_task(async function() {
// Load test files // Load test files
const dbg = await initDebugger("doc-sources.html"); const dbg = await initDebugger("doc-sources.html");

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

@ -10,6 +10,9 @@
* 4. stepOver to the end of a function * 4. stepOver to the end of a function
* 5. stepUp at the end of a function * 5. stepUp at the end of a function
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-debugger-statements.html"); const dbg = await initDebugger("doc-debugger-statements.html");

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

@ -4,9 +4,10 @@
// Tests dom mutation breakpoints with a remote frame. // Tests dom mutation breakpoints with a remote frame.
/* import-globals-from ../../../inspector/test/shared-head.js */ "use strict";
// Import helpers for the inspector // Import helpers for the inspector
/* import-globals-from ../../../inspector/test/shared-head.js */
Services.scriptloader.loadSubScript( Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js", "chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js",
this this

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

@ -4,9 +4,10 @@
// Tests adding, disble/enable, and removal of dom mutation breakpoints // Tests adding, disble/enable, and removal of dom mutation breakpoints
/* import-globals-from ../../../inspector/test/shared-head.js */ "use strict";
// Import helpers for the inspector // Import helpers for the inspector
/* import-globals-from ../../../inspector/test/shared-head.js */
Services.scriptloader.loadSubScript( Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js", "chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js",
this this

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

@ -4,6 +4,8 @@
// Test that eager evaluation skips breakpoints and debugger statements // Test that eager evaluation skips breakpoints and debugger statements
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-strict.html"); const dbg = await initDebugger("doc-strict.html");
const { hud } = await getDebuggerSplitConsole(dbg); const { hud } = await getDebuggerSplitConsole(dbg);

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

@ -5,6 +5,8 @@
// Tests the breakpoint gutter and making sure breakpoint icons exist // Tests the breakpoint gutter and making sure breakpoint icons exist
// correctly // correctly
"use strict";
// FIXME bug 1524374 removing breakpoints in this test can cause uncaught // FIXME bug 1524374 removing breakpoints in this test can cause uncaught
// rejections and make bug 1512742 permafail. // rejections and make bug 1512742 permafail.
PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/); PromiseTestUtils.allowMatchingRejectionsGlobally(/NS_ERROR_NOT_INITIALIZED/);

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

@ -6,6 +6,8 @@
// matter if the source text doesn't exist yet or even if the source // matter if the source text doesn't exist yet or even if the source
// doesn't exist. // doesn't exist.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "long.js"); const dbg = await initDebugger("doc-scripts.html", "long.js");
const { const {

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

@ -4,6 +4,9 @@
// Tests that the editor sets the correct mode for different file // Tests that the editor sets the correct mode for different file
// types // types
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple1.js"); const dbg = await initDebugger("doc-scripts.html", "simple1.js");

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

@ -4,6 +4,9 @@
// Tests that the editor keeps proper scroll position per document // Tests that the editor keeps proper scroll position per document
// while also moving to the correct location upon pause/breakpoint selection // while also moving to the correct location upon pause/breakpoint selection
"use strict";
requestLongerTimeout(2); requestLongerTimeout(2);
add_task(async function() { add_task(async function() {

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

@ -4,6 +4,9 @@
// Tests that the editor highlights the correct location when the // Tests that the editor highlights the correct location when the
// debugger pauses // debugger pauses
"use strict";
requestLongerTimeout(2); requestLongerTimeout(2);
add_task(async function() { add_task(async function() {

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("ember/quickstart/dist/"); const dbg = await initDebugger("ember/quickstart/dist/");
dbg.actions.toggleMapScopes(); dbg.actions.toggleMapScopes();

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

@ -4,6 +4,9 @@
// Test that exceptions thrown while evaluating code will pause at the point the // Test that exceptions thrown while evaluating code will pause at the point the
// exception was generated when pausing on uncaught exceptions. // exception was generated when pausing on uncaught exceptions.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-eval-throw.html"); const dbg = await initDebugger("doc-eval-throw.html");
await togglePauseOnExceptions(dbg, true, true); await togglePauseOnExceptions(dbg, true, true);

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

@ -4,6 +4,8 @@
// Tests early event breakpoints and event breakpoints in a remote frame. // Tests early event breakpoints and event breakpoints in a remote frame.
"use strict";
add_task(async function() { add_task(async function() {
await pushPref( await pushPref(
"devtools.debugger.features.event-listeners-breakpoints", "devtools.debugger.features.event-listeners-breakpoints",

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
await pushPref( await pushPref(
"devtools.debugger.features.event-listeners-breakpoints", "devtools.debugger.features.event-listeners-breakpoints",

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

@ -5,6 +5,9 @@
// Test that pausing within an event handler on an element does *not* show the // Test that pausing within an event handler on an element does *not* show the
// HTML page containing that element. It should show a sources tab containing // HTML page containing that element. It should show a sources tab containing
// just the handler's text instead. // just the handler's text instead.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-event-handler.html"); const dbg = await initDebugger("doc-event-handler.html");

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

@ -10,6 +10,8 @@
* 3. expand properties * 3. expand properties
*/ */
"use strict";
const EXPRESSION_SELECTORS = { const EXPRESSION_SELECTORS = {
plusIcon: ".watch-expressions-pane button.plus", plusIcon: ".watch-expressions-pane button.plus",
input: "input.input-expression", input: "input.input-expression",

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Ensures the input is displayed and focused when "+" is clicked // Ensures the input is displayed and focused when "+" is clicked
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html"); const dbg = await initDebugger("doc-script-switching.html");

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

@ -6,6 +6,8 @@
* Test the watch expressions update when selecting a different thread in the thread panel. * Test the watch expressions update when selecting a different thread in the thread panel.
*/ */
"use strict";
const TEST_COM_URI = `${URL_ROOT_COM}examples/doc_dbg-fission-frame-sources.html`; const TEST_COM_URI = `${URL_ROOT_COM}examples/doc_dbg-fission-frame-sources.html`;
add_task(async function() { add_task(async function() {

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

@ -10,6 +10,8 @@
* - disappears when all expressions are removed * - disappears when all expressions are removed
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html"); const dbg = await initDebugger("doc-script-switching.html");

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

@ -10,6 +10,8 @@
* 4. expanding properties when not paused * 4. expanding properties when not paused
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-script-switching.html"); const dbg = await initDebugger("doc-script-switching.html");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`; const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`;
add_task(async function() { add_task(async function() {

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-pause-exceptions.html`; const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-pause-exceptions.html`;
// Tests Pause on exceptions in remote iframes // Tests Pause on exceptions in remote iframes

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`; const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`;
add_task(async function() { add_task(async function() {

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

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
/* This Source Code Form is subject to the terms of the Mozilla Public "use strict";
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`; const TEST_COM_URI = `${URL_ROOT_COM_SSL}examples/doc_dbg-fission-frame-sources.html`;

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

@ -4,6 +4,8 @@
// Test switching for the top-level target. // Test switching for the top-level target.
"use strict";
const PARENT_PROCESS_URI = "about:robots"; const PARENT_PROCESS_URI = "about:robots";
add_task(async function() { add_task(async function() {

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

@ -4,6 +4,8 @@
// Test that we can set breakpoints in scripts that have been GCed. // Test that we can set breakpoints in scripts that have been GCed.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger( const dbg = await initDebugger(
"doc-gc-breakpoint-positions.html", "doc-gc-breakpoint-positions.html",

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

@ -7,6 +7,8 @@
// generated and original sources of scripts with source maps specified either // generated and original sources of scripts with source maps specified either
// inline or in their HTTP response headers. // inline or in their HTTP response headers.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger( const dbg = await initDebugger(
"doc-gc-sources.html", "doc-gc-sources.html",

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

@ -4,6 +4,8 @@
// Test the "go to line" feature correctly responses to keyboard shortcuts. // Test the "go to line" feature correctly responses to keyboard shortcuts.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "long.js"); const dbg = await initDebugger("doc-scripts.html", "long.js");
await selectSource(dbg, "long.js"); await selectSource(dbg, "long.js");

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

@ -4,6 +4,9 @@
// This test checks to see if command button highlights and unhighlights // This test checks to see if command button highlights and unhighlights
// calls when debugger is paused. // calls when debugger is paused.
"use strict";
add_task(async function() { add_task(async function() {
await pushPref("devtools.debugger.features.command-click", true); await pushPref("devtools.debugger.features.command-click", true);
const dbg = await initDebugger("doc-command-click.html", "simple4.js"); const dbg = await initDebugger("doc-command-click.html", "simple4.js");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-html-breakpoints.html"); const dbg = await initDebugger("doc-html-breakpoints.html");

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

@ -4,6 +4,9 @@
// Test that IDB transactions are not processed at microtask checkpoints // Test that IDB transactions are not processed at microtask checkpoints
// introduced by debugger hooks. // introduced by debugger hooks.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-idb-run-to-completion.html"); const dbg = await initDebugger("doc-idb-run-to-completion.html");
invokeInTab("test", "doc-xhr-run-to-completion.html"); invokeInTab("test", "doc-xhr-run-to-completion.html");

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

@ -4,6 +4,9 @@
// Test is taking too much time to complete on some hardware since // Test is taking too much time to complete on some hardware since
// release at https://bugzilla.mozilla.org/show_bug.cgi?id=1423158 // release at https://bugzilla.mozilla.org/show_bug.cgi?id=1423158
"use strict";
requestLongerTimeout(3); requestLongerTimeout(3);
/** /**

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

@ -9,6 +9,8 @@
* - Reload inside debugger with toolbox caching enabled * - Reload inside debugger with toolbox caching enabled
*/ */
"use strict";
// Breakpoint position calculations can throw when interrupted by a navigation. // Breakpoint position calculations can throw when interrupted by a navigation.
PromiseTestUtils.allowMatchingRejectionsGlobally(/Resource .*? does not exist/); PromiseTestUtils.allowMatchingRejectionsGlobally(/Resource .*? does not exist/);

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

@ -5,6 +5,8 @@
// This test checks the appearance of an inline exception // This test checks the appearance of an inline exception
// and the content of the exception tooltip. // and the content of the exception tooltip.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-exceptions.html"); const dbg = await initDebugger("doc-exceptions.html");
await selectSource(dbg, "exceptions.js"); await selectSource(dbg, "exceptions.js");

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Test checking inline preview feature // Test checking inline preview feature
"use strict";
add_task(async function() { add_task(async function() {
await pushPref("devtools.debugger.features.inline-preview", true); await pushPref("devtools.debugger.features.inline-preview", true);

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

@ -4,6 +4,8 @@
// Test that breakpoints work when set in inline scripts that do not start at column 0. // Test that breakpoints work when set in inline scripts that do not start at column 0.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-inline-script-offset.html"); const dbg = await initDebugger("doc-inline-script-offset.html");
await selectSource(dbg, "doc-inline-script-offset.html"); await selectSource(dbg, "doc-inline-script-offset.html");

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

@ -5,6 +5,8 @@
// Tests that clicking the DOM node button in any ObjectInspect // Tests that clicking the DOM node button in any ObjectInspect
// opens the Inspector panel // opens the Inspector panel
"use strict";
add_task(async function() { add_task(async function() {
// Ensures the end panel is wide enough to show the inspector icon // Ensures the end panel is wide enough to show the inspector icon
await pushPref("devtools.debugger.end-panel-size", 600); await pushPref("devtools.debugger.end-panel-size", 600);

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

@ -4,6 +4,8 @@
// Tests that keyboard navigation into and out of debugger code editor // Tests that keyboard navigation into and out of debugger code editor
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple2.js"); const dbg = await initDebugger("doc-scripts.html", "simple2.js");
const doc = dbg.win.document; const doc = dbg.win.document;

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

@ -6,6 +6,8 @@
* Test the keyboard shortcuts modal * Test the keyboard shortcuts modal
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebuggerWithAbsoluteURL( const dbg = await initDebuggerWithAbsoluteURL(
"data:text/html,Test keyboard shortcuts modal" "data:text/html,Test keyboard shortcuts modal"

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

@ -6,6 +6,8 @@
* Test keyboard shortcuts. * Test keyboard shortcuts.
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-debugger-statements.html"); const dbg = await initDebugger("doc-debugger-statements.html");

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

@ -6,6 +6,9 @@
* This if the debugger's layout is correctly modified when the toolbox's * This if the debugger's layout is correctly modified when the toolbox's
* host changes. * host changes.
*/ */
"use strict";
requestLongerTimeout(2); requestLongerTimeout(2);
let gDefaultHostType = Services.prefs.getCharPref("devtools.toolbox.host"); let gDefaultHostType = Services.prefs.getCharPref("devtools.toolbox.host");

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

@ -6,6 +6,9 @@
* Test reload via an href link, which refers to the same document. * Test reload via an href link, which refers to the same document.
* It seems to cause different codepath compared to F5. * It seems to cause different codepath compared to F5.
*/ */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger( const dbg = await initDebugger(
"doc-reload-link.html", "doc-reload-link.html",

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

@ -6,6 +6,8 @@
* Tests that we can log event listeners calls * Tests that we can log event listeners calls
*/ */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
const dbg = await initDebugger( const dbg = await initDebugger(

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

@ -6,6 +6,8 @@
* Tests that expressions in log points are source mapped. * Tests that expressions in log points are source mapped.
*/ */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);

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

@ -6,6 +6,8 @@
* Tests that log points in a worker are correctly logged to the console * Tests that log points in a worker are correctly logged to the console
*/ */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);

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

@ -6,6 +6,8 @@
* Tests that log points are correctly logged to the console * Tests that log points are correctly logged to the console
*/ */
"use strict";
add_task(async function() { add_task(async function() {
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true); Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
const dbg = await initDebugger( const dbg = await initDebugger(

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

@ -5,6 +5,8 @@
// Test settings multiple types of breakpoints on the same line // Test settings multiple types of breakpoints on the same line
// Only the last should be used // Only the last should be used
"use strict";
// Line where we set a breakpoint in simple2.js // Line where we set a breakpoint in simple2.js
const BREAKPOINT_LINE = 5; const BREAKPOINT_LINE = 5;

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Test that adjacent scopes are merged together as expected. // Test that adjacent scopes are merged together as expected.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-merge-scopes.html"); const dbg = await initDebugger("doc-merge-scopes.html");

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

@ -4,6 +4,9 @@
// Test that messages from postMessage calls are not delivered while paused in // Test that messages from postMessage calls are not delivered while paused in
// the debugger. // the debugger.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-message-run-to-completion.html"); const dbg = await initDebugger("doc-message-run-to-completion.html");
invokeInTab("test", "doc-message-run-to-completion.html"); invokeInTab("test", "doc-message-run-to-completion.html");

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

@ -4,6 +4,8 @@
// Tests minfied + source maps. // Tests minfied + source maps.
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-minified2.html", "sum.js"); const dbg = await initDebugger("doc-minified2.html", "sum.js");
dbg.actions.toggleMapScopes(); dbg.actions.toggleMapScopes();

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-navigation-when-paused.html"); const dbg = await initDebugger("doc-navigation-when-paused.html");

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

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
"use strict";
const SOURCES = [ const SOURCES = [
"simple1.js", "simple1.js",
"simple2.js", "simple2.js",

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

@ -4,6 +4,9 @@
// Test that we show a breakpoint in the UI when there is an old pending // Test that we show a breakpoint in the UI when there is an old pending
// breakpoint with an invalid original location. // breakpoint with an invalid original location.
"use strict";
add_task(async function() { add_task(async function() {
clearDebuggerPreferences(); clearDebuggerPreferences();

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Tests the outline pane fuzzy filtering of outline items // Tests the outline pane fuzzy filtering of outline items
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "long.js"); const dbg = await initDebugger("doc-scripts.html", "long.js");
await selectSource(dbg, "long.js", 1); await selectSource(dbg, "long.js", 1);

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

@ -4,6 +4,8 @@
// Tests that after clicking a function in edtior, outline focuses that function // Tests that after clicking a function in edtior, outline focuses that function
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-sources.html", "long.js"); const dbg = await initDebugger("doc-sources.html", "long.js");

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

@ -3,6 +3,9 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Tests that the length of outline functions for original and pretty printed source matches // Tests that the length of outline functions for original and pretty printed source matches
"use strict";
add_task(async function() { add_task(async function() {
const dbg = await initDebugger("doc-scripts.html", "simple1.js"); const dbg = await initDebugger("doc-scripts.html", "simple1.js");

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше