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 websocket origin in a worker #9535
Comments
Not sure if a couple of the links are broken for anyone else, but these work for me: |
Yeah, so the former is an example of a test which tests the websocket's origin, the latter is an example of a .worker.js test which runs from a worker (but doesn't test the origin). This issue is asking for a test that does both -- runs a websocket in a worker scope and checks that the origin is correctly set. |
Gotcha, I can pick this up if no one else is working on it. |
test websocket origin set in worker Fixes #9535 This crashes and I'm not sure how to debug it (and whether it's a problem with the browser or more likely a problem with the test): ``` ./mach test-wpt /websockets/opening-handshake/003-sets-origin.worker --log-raw wpt.log Running 1 tests in web-platform-tests ▶ CRASH [expected OK] /websockets/opening-handshake/003-sets-origin.worker Ran 1 tests finished in 2.0 seconds. • 0 ran as expected. 0 tests skipped. • 1 tests crashed unexpectedly ``` Also, should the test file be in `/websockets/` or `/websockets/opening-handshake/`? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9737) <!-- Reviewable:end -->
We should add a .worker.js test that ensures that a websocket's origin is correctly set when used from a worker.
.worker.js tests are automatically run in a worker context. and look like this
We already have https://github.com/Manishearth/servo/blob/ws-worker/tests/wpt/web-platform-tests/websockets/opening-handshake/003.html to test the origin; we need to write a similar test in a .worker.js context (use
importScript
instead of script tags, calldone()
when the test is over)Be sure to add it to the manifest like so. The test can be run with
./mach test-wpt /websockets/name-of-test.worker
.The text was updated successfully, but these errors were encountered: