Changeset 120291 in webkit
- Timestamp:
- Jun 14, 2012 12:22:09 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r120287 r120291 1 2012-06-14 Li Yin <li.yin@intel.com> 2 3 [WebSocket] WebSocket object in Worker Context should fire error event when it fails connection. 4 https://bugs.webkit.org/show_bug.cgi?id=88744 5 6 Reviewed by Kent Tamura. 7 8 * http/tests/websocket/tests/hybi/workers/close-expected.txt: 9 * http/tests/websocket/tests/hybi/workers/resources/close.js: 10 (testPassed): 11 (runCodeTest.else.ws.onerror): 12 (runCodeTest): 13 (runReasonTest.else.ws.onerror): 14 (runReasonTest): 15 1 16 2012-06-13 Zan Dobersek <zandobersek@gmail.com> 2 17 -
trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/close-expected.txt
r110037 r120291 46 46 Code NaN must cause INVALID_ACCESS_ERR. 47 47 PASS PASS: worker: exceptionName is invalidAccessErr 48 PASS PASS: onerror() was called. 48 49 runCodeTest: onclose(). 49 50 PASS PASS: worker: closeEvent.code is abnormalClosure … … 60 61 PASS PASS: worker: exceptionName is syntaxErr 61 62 Reason test: 2 63 PASS PASS: onerror() was called. 62 64 runReasonTest: onclose(). 63 65 PASS PASS: worker: closeEvent.code is abnormalClosure -
trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close.js
r94387 r120291 7 7 message += expected; 8 8 postMessage(message); 9 } 10 11 function testPassed(message) 12 { 13 postMessage("PASS: " + message); 9 14 } 10 15 … … 111 116 runInvalidStringTest(); 112 117 }; 118 ws.onerror = function () 119 { 120 testPassed("onerror() was called."); 121 }; 113 122 } 114 123 try { … … 147 156 if (closeEvent.code == abnormalClosure) 148 157 runCodeAndReasonTest(); 158 }; 159 ws.onerror = function () 160 { 161 testPassed("onerror() was called."); 149 162 }; 150 163 } -
trunk/Source/WebCore/ChangeLog
r120289 r120291 1 2012-06-14 Li Yin <li.yin@intel.com> 2 3 [WebSocket] WebSocket object in Worker Context should fire error event when it fails connection. 4 https://bugs.webkit.org/show_bug.cgi?id=88744 5 6 Reviewed by Kent Tamura. 7 8 Spec:http://dev.w3.org/html5/websockets/#feedback-from-the-protocol 9 The behavior of firing error event in Document has been implemented in Committed r117944. 10 WebSocket in WorkerContext is also required to fire error event. 11 12 Test: http/tests/websocket/tests/hybi/workers/close.html 13 14 * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp: 15 (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageError): 16 (WebCore): 17 (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback): 18 * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: 19 (ThreadableWebSocketChannelClientWrapper): 20 * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: 21 (WebCore::workerContextDidReceiveMessageError): 22 (WebCore): 23 (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): 24 * Modules/websockets/WorkerThreadableWebSocketChannel.h: 25 (Peer): 26 1 27 2012-06-13 Kinuko Yasuda <kinuko@chromium.org> 2 28 -
trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
r116908 r120291 206 206 } 207 207 208 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageError() 209 { 210 m_pendingTasks.append(createCallbackTask(&didReceiveMessageErrorCallback, this)); 211 if (!m_suspended) 212 processPendingTasks(); 213 } 214 208 215 void ThreadableWebSocketChannelClientWrapper::suspend() 209 216 { … … 281 288 } 282 289 290 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(ScriptExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper> wrapper) 291 { 292 ASSERT_UNUSED(context, !context); 293 if (wrapper->m_client) 294 wrapper->m_client->didReceiveMessageError(); 295 } 296 283 297 } // namespace WebCore 284 298 -
trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h
r114215 r120291 89 89 void didStartClosingHandshake(); 90 90 void didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus, unsigned short code, const String& reason); 91 void didReceiveMessageError(); 91 92 92 93 void suspend(); … … 105 106 static void didCloseCallback(ScriptExecutionContext*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus, unsigned short code, const String& reason); 106 107 static void processPendingTasksCallback(ScriptExecutionContext*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>); 108 static void didReceiveMessageErrorCallback(ScriptExecutionContext*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>); 107 109 108 110 ScriptExecutionContext* m_context; -
trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
r114215 r120291 346 346 } 347 347 348 static void workerContextDidReceiveMessageError(ScriptExecutionContext* context, PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper) 349 { 350 ASSERT_UNUSED(context, context->isWorkerContext()); 351 workerClientWrapper->didReceiveMessageError(); 352 } 353 354 void WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError() 355 { 356 ASSERT(isMainThread()); 357 m_loaderProxy.postTaskForModeToWorkerContext(createCallbackTask(&workerContextDidReceiveMessageError, m_workerClientWrapper), m_taskMode); 358 } 359 348 360 WorkerThreadableWebSocketChannel::Bridge::Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, PassRefPtr<WorkerContext> workerContext, const String& taskMode) 349 361 : m_workerClientWrapper(workerClientWrapper) -
trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h
r114215 r120291 107 107 virtual void didStartClosingHandshake() OVERRIDE; 108 108 virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE; 109 virtual void didReceiveMessageError() OVERRIDE; 109 110 110 111 private:
Note: See TracChangeset
for help on using the changeset viewer.