Bug 1583546 - Add test that the OBT debugger can pause even when it hasn't been opened, r=ochameau.

Differential Revision: https://phabricator.services.mozilla.com/D50225

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brian Hackett 2019-10-31 13:49:28 +00:00
Родитель d3809112ad
Коммит 7efef281eb
2 изменённых файлов: 56 добавлений и 0 удалений

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

@ -7,6 +7,7 @@ support-files =
head.js head.js
helpers.js helpers.js
helpers/context.js helpers/context.js
!/devtools/client/framework/test/helpers.js
!/devtools/client/inspector/test/head.js !/devtools/client/inspector/test/head.js
!/devtools/client/inspector/test/shared-head.js !/devtools/client/inspector/test/shared-head.js
!/devtools/client/shared/test/shared-head.js !/devtools/client/shared/test/shared-head.js
@ -176,3 +177,4 @@ skip-if = true #Bug 1456013, Bug 1559547, Bug 1571863
[browser_dbg-gc-sources.js] [browser_dbg-gc-sources.js]
[browser_dbg-watchpoints.js] [browser_dbg-watchpoints.js]
skip-if = debug skip-if = debug
[browser_dbg-toolbox-unselected-pause.js]

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

@ -0,0 +1,54 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// Test that the debugger pauses in the omniscient browser toolbox even when it
// hasn't been opened.
"use strict";
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/framework/test/helpers.js",
this
);
add_task(async function() {
await pushPref("devtools.browsertoolbox.fission", true);
// Make sure the toolbox opens with the webconsole initially selected.
await pushPref("devtools.browsertoolbox.panel", "webconsole");
const ToolboxTask = await initBrowserToolboxTask();
await ToolboxTask.importFunctions({
waitUntil,
waitForPaused,
isPaused,
waitForState,
info: () => {},
waitForSelectedSource,
waitForLoadedScopes: () => {},
});
addTab("data:text/html,<script>debugger;</script>");
// The debugger should automatically be selected.
await ToolboxTask.spawn(null, async () => {
await waitUntil(() => gToolbox.currentToolId == "jsdebugger");
});
ok(true, "Debugger selected");
// The debugger should pause.
await ToolboxTask.spawn(null, async () => {
// Wait for the debugger to finish loading.
await gToolbox.selectTool("jsdebugger");
const dbg = gToolbox.getCurrentPanel().panelWin.dbg;
await waitForPaused(dbg);
if (!gToolbox.isToolHighlighted("jsdebugger")) {
throw new Error("Debugger not highlighted");
}
});
ok(true, "Paused in new tab");
await ToolboxTask.destroy();
});