blob: 1f72417c6814d437a5831229101de3474a365c5b [file] [log] [blame]
Andrew Top61a84952019-04-30 15:07:33 -07001<!doctype html>
2<title>WebSockets: server sends closing handshake</title>
3<script src=/resources/testharness.js></script>
4<script src=/resources/testharnessreport.js></script>
5<script src=../constants.js?pipe=sub></script>
6<div id=log></div>
7<script>
8async_test(function(t){
9 var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo_exit');
10 ws.onmessage = ws.onerror = t.step_func(function() {assert_unreached()});
11 ws.onopen = t.step_func(function(e) {
12 ws.send('Goodbye');
13 })
14 ws.onclose = function(e) {
15 assert_equals(e.wasClean, true, 'e.wasClean');
16 ws.onclose = t.step_func(function() {assert_unreached()});
17
18 setTimeout(t.step_func(function() {t.done();}), 50)
19 }
20});
21</script>