test_driver is only designed to work on the window context. Which is fine as many webdriver commands like moving pointers only makes sense there, but set_permission is often required also for workers to enable certain features there, e.g. service worker-specific showNotification() behind notification permission.
Perhaps we can:
- Provide some way to tunnel the test_driver requests to the main thread as
service_worker_test() does?
- Or provide a way to run a script on the main window before starting the tests in the worker context?