Workers Test Page

Use the following test cases to test support for Worker debugging in Firefox Developer Tools

Test Case #1 - Threads Panel

  1. Open Firefox Developer tools
  2. Select the Debugger panel and click this button
  3. Check out the Threads side panel, it should show worker1.js file
  4. The worker runs for 12 sec.
  5. You can explicitly stop the worker by clicking on this button

Test Case #2 - JS Execution Scope & Paused state

  1. Click this button to start a worker
  2. The debugger should pause in the worker
  3. The worker in the Threads panel should should pause icon || to indicate paused state
  4. Open the Split Console and Evaluate globalVariable, the result should be Just a test
  5. Create Watch expression globalVariable, the result should be Just a test
  6. Select the Main Thread in the Threads panel
  7. The Watch expression globalVariable value should be undefined
  8. Open the Split Console and Evaluate globalVariable, the value should be undefined
  9. You can explicitly stop the worker by clicking on this button

Test Case #3 - Create BP in a worker

  1. Click this button to start a worker
  2. Find worker3.js in the Sources panel and create a breakpoint on line 11 (within onmessage function)
  3. Click this button to send a message to the worker
  4. The BP should hit and status of the worker should be paused (in the Threads panel)
  5. You can explicitly stop the worker by clicking on this button

Test Case #4 - XHR from a worker

  1. Click this button to start a worker
  2. The worker immediately executes HTTP requests to get current time current-time.php and repeats it every 10 sec.
  3. You should also see worker-xhr.js in the Sources panel as well as in the Threads panel in the Debugger
  4. Click this button to send a message to the worker and execute custom XHR to get simple text response text-response.php
  5. You can explicitly stop the worker by clicking on this button


Tips for other test cases

  1. The Call stack and Scopes side panel should be properly updated when switching between paused and resumed workers
  2. Full debugging functionality should work (Variable Preview, Console expressions, WASM, etc)
  3. Reloading the page when a worker is paused should not break the Debugger
  4. Worker created within a worker should work as expected