Workers Test Page
Use the following test cases to test support for Worker debugging in Firefox Developer Tools
Test Case #1 - Threads Panel
- Open Firefox Developer tools
- Select the Debugger panel and click this button
- Check out the Threads side panel, it should show
worker1.js
file
- The worker runs for 12 sec.
- You can explicitly stop the worker by clicking on this button
Test Case #2 - JS Execution Scope & Paused state
- Click this button to start a worker
- The debugger should pause in the worker
- The worker in the Threads panel should should pause icon
||
to indicate paused state
- Open the Split Console and Evaluate
globalVariable
, the result should be Just a test
- Create Watch expression
globalVariable
, the result should be Just a test
- Select the
Main Thread
in the Threads panel
- The Watch expression
globalVariable
value should be undefined
- Open the Split Console and Evaluate
globalVariable
, the value should be undefined
- You can explicitly stop the worker by clicking on this button
Test Case #3 - Create BP in a worker
- Click this button to start a worker
- Find
worker3.js
in the Sources panel and create a breakpoint on line 11 (within onmessage
function)
- Click this button to send a message to the worker
- The BP should hit and status of the worker should be paused (in the Threads panel)
- You can explicitly stop the worker by clicking on this button
Test Case #4 - XHR from a worker
- Click this button to start a worker
-
The worker immediately executes HTTP requests to get current time
current-time.php
and repeats it every 10 sec.
-
You should also see
worker-xhr.js
in the Sources panel as well as
in the Threads panel in the Debugger
- Click this button to send a message to the worker and execute custom XHR to get simple text response
text-response.php
- You can explicitly stop the worker by clicking on this button
Tips for other test cases
- The Call stack and Scopes side panel should be properly updated when switching between paused and resumed workers
- Full debugging functionality should work (Variable Preview, Console expressions, WASM, etc)
- Reloading the page when a worker is paused should not break the Debugger
- Worker created within a worker should work as expected