<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../js-test-resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
description("Checks whether unpaired surrogates are replaced with U+FFFD.");

window.jsTestIsAsync = true;

var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/echo");
var message;

ws.onopen = function()
{
    debug("Connected.");
    ws.send("\uD807");
};

ws.onmessage = function (event)
{
    message = event.data;
    shouldBe("message", "'\uFFFD'");
    ws.close();
};

ws.onclose = function()
{
    finishJSTest();
};

</script>
<script src="../../../../js-test-resources/js-test-post.js"></script>
</body>
</html>
