summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_webconsole_worker_evaluate.js
blob: 98aca6298b45669e5bb8edb8fee16e7127c1eaa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

// When the debugger is paused in a worker thread, console evaluations should
// be performed in that worker's selected frame.

"use strict";

const TEST_URI =
  "http://example.com/browser/devtools/client/webconsole/" +
  "test/browser/test-evaluate-worker.html";

add_task(async function () {
  const hud = await openNewTabAndConsole(TEST_URI);

  await openDebugger();
  const toolbox = hud.toolbox;
  await waitFor(
    () => toolbox.commands.targetCommand.store.getState().targets.length == 2
  );
  const dbg = createDebuggerContext(toolbox);

  execute(hud, "pauseInWorker(42)");

  await waitForPaused(dbg);
  await openConsole();

  await executeAndWaitForResultMessage(hud, "data", "42");
  ok(true, "Evaluated console message in worker thread");
});