chromium/third_party/blink/web_tests/http/tests/websocket/empty-ping.html

<!DOCTYPE HTML>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Test whether WebSocket correctly responds to an empty ping message sent from the server.");

window.jsTestIsAsync = true;

var url = "ws://localhost:8880/pong?payload=";
var ws = new WebSocket(url);
var closeEvent;
var message;

ws.onopen = function()
{
    debug("onopen() was called.");
};

ws.onmessage = function(event)
{
    message = event.data;
    debug("onmessage() was called. (message = \"" + message + "\")");
    shouldBeEqualToString("message", "PASS");
};

ws.onclose = function(event)
{
    closeEvent = event;
    shouldBeTrue("closeEvent.wasClean");
    finishJSTest();
};

</script>
</body>
</html>