chromium/third_party/blink/web_tests/http/tests/websocket/binary-type.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 WebSocket.binaryType attribute.");

var ws = new WebSocket("ws://localhost:8880/simple");
shouldBeEqualToString("ws.binaryType", "blob");

ws.binaryType = "arraybuffer";
shouldBeEqualToString("ws.binaryType", "arraybuffer");

ws.binaryType = "blob";
shouldBeEqualToString("ws.binaryType", "blob");

debug("Set invalid values to binaryType. They should be ignored. No exception should be thrown.");

ws.binaryType = "Blob";
shouldBeEqualToString("ws.binaryType", "blob");

ws.binaryType = "ArrayBuffer"
shouldBeEqualToString("ws.binaryType", "blob");

ws.binaryType = "";
shouldBeEqualToString("ws.binaryType", "blob");

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