Bug 32055 - Add test for cross-origin WebSocket usage
Summary: Add test for cross-origin WebSocket usage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 00:22 PST by Fumitoshi Ukai
Modified: 2009-12-06 18:25 PST (History)
2 users (show)

See Also:


Attachments
Add tests for cross-origin WebSocket usage (13.23 KB, patch)
2009-12-03 21:16 PST, Fumitoshi Ukai
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fumitoshi Ukai 2009-12-02 00:22:32 PST
Add many new tests for cross-origin WebSocket usage to check that it functions correctly.
Comment 1 Alexey Proskuryakov 2009-12-02 11:27:50 PST
Some existing tests (e.g. frame-length-skip) currently use ws://localhost:8880 - these need to be evaluated for correctness, too.
Comment 2 Fumitoshi Ukai 2009-12-03 21:16:45 PST
Created attachment 44287 [details]
Add tests for cross-origin WebSocket usage
Comment 3 WebKit Review Bot 2009-12-03 21:17:56 PST
style-queue ran check-webkit-style on attachment 44287 [details] without any errors.
Comment 4 Alexey Proskuryakov 2009-12-04 13:00:45 PST
Both ws://localhost:8880 and ws://127.0.0.1:8880 are cross-origin if the test itself is served from http://127.0.0.1:8000. So, changing one for another doesn't seem to make much sense.

I got somewhat confused about how origin-based authentication works for WebSocket - unlike XMLHttpRequest, it doesn't have a "only same origin" legacy, so it doesn't matter which server URL to use.
Comment 5 Alexey Proskuryakov 2009-12-04 13:07:46 PST
And now I just realized that the tests are loaded from ws://127.0.0.1:8880, sorry for the noise.

Maybe we could change the port for websocket tests to not look that similar to port 8000?
Comment 6 Alexey Proskuryakov 2009-12-04 13:33:11 PST
Comment on attachment 44287 [details]
Add tests for cross-origin WebSocket usage

Looks good, r=me.

One general note: it would be nice if parts of _wsh.py scripts' functionality could be shared between tests. We could use URL queries to pass parameters to them.

Of course, combining them all into one script should not be a goal, but reducing the number of files necessary for an average test would be good.
Comment 7 Fumitoshi Ukai 2009-12-06 18:23:05 PST
Committed r51743: <http://trac.webkit.org/changeset/51743>
Comment 8 Fumitoshi Ukai 2009-12-06 18:25:56 PST
(In reply to comment #6)
> (From update of attachment 44287 [details])
> Looks good, r=me.

Thanks for review!

> 
> One general note: it would be nice if parts of _wsh.py scripts' functionality
> could be shared between tests. We could use URL queries to pass parameters to
> them.
> 
> Of course, combining them all into one script should not be a goal, but
> reducing the number of files necessary for an average test would be good.

Agree.
I'll create another patch.