Bug 1498467 [wpt PR 13478] - Remove the "W3C WebSocket API" prefix from websockets...
[gecko.git] / testing / web-platform / tests / websockets / Secure-Close-Reason-124Bytes.any.js
blob0786c295e760c3af2cb4994267974f62c6f004c1
1 // META: script=websocket.sub.js
3 var test = async_test("Create Secure WebSocket - Close the Connection - close(code, 'reason more than 123 bytes') - SYNTAX_ERR is thrown");
5 var wsocket = CreateWebSocket(true, false, false);
6 var isOpenCalled = false;
8 wsocket.addEventListener('open', test.step_func(function(evt) {
9   var reason = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123";
10   assert_equals(reason.length, 124);
11   assert_throws("SYNTAX_ERR", function() {
12     wsocket.close(1000, reason)
13   });
14   test.done();
15 }), true);