Bug 78541

Summary: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
Product: WebKit Reporter: Alexey Proskuryakov <ap@webkit.org>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap@webkit.org>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth@webkit.org, martijn@martijnc.be, ossy@webkit.org, sam@webkit.org, toyoshim@chromium.org, ukai@chromium.org, webkit.review.bot@gmail.com, yael@webkit.org, yutak@chromium.org
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 50099    
Attachments:
Description Flags
proposed patch
none
with more ChangeLog none

Description From 2012-02-13 14:53:54 PST
With "hybi" protocol now published as RFC, it's hopefully reasonably stable.

<rdar://problem/10036695>
------- Comment #1 From 2012-02-13 16:07:08 PST -------
Created an attachment (id=126855) [details]
proposed patch
------- Comment #2 From 2012-02-13 16:14:38 PST -------
Attachment 126855 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/http..." exit_code: 1

Tools/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 72 files


If any of these errors are false positives, please file a bug against check-webkit-style.
------- Comment #3 From 2012-02-13 16:19:22 PST -------
Created an attachment (id=126859) [details]
with more ChangeLog
------- Comment #4 From 2012-02-13 17:15:50 PST -------
(From update of attachment 126859 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=126859&action=review

> LayoutTests/http/tests/websocket/tests/hixie76/alert-in-event-handler.html:14
>  window.jsTestIsAsync = true;
> +if (window.layoutTestController)
> +    layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 1);

IMO, we had better skip the hixie76 tests on platforms which enabled the RFC protocol in order to reduce testing time.
Anyway, this change is correct.
------- Comment #5 From 2012-02-13 17:31:14 PST -------
(From update of attachment 126859 [details])
Skipping tests would mean that we could easily break platforms that use a different version. Anyway, let's hope that we can bring all ports to use this version soon.
------- Comment #6 From 2012-02-14 01:51:01 PST -------
(From update of attachment 126859 [details])
Clearing flags on attachment: 126859

Committed r107689: <http://trac.webkit.org/changeset/107689>
------- Comment #7 From 2012-02-14 01:51:07 PST -------
All reviewed patches have been landed.  Closing bug.
------- Comment #8 From 2012-02-14 04:36:32 PST -------
(In reply to comment #6)
> (From update of attachment 126859 [details] [details])
> Clearing flags on attachment: 126859
> 
> Committed r107689: <http://trac.webkit.org/changeset/107689>

This change made a test fail on Qt-WK2:

--- /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/http/tests/websocket/tests/hybi/bad-sub-protocol-non-ascii-expected.txt 
+++ /ramdisk/qt-linux-32-release-webkit2/build/layout-test-results/http/tests/websocket/tests/hybi/bad-sub-protocol-non-ascii-actual.txt 
@@ -12,9 +12,9 @@
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "€") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "あ") threw exception Error: SYNTAX_ERR: DOM Exception 12.
-PASS new WebSocket("ws://127.0.0.1:8880/simple", "?") threw exception Error: SYNTAX_ERR: DOM Exception 12.
+PASS new WebSocket("ws://127.0.0.1:8880/simple", "ďżż") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "ďťż") threw exception Error: SYNTAX_ERR: DOM Exception 12.
-PASS new WebSocket("ws://127.0.0.1:8880/simple", "?") threw exception Error: SYNTAX_ERR: DOM Exception 12.
+PASS new WebSocket("ws://127.0.0.1:8880/simple", "ďżž") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "𠀋") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS successfullyParsed is true

Have you got any idea?
------- Comment #9 From 2012-02-14 10:26:49 PST -------
Qt-WK2 hasn't been running this test before this change.

Qt already has custom results here, but only because an invalid UTF-8 sequence was printed as "?", not U+FFFD. This diff shows garbage instead.

I'm not seeing this on Mac, and given that this is a difference between WK1 and WK2 on Qt, my best theory is that this is an issue in WebKitTestRunner. Seems worth investigating in a separate bug.
------- Comment #10 From 2012-02-21 08:51:32 PST -------
(In reply to comment #9)
> Qt-WK2 hasn't been running this test before this change.
> 
> Qt already has custom results here, but only because an invalid UTF-8 sequence was printed as "?", not U+FFFD. This diff shows garbage instead.
> 
> I'm not seeing this on Mac, and given that this is a difference between WK1 and WK2 on Qt, my best theory is that this is an issue in WebKitTestRunner. Seems worth investigating in a separate bug.

I filed a new bug report on in https://bugs.webkit.org/show_bug.cgi?id=79118