Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for calling worker constructor from a shared worker. #50017

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

fred-wang
Copy link
Contributor

See https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface

  • Calling the Worker constructor from Window is covered by worker-constructor.html
  • Calling the Worker constructor from a DedicatedWorker is covered by WorkerGlobalScope-worker-constructor.html
  • This patch extends the previous test to also cover the case when the Worker constructor is called from a SharedWorker.

w3c/trusted-types#567

See https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface

- Calling the Worker constructor from Window is covered by
  worker-constructor.html
- Calling the Worker constructor from a DedicatedWorker is covered by
  WorkerGlobalScope-worker-constructor.html
- This patch extends the previous test to also cover the case when
  the Worker constructor is called from a SharedWorker.

w3c/trusted-types#567
Copy link
Member

@lukewarlow lukewarlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm assuming it passes :)

@fred-wang
Copy link
Contributor Author

mmh, I actually forgot to add the actual sink check will do it now...

@fred-wang
Copy link
Contributor Author

Lgtm assuming it passes :)

It passes in Firefox with my my extra dev patches.

Trying in Chromium release and Safari Tech preview, the trusted type check seems to fail for the Worker constructor in workers. And Worker does not seem to be exposed at all to SharedWorker (which is not related to TT). I believe I saw similar issues for other worker tests like importScripts.

@fred-wang fred-wang merged commit 13cc1fb into master Jan 10, 2025
19 checks passed
@fred-wang fred-wang deleted the worker-constructor-in-shared-worker-scope branch January 10, 2025 09:46
sadym-chromium pushed a commit that referenced this pull request Jan 14, 2025
* Add test for calling worker constructor from a shared worker.

See https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface

- Calling the Worker constructor from Window is covered by
  worker-constructor.html
- Calling the Worker constructor from a DedicatedWorker is covered by
  WorkerGlobalScope-worker-constructor.html
- This patch extends the previous test to also cover the case when
  the Worker constructor is called from a SharedWorker.

w3c/trusted-types#567

* actually perform check for the sink value...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants