2 <title>WebSockets: response header and close frame in same packet
</title>
3 <script src=/resources/testharness.js
></script>
4 <script src=/resources/testharnessreport.js
></script>
5 <script src=../constants.js?pipe=sub
></script>
6 <meta name=
"variant" content=
"">
7 <meta name=
"variant" content=
"?wss">
10 async_test(function(t
) {
11 var ws
= new WebSocket(SCHEME_DOMAIN_PORT
+'/simple_handshake');
12 ws
.onmessage
= t
.unreached_func();
13 ws
.onopen
= t
.step_func(function(e
) {
14 ws
.onclose
= t
.step_func(function(e
) {
15 assert_equals(e
.wasClean
, true);
16 assert_equals(e
.code
, 1001);
17 assert_equals(e
.reason
, 'PASS');
18 ws
.onclose
= t
.unreached_func('onclose should not be called twice');
19 t
.step_timeout(() => t
.done(), 50);
23 ws
.onclose
= t
.unreached_func('onclose should not be called before onopen');