Bug 88744

Summary: [WebSocket] WebSocket object in Worker Context should fire error event when it fails connection.
Product: WebKit Reporter: Li Yin <li.yin>
Component: WebCore Misc.Assignee: Li Yin <li.yin>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, levin+threading, tkent, toyoshim, webkit.review.bot, yutak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 87336    
Attachments:
Description Flags
Patch
none
Patch none

Description Li Yin 2012-06-10 20:14:56 PDT
Spec:http://dev.w3.org/html5/websockets/#feedback-from-the-protocol
If the user agent was required to fail the websocket connection or the WebSocket connection is closed with prejudice, fire a simple event named error at the WebSocket object.

This bug is similar with Bug 86958, but it is still required to fix in Worker Context.
Comment 1 Li Yin 2012-06-10 20:40:18 PDT
Created attachment 146770 [details]
Patch
Comment 2 Yuta Kitamura 2012-06-11 00:39:52 PDT
Comment on attachment 146770 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=146770&action=review

Looks okay except for one nitpick.

> LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close.js:14
> +function testPassed(message)
> +{
> +    postMessage("Pass: " + message);
> +}

The output should look similar to postResult()'s.
Comment 3 Li Yin 2012-06-11 00:43:52 PDT
(In reply to comment #2)
> (From update of attachment 146770 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=146770&action=review
> 
> Looks okay except for one nitpick.
> 
> > LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close.js:14
> > +function testPassed(message)
> > +{
> > +    postMessage("Pass: " + message);
> > +}
> 
> The output should look similar to postResult()'s.

OK, I will change the style, thanks for your review.
Comment 4 Li Yin 2012-06-11 00:51:44 PDT
(In reply to comment #2)
> (From update of attachment 146770 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=146770&action=review
> 
> Looks okay except for one nitpick.
> 
> > LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close.js:14
> > +function testPassed(message)
> > +{
> > +    postMessage("Pass: " + message);
> > +}
> 
> The output should look similar to postResult()'s.

postResult()'s style looks strange.
PASS PASS: ****, maybe one PASS is enough.
Maybe style of http/tests/websocket/tests/hybi/close.html looks more nice :)
Comment 5 Li Yin 2012-06-11 00:59:04 PDT
Created attachment 146803 [details]
Patch
Comment 6 Li Yin 2012-06-12 15:29:08 PDT
Hi Kent,
   Could you have a look? 
   Thanks in advance.
Comment 7 Li Yin 2012-06-13 23:50:52 PDT
Thanks Kent for your review.
Comment 8 WebKit Review Bot 2012-06-14 00:22:26 PDT
Comment on attachment 146803 [details]
Patch

Clearing flags on attachment: 146803

Committed r120291: <http://trac.webkit.org/changeset/120291>
Comment 9 WebKit Review Bot 2012-06-14 00:22:31 PDT
All reviewed patches have been landed.  Closing bug.