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

Unified Diff: LayoutTests/http/tests/websocket/send-object-tostring-check.html

Issue 317113002: Use echo handler in send-object-tostring-check (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/send-object-tostring-check-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/websocket/send-object-tostring-check.html
diff --git a/LayoutTests/http/tests/websocket/send-object-tostring-check.html b/LayoutTests/http/tests/websocket/send-object-tostring-check.html
index e7f6e6445474b08b4515cc56fae5426c61ef449d..dd2e2df62a95b42ca3e30defaf43cab3da015f2c 100644
--- a/LayoutTests/http/tests/websocket/send-object-tostring-check.html
+++ b/LayoutTests/http/tests/websocket/send-object-tostring-check.html
@@ -4,39 +4,40 @@
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
-<div id="description"></div>
-<div id="console"></div>
<script type="text/javascript">
description("WebSocket: Object's toString method should be called only once.");
window.jsTestIsAsync = true;
-
var testObj = new function() {
this.callCounter = 0;
this.toString = function() {
this.callCounter++;
+ return "Goodbye";
};
}
-var url = "ws://127.0.0.1:8880/";
-var ws = new WebSocket(url);
-var closeEvent;
-
+var ws = new WebSocket("ws://127.0.0.1:8880/echo");
ws.onopen = function()
{
ws.send(testObj);
};
+ws.onmessage = function(event)
+{
+ shouldBeEqualToString("event.data", "Goodbye");
+};
+
ws.onclose = function(event)
{
- closeEvent = event;
shouldEvaluateTo("testObj.callCounter", 1);
+
+ window.closeEvent = event;
shouldBeTrue("closeEvent.wasClean");
+
finishJSTest();
};
-
</script>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/send-object-tostring-check-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698