As far as I can tell, protocol is empty in all existing tests.
Created attachment 44381 [details] Add tests that WebSocket protocol argument works.
style-queue ran check-webkit-style on attachment 44381 [details] without any errors.
(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 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.
Committed r51837: <http://trac.webkit.org/changeset/51837>