Andrew Top | 61a8495 | 2019-04-30 15:07:33 -0700 | [diff] [blame] | 1 | <!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> |
| 8 | async_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> |