Bug 32178 - Need to test that WebSocket protocol argument works
Summary: Need to test that WebSocket protocol argument works
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-04 16:20 PST by Alexey Proskuryakov
Modified: 2009-12-08 00:32 PST (History)
3 users (show)

See Also:


Attachments
Add tests that WebSocket protocol argument works. (11.05 KB, patch)
2009-12-06 21:30 PST, Fumitoshi Ukai
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2009-12-04 16:20:20 PST
As far as I can tell, protocol is empty in all existing tests.
Comment 1 Fumitoshi Ukai 2009-12-06 21:30:53 PST
Created attachment 44381 [details]
Add tests that WebSocket protocol argument works.
Comment 2 WebKit Review Bot 2009-12-06 21:39:38 PST
style-queue ran check-webkit-style on attachment 44381 [details] without any errors.
Comment 3 Fumitoshi Ukai 2009-12-07 02:10:17 PST
(In reply to comment #1)
> Created an attachment (id=44381) [details]
> Add tests that WebSocket protocol argument works.

sub protocol name's definition is under discussion on hybi and whatwg.
I'll update a patch after the definition is fixed.
Comment 4 Darin Adler 2009-12-07 09:54:16 PST
Comment on attachment 44381 [details]
Add tests that WebSocket protocol argument works.

> +// Failes if protocol is an empty string.

Spelling error here, "Fails" or "Failures" would be right, but "Failes" is wrong.

> +// Failes if protocol contains an character less than U+0021.
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "sub protocol")');
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0009")');
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000A")');
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000D")');
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u001B")');

Seems this should have a test for the character "\u0000".

> +// Fails if protocol containns an character greater than U+007F.
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0080")');
> +shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u3042")');

Iā€™d like to see some special characters covered here like \uFFFF, \uFEFF, \uFFFE, and surrogate pairs.
Comment 5 Fumitoshi Ukai 2009-12-08 00:32:51 PST
Committed r51837: <http://trac.webkit.org/changeset/51837>