Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html

Issue 101143002: Remove hybi sub directory for WebSocket layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html
diff --git a/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html b/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html
deleted file mode 100644
index 5a90432c6e997724c9e7a8df65aee72f0a6c5b74..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/websocket/tests/hybi/close-code-and-reason.html
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<script src="/js-test-resources/js-test.js"></script>
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-<script type="text/javascript">
-description("Test CloseEvent code and reason property.");
-
-window.jsTestIsAsync = true;
-
-var closeEvent;
-var codeNormalClosure = 1000;
-var codeNoStatusRcvd = 1005;
-var codeAbnormalClosure = 1006;
-var emptyString = "";
-
-var ws = new WebSocket("ws://127.0.0.1:8880/echo");
-
-ws.onopen = function(event)
-{
- testFailed("ws.onopen() was called. (message = \"" + event.data + "\")");
-};
-
-ws.onclose = function(event)
-{
- debug("ws.onclose() was called.");
- closeEvent = event;
- shouldBeFalse("closeEvent.wasClean");
- shouldBe("closeEvent.code", "codeAbnormalClosure");
- shouldBe("closeEvent.reason", "emptyString");
-};
-
-ws.close();
-
-var testId = 0;
-var testNum = 7;
-var sendData = [
- "-", // request close frame without code and reason
- "--", // request close frame with invalid body which size is 1
- "1000 ok", // request close frame with code 1000 and reason
- "1005 foo", // request close frame with forbidden code 1005 and reason
- "1006 bar", // request close frame with forbidden code 1006 and reason
- "1015 baz", // request clode frame with forbidden code 1015 and reason
- "65535 good bye", // request close frame with specified code and reason
-];
-var expectedCode = [
- codeNoStatusRcvd,
- codeAbnormalClosure,
- codeNormalClosure,
- codeAbnormalClosure,
- codeAbnormalClosure,
- codeAbnormalClosure,
- 65535,
-];
-var expectedReason = [
- "''",
- "''",
- "'ok'",
- "''",
- "''",
- "''",
- "'good bye'",
-];
-var expectedWasClean = [
- true,
- false,
- true,
- false,
- false,
- false,
- true,
-];
-
-WebSocketTest = function() {
- this.ws = new WebSocket("ws://127.0.0.1:8880/close-code-and-reason");
- this.ws.onopen = this.onopen;
- this.ws.onmessage = this.onmessage;
- this.ws.onclose = this.onclose;
-};
-
-WebSocketTest.prototype.onopen = function()
-{
- debug("WebSocketTest.onopen() was called with testId = " + testId + ".");
- this.send(sendData[testId]);
-};
-
-WebSocketTest.prototype.onmessage = function(event)
-{
- testFailed("WebSocketTest.onmessage() was called. (message = \"" + event.data + "\")");
-};
-
-WebSocketTest.prototype.onclose = function(event)
-{
- closeEvent = event;
- debug("WebSocketTest.onclose() was called with testId = " + testId + ".");
- shouldEvaluateTo("closeEvent.wasClean", expectedWasClean[testId]);
- shouldEvaluateTo("closeEvent.code", expectedCode[testId]);
- shouldEvaluateTo("closeEvent.reason", expectedReason[testId]);
- closeEvent.code = 0;
- closeEvent.reason = "readonly";
- closeEvent.wasClean = !closeEvent.wasClean;
- shouldEvaluateTo("closeEvent.wasClean", expectedWasClean[testId]);
- shouldEvaluateTo("closeEvent.code", expectedCode[testId]);
- shouldEvaluateTo("closeEvent.reason", expectedReason[testId]);
- testId++;
- if (testId < testNum)
- test = new WebSocketTest();
- else
- finishJSTest();
-};
-
-var test = new WebSocketTest();
-
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698