Bug 32178

Summary: Need to test that WebSocket protocol argument works
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ukai, webkit.review.bot, yuzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Add tests that WebSocket protocol argument works. darin: review+

Alexey Proskuryakov
Reported 2009-12-04 16:20:20 PST
As far as I can tell, protocol is empty in all existing tests.
Attachments
Add tests that WebSocket protocol argument works. (11.05 KB, patch)
2009-12-06 21:30 PST, Fumitoshi Ukai
darin: review+
Fumitoshi Ukai
Comment 1 2009-12-06 21:30:53 PST
Created attachment 44381 [details] Add tests that WebSocket protocol argument works.
WebKit Review Bot
Comment 2 2009-12-06 21:39:38 PST
style-queue ran check-webkit-style on attachment 44381 [details] without any errors.
Fumitoshi Ukai
Comment 3 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.
Darin Adler
Comment 4 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.
Fumitoshi Ukai
Comment 5 2009-12-08 00:32:51 PST
Note You need to log in before you can comment on or make changes to this bug.