<!DOCTYPE html>
<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("WebSocket should fail if invalid subprotocols are specified");

var url = "ws://127.0.0.1:8880/websocket/tests/simple";
shouldThrowErrorName("new WebSocket(url, 'a b')", "SyntaxError");
shouldThrowErrorName("new WebSocket(url, 'a,b')", "SyntaxError");
shouldThrowErrorName("new WebSocket(url, 'a\\0b')", "SyntaxError");
shouldThrowErrorName("new WebSocket(url, '\\u3042')", "SyntaxError");
shouldThrowErrorName("new WebSocket(url, ['a', 'b', 'c d'])", "SyntaxError");
shouldThrowErrorName("new WebSocket(url, ['a', 'b', 'c', 'a'])", "SyntaxError");

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