blob: f0dd4e6c1b2e1a5039b21f3b3c13e01eef397105 [file] [log] [blame]
<!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>