Bug 1583546 - Add test that the OBT debugger can pause even when it hasn't been opened, r=ochameau.
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 05 Nov 2019 12:32:11 +0000
changeset 500570 df564ab5211ef20fd1a1dafc4bc2ff9d292c1645
parent 500569 cf5e611e9d21dd33e1be27da7ec68e057801ebc5
child 500571 df0d308f3d6de247d25f2446a99a7470f236ee4e
push id99697
push userbhackett@mozilla.com
push dateTue, 05 Nov 2019 12:32:52 +0000
treeherderautoland@df564ab5211e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1583546
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
devtools/client/debugger/test/mochitest/browser.ini
devtools/client/debugger/test/mochitest/browser_dbg-toolbox-unselected-pause.js
--- a/devtools/client/debugger/test/mochitest/browser.ini
+++ b/devtools/client/debugger/test/mochitest/browser.ini
@@ -2,16 +2,17 @@
 tags = devtools
 subsuite = devtools
 skip-if = (os == 'linux' && debug && bits == 32)
 support-files =
   examples/*
   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
   !/devtools/client/shared/test/telemetry-test-helpers.js
   !/devtools/client/shared/test/test-actor-registry.js
   !/devtools/client/shared/test/test-actor.js
 
 [browser_dbg-asm.js]
@@ -171,8 +172,10 @@ skip-if = (os == 'linux' && debug) || (o
 [browser_dbg-merge-scopes.js]
 [browser_dbg-message-run-to-completion.js]
 [browser_dbg-remember-expanded-scopes.js]
 [browser_dbg-bfcache.js]
 [browser_dbg-gc-breakpoint-positions.js]
 [browser_dbg-gc-sources.js]
 [browser_dbg-watchpoints.js]
 skip-if = debug
+[browser_dbg-toolbox-unselected-pause.js]
+skip-if = asan # Bug 1591064
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-toolbox-unselected-pause.js
@@ -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();
+});