Skip to content
Permalink
Browse files
[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.

Canonical link: https://commits.webkit.org/82487@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
toyoshim authored and webkit-commit-queue committed Aug 22, 2011
1 parent 6b71c4d commit f96045fa3747b4ad1728abb399ce56640e9b45b0
Showing 3 changed files with 34 additions and 6 deletions.
@@ -1,3 +1,14 @@
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.
@@ -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
@@ -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="../../../../js-test-resources/js-test-post.js"></script>
</body>

0 comments on commit f96045f

Please sign in to comment.