[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 <toyoshim@chromium.org> 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.

git-svn-id: svn://svn.chromium.org/blink/trunk@93505 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7c3c46ab
2011-08-22 Takashi Toyoshima <toyoshim@chromium.org>
[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 <podivilov@chromium.org>
Web Inspector: extract breakpoint management code to a separate class and add tests.
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
......
......@@ -14,13 +14,28 @@ window.jsTestIsAsync = true;
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="../../../../js-test-resources/js-test-post.js"></script>
</body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment