diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js')
-rw-r--r-- | devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js new file mode 100644 index 000000000..49821492f --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-console-03.js @@ -0,0 +1,46 @@ +// Check to make sure that a worker can be attached to a toolbox +// and that the console works. + +var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html"; +var WORKER_URL = "code_WorkerActor.attachThread-worker.js"; + +// Test to see if creating the pause from the console works. +add_task(function* testPausedByConsole() { + let {client, tab, tabClient, workerClient, toolbox, gDebugger} = + yield initWorkerDebugger(TAB_URL, WORKER_URL); + + let gTarget = gDebugger.gTarget; + let gResumeButton = gDebugger.document.getElementById("resume"); + let gResumeKey = gDebugger.document.getElementById("resumeKey"); + + let jsterm = yield getSplitConsole(toolbox); + let executed = yield jsterm.execute("10000+1"); + ok(executed.textContent.includes("10001"), + "Text for message appeared correct"); + + let oncePaused = gTarget.once("thread-paused"); + EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger); + let pausedExecution = jsterm.execute("10000+2"); + + info("Executed a command with 'break on next' active, waiting for pause"); + yield oncePaused; + + executed = yield jsterm.execute("10000+3"); + ok(executed.textContent.includes("10003"), + "Text for message appeared correct"); + + info("Waiting for a resume"); + let onceResumed = gTarget.once("thread-resumed"); + EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger); + yield onceResumed; + + executed = yield pausedExecution; + ok(executed.textContent.includes("10002"), + "Text for message appeared correct"); + + terminateWorkerInTab(tab, WORKER_URL); + yield waitForWorkerClose(workerClient); + yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient)); + yield close(client); + yield removeTab(tab); +}); |