Title: [94052] trunk/LayoutTests
Revision
94052
Author
[email protected]
Date
2011-08-29 23:37:56 -0700 (Mon, 29 Aug 2011)

Log Message

Fix two layout tests which fails on Qt port with latest pywebsocket.
https://bugs.webkit.org/show_bug.cgi?id=66929

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

hanging-handshake_wsh.py read socket to hang in opening handshake.
Then client initiated closing handshakes or abnormal closures caused
exception or resulted in http error response on hybi-10 compliant new
pywebsocket. Because tests finished at closure, it depends on timing
whether tests detects the error response. Actually, two tests failed on
Qt port by chance.
Essentially, hangings is unnecessary because open event must be queued
and WebSocket's readyState could not be changed to OPEN until the next
event loop is executed. That's why we can use echo_wsh.py instead of
hanging-handshake_wsh.py safely.

close-unref-websocket tests call close() before GC. These tests expect
GC cause close event. But close() itself also queues close event.
These close() are redandant. If GC doesn't cause close event, these
tests can pass by close event that close() queues. This change also
remove these redandant close() calls.

* http/tests/websocket/tests/hixie76/close-before-open.html:
Use echo_wsh.py instead of hanging-handshake_wsh.py.
* http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt:
* http/tests/websocket/tests/hixie76/close-unref-websocket.html:
Used echo_wsh.py, remove ws.close() and fix expectation.
* http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py: Removed.
* http/tests/websocket/tests/hybi/close-before-open.html:
Use echo_wsh.py instead of hanging-handshake_wsh.py.
* http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt:
* http/tests/websocket/tests/hybi/close-unref-websocket.html:
Used echo_wsh.py, remove ws.close() and fix expectation.
* http/tests/websocket/tests/hybi/hanging-handshake_wsh.py: Removed.
* http/tests/websocket/tests/hybi/close-code-and-reason.html:
* http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js:
Use echo_wsh.py instead of hanging-handshake_wsh.py.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94051 => 94052)


--- trunk/LayoutTests/ChangeLog	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/ChangeLog	2011-08-30 06:37:56 UTC (rev 94052)
@@ -1,3 +1,43 @@
+2011-08-29  Takashi Toyoshima  <[email protected]>
+
+        Fix two layout tests which fails on Qt port with latest pywebsocket.
+        https://bugs.webkit.org/show_bug.cgi?id=66929
+
+        Reviewed by Kent Tamura.
+
+        hanging-handshake_wsh.py read socket to hang in opening handshake.
+        Then client initiated closing handshakes or abnormal closures caused
+        exception or resulted in http error response on hybi-10 compliant new
+        pywebsocket. Because tests finished at closure, it depends on timing
+        whether tests detects the error response. Actually, two tests failed on
+        Qt port by chance.
+        Essentially, hangings is unnecessary because open event must be queued
+        and WebSocket's readyState could not be changed to OPEN until the next
+        event loop is executed. That's why we can use echo_wsh.py instead of
+        hanging-handshake_wsh.py safely.
+
+        close-unref-websocket tests call close() before GC. These tests expect
+        GC cause close event. But close() itself also queues close event.
+        These close() are redandant. If GC doesn't cause close event, these
+        tests can pass by close event that close() queues. This change also
+        remove these redandant close() calls.
+
+        * http/tests/websocket/tests/hixie76/close-before-open.html:
+        Use echo_wsh.py instead of hanging-handshake_wsh.py.
+        * http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt:
+        * http/tests/websocket/tests/hixie76/close-unref-websocket.html:
+        Used echo_wsh.py, remove ws.close() and fix expectation.
+        * http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py: Removed.
+        * http/tests/websocket/tests/hybi/close-before-open.html:
+        Use echo_wsh.py instead of hanging-handshake_wsh.py.
+        * http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt:
+        * http/tests/websocket/tests/hybi/close-unref-websocket.html:
+        Used echo_wsh.py, remove ws.close() and fix expectation.
+        * http/tests/websocket/tests/hybi/hanging-handshake_wsh.py: Removed.
+        * http/tests/websocket/tests/hybi/close-code-and-reason.html:
+        * http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js:
+        Use echo_wsh.py instead of hanging-handshake_wsh.py.
+
 2011-08-29  MORITA Hajime  <[email protected]>
 
         Unreviewed marking skip.

Modified: trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-before-open.html (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-before-open.html	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-before-open.html	2011-08-30 06:37:56 UTC (rev 94052)
@@ -12,7 +12,7 @@
 
 window.jsTestIsAsync = true;
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/hanging-handshake");
+var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/echo");
 ws._onclose_ = function() {
     debug("closed");
     finishJSTest();

Modified: trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt	2011-08-30 06:37:56 UTC (rev 94052)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 0: WebSocket is closed before the connection is established.
 Test if Web Socket is closed while handshaking and unreferenced, it should fire close event at most once.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket.html (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket.html	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket.html	2011-08-30 06:37:56 UTC (rev 94052)
@@ -20,11 +20,10 @@
     finishJSTest();
 };
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/hanging-handshake");
+var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/echo");
 ws._onclose_ = function() {
     countCloseEvent += 1;
 };
-ws.close();
 ws = null;
 gc();
 setTimeout("endTest()", 100);

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py	2011-08-30 06:37:56 UTC (rev 94052)
@@ -1,6 +0,0 @@
-def web_socket_do_extra_handshake(request):
-    request.connection.read()
-
-
-def web_socket_transfer_data(request):
-    pass

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


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html	2011-08-30 06:37:56 UTC (rev 94052)
@@ -15,7 +15,7 @@
     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
 
 var urls = [
-    "ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake",
+    "ws://127.0.0.1:8880/websocket/tests/hybi/echo",
     "ws://127.0.0.1:8880/websocket/tests/hybi/close-code-and-reason"
 ];
 

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html	2011-08-30 06:37:56 UTC (rev 94052)
@@ -19,7 +19,7 @@
 var codeAbnormalClosure = 1006;
 var emptyString = "";
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake");
+var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
 
 ws._onopen_ = function(event)
 {

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt	2011-08-30 06:37:56 UTC (rev 94052)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 0: WebSocket is closed before the connection is established.
 Test if Web Socket is closed while handshaking and unreferenced, it should fire close event at most once.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket.html (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket.html	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket.html	2011-08-30 06:37:56 UTC (rev 94052)
@@ -22,11 +22,10 @@
     finishJSTest();
 };
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake");
+var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
 ws._onclose_ = function() {
     countCloseEvent += 1;
 };
-ws.close();
 ws = null;
 gc();
 setTimeout("endTest()", 100);

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py	2011-08-30 06:37:56 UTC (rev 94052)
@@ -1,6 +0,0 @@
-def web_socket_do_extra_handshake(request):
-    request.connection.read()
-
-
-def web_socket_transfer_data(request):
-    pass

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js (94051 => 94052)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js	2011-08-30 06:29:16 UTC (rev 94051)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js	2011-08-30 06:37:56 UTC (rev 94052)
@@ -12,7 +12,7 @@
     postMessage(message);
 }
 
-var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/hanging-handshake");
+var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
 
 ws._onopen_ = function(event)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to