зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
62f824d866
Коммит
85e9afa634
|
@ -7,6 +7,7 @@ support-files =
|
|||
head.js
|
||||
helpers.js
|
||||
helpers/context.js
|
||||
!/devtools/client/framework/test/helpers.js
|
||||
!/devtools/client/inspector/test/head.js
|
||||
!/devtools/client/inspector/test/shared-head.js
|
||||
!/devtools/client/shared/test/shared-head.js
|
||||
|
@ -176,3 +177,5 @@ skip-if = (os == 'linux' && debug) || (os == 'linux' && asan) || ccov #Bug 1456
|
|||
[browser_dbg-gc-sources.js]
|
||||
[browser_dbg-watchpoints.js]
|
||||
skip-if = debug
|
||||
[browser_dbg-toolbox-unselected-pause.js]
|
||||
skip-if = asan # Bug 1591064
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
/* 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";
|
||||
|
||||
requestLongerTimeout(4);
|
||||
|
||||
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();
|
||||
});
|
Загрузка…
Ссылка в новой задаче