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 websocket origin in a worker #9535

Closed
Manishearth opened this issue Feb 4, 2016 · 3 comments
Closed

Add test for websocket origin in a worker #9535

Manishearth opened this issue Feb 4, 2016 · 3 comments
Labels
C-assigned There is someone working on resolving the issue C-needs-test E-less-complex Straightforward. Recommended for a new contributor.

Comments

@Manishearth
Copy link
Member

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, call done() 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.

@Manishearth Manishearth added E-less-complex Straightforward. Recommended for a new contributor. C-needs-test labels Feb 4, 2016
@g-k
Copy link
Contributor

g-k commented Feb 23, 2016

@Manishearth
Copy link
Member Author

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.

@g-k
Copy link
Contributor

g-k commented Feb 24, 2016

Gotcha, I can pick this up if no one else is working on it.

@Manishearth Manishearth added the C-assigned There is someone working on resolving the issue label Feb 24, 2016
g-k added a commit to g-k/servo that referenced this issue Feb 24, 2016
g-k added a commit to g-k/servo that referenced this issue Feb 24, 2016
g-k added a commit to g-k/servo that referenced this issue Feb 27, 2016
g-k added a commit to g-k/servo that referenced this issue Feb 29, 2016
bors-servo pushed a commit that referenced this issue Mar 14, 2016
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 -->
Ms2ger pushed a commit to web-platform-tests/wpt that referenced this issue Mar 15, 2016
ivanzr pushed a commit to ivanzr/web-platform-tests that referenced this issue Jun 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-assigned There is someone working on resolving the issue C-needs-test E-less-complex Straightforward. Recommended for a new contributor.
Projects
None yet
Development

No branches or pull requests

2 participants