1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"/js-test-resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
9 <script type=
"text/javascript">
10 description("Checks whether SyntaxError is thrown when attempting to send too long reason.");
12 window
.jsTestIsAsync
= true;
14 var ws
= new WebSocket("ws://localhost:8880/echo");
17 for (var i
= 0; i
< 124; ++i
)
20 ws
.onopen = function()
24 ws
.close(1000, longReason
);
25 testFailed('SyntaxError should be thrown.');
27 if (e
.name
== 'SyntaxError')
28 testPassed('SyntaxError was thrown: ' + e
);
30 testFailed('Unexpected exception: ' + e
);
35 ws
.onmessage = function (event
)
38 testFailed("onmessage() was called. (message = \"" + message
+ "\")");
41 ws
.onclose = function()