browser_webconsole_worker_evaluate.js (870B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 // When the debugger is paused in a worker thread, console evaluations should 5 // be performed in that worker's selected frame. 6 7 "use strict"; 8 9 const TEST_URI = 10 "http://example.com/browser/devtools/client/webconsole/" + 11 "test/browser/test-evaluate-worker.html"; 12 13 add_task(async function () { 14 const hud = await openNewTabAndConsole(TEST_URI); 15 16 await openDebugger(); 17 const toolbox = hud.toolbox; 18 await waitFor( 19 () => toolbox.commands.targetCommand.store.getState().targets.length == 2 20 ); 21 const dbg = createDebuggerContext(toolbox); 22 23 execute(hud, "pauseInWorker(42)"); 24 25 await waitForPaused(dbg); 26 await openConsole(); 27 28 await executeAndWaitForResultMessage(hud, "data", "42"); 29 ok(true, "Evaluated console message in worker thread"); 30 });