Service Worker Test Page

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 service-worker.js (active) file
  4. You can unregister the service worker from about:debugging page
  5. You can unregister the service worker by clicking on this button: (in case the worker was registered in this page session)

Test Case #2 - Worker State

  1. Assuming that the worker is registered from the test case #1
  2. Open Firefox Developer tools and select the Debugger panel
  3. Create BP in service-worker.js, line 33
  4. Open about:debugging page and unregister the service worker
  5. Click this button , the BP should hit
  6. Check out the Threads side panel, it should show service-worker.js (installing) - the state should be OK
  7. Resume Debugger
  8. Check out the Threads side panel, it should show service-worker.js (active) - the state should be OK

Test Case #3 - Scope

  1. Assuming that the worker is registered and active from the test case #1
  2. Open Firefox Developer tools and select the Debugger panel
  3. The Threads side panel should show service-worker.js (active) and Main Thread
  4. Create new expression in the Watch panel this
  5. Change selection in the Threads panel, the value of this expression should change to ServiceWorkerGlobalScope for the worker and Window for the main thread.


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
  5. Source file for the worker should be available in the Sources tree when the worker is registered. It should disappear when it's unregistered.
  6. See other test cases related to regular workers

Other test pages

  1. Regular workers test cases
  2. Waiting worker (good for seeing worker states)
  3. Nested worker
  4. Sending messages between workers