Fix two layout tests which fails on Qt port with latest pywebsocket.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2011 06:37:56 +0000 (06:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Aug 2011 06:37:56 +0000 (06:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66929

Patch by Takashi Toyoshima <toyoshim@chromium.org> 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94052 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/websocket/tests/hixie76/close-before-open.html
LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket-expected.txt
LayoutTests/http/tests/websocket/tests/hixie76/close-unref-websocket.html
LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py [deleted file]
LayoutTests/http/tests/websocket/tests/hybi/close-before-open.html
LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html
LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket-expected.txt
LayoutTests/http/tests/websocket/tests/hybi/close-unref-websocket.html
LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py [deleted file]
LayoutTests/http/tests/websocket/tests/hybi/workers/resources/close-code-and-reason.js

index 3cd8319..ade7f6d 100644 (file)
@@ -1,3 +1,43 @@
+2011-08-29  Takashi Toyoshima  <toyoshim@chromium.org>
+
+        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  <morrita@google.com>
 
         Unreviewed marking skip.
index 216997f..26f3c7e 100644 (file)
@@ -12,7 +12,7 @@ description("Test if Web Socket fires close event when WebSocket is opened and c
 
 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();
index 39f5555..fc148b0 100644 (file)
@@ -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".
index 4ef23d1..7c5dac1 100644 (file)
@@ -20,11 +20,10 @@ function endTest()
     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);
diff --git a/LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py b/LayoutTests/http/tests/websocket/tests/hixie76/hanging-handshake_wsh.py
deleted file mode 100644 (file)
index 8391bd8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-def web_socket_do_extra_handshake(request):
-    request.connection.read()
-
-
-def web_socket_transfer_data(request):
-    pass
index e4e67df..ccdb5f4 100644 (file)
@@ -15,7 +15,7 @@ if (window.layoutTestController)
     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"
 ];
 
index d288eb5..9db9e11 100644 (file)
@@ -19,7 +19,7 @@ var codeNoStatusRcvd = 1005;
 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)
 {
index 39f5555..fc148b0 100644 (file)
@@ -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".
index 4c936f5..9c30b83 100644 (file)
@@ -22,11 +22,10 @@ function endTest()
     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);
diff --git a/LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py b/LayoutTests/http/tests/websocket/tests/hybi/hanging-handshake_wsh.py
deleted file mode 100644 (file)
index 8391bd8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-def web_socket_do_extra_handshake(request):
-    request.connection.read()
-
-
-def web_socket_transfer_data(request):
-    pass
index ad9c7d7..c540ff2 100644 (file)
@@ -12,7 +12,7 @@ function postResult(result, actual, expected)
     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)
 {