Title: [93505] trunk/LayoutTests
Revision
93505
Author
[email protected]
Date
2011-08-22 05:06:38 -0700 (Mon, 22 Aug 2011)

Log Message

[Chromium] [WebSocket] Add a test to reproduce chromium bug on close before open.
https://bugs.webkit.org/show_bug.cgi?id=66649

Patch by Takashi Toyoshima <[email protected]> on 2011-08-22
Reviewed by Kent Tamura.

* http/tests/websocket/tests/hybi/close-before-open-expected.txt:
* http/tests/websocket/tests/hybi/close-before-open.html:
Add new URL to reproduce the problem.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93504 => 93505)


--- trunk/LayoutTests/ChangeLog	2011-08-22 12:03:19 UTC (rev 93504)
+++ trunk/LayoutTests/ChangeLog	2011-08-22 12:06:38 UTC (rev 93505)
@@ -1,3 +1,14 @@
+2011-08-22  Takashi Toyoshima  <[email protected]>
+
+        [Chromium] [WebSocket] Add a test to reproduce chromium bug on close before open.
+        https://bugs.webkit.org/show_bug.cgi?id=66649
+
+        Reviewed by Kent Tamura.
+
+        * http/tests/websocket/tests/hybi/close-before-open-expected.txt:
+        * http/tests/websocket/tests/hybi/close-before-open.html:
+        Add new URL to reproduce the problem.
+
 2011-08-18  Pavel Podivilov  <[email protected]>
 
         Web Inspector: extract breakpoint management code to a separate class and add tests.

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open-expected.txt (93504 => 93505)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open-expected.txt	2011-08-22 12:03:19 UTC (rev 93504)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open-expected.txt	2011-08-22 12:06:38 UTC (rev 93505)
@@ -1,9 +1,11 @@
 CONSOLE MESSAGE: line 0: WebSocket is closed before the connection is established.
+CONSOLE MESSAGE: line 0: WebSocket is closed before the connection is established.
 Test if Web Socket fires close event when WebSocket is opened and closed fore open event is received.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-closed
+closed on test 1
+closed on test 2
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html (93504 => 93505)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html	2011-08-22 12:03:19 UTC (rev 93504)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html	2011-08-22 12:06:38 UTC (rev 93505)
@@ -14,13 +14,28 @@
 if (window.layoutTestController)
     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake");
-ws._onclose_ = function() {
-    debug("closed");
-    finishJSTest();
+var urls = [
+    "ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake",
+    "ws://127.0.0.1:8880/websocket/tests/hybi/close-code-and-reason"
+];
+
+var testId = 0;
+
+var test = function() {
+    if (0 != testId)
+        debug("closed on test " + testId);
+    if (2 == testId)
+        finishJSTest();
+    else {
+        ws = new WebSocket(urls[testId++]);
+        ws._onclose_ = test;
+        ws.close();
+    }
 };
+
+test();
+
 var successfullyParsed = true;
-ws.close();
 </script>
 <script src=""
 </body>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to