diff options
Diffstat (limited to 'testing/web-platform/tests/websockets/interfaces/CloseEvent/clean-close.html')
-rw-r--r-- | testing/web-platform/tests/websockets/interfaces/CloseEvent/clean-close.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/websockets/interfaces/CloseEvent/clean-close.html b/testing/web-platform/tests/websockets/interfaces/CloseEvent/clean-close.html new file mode 100644 index 000000000..acc718516 --- /dev/null +++ b/testing/web-platform/tests/websockets/interfaces/CloseEvent/clean-close.html @@ -0,0 +1,23 @@ +<!doctype html> +<title>WebSockets: wasClean, true</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script src=../../constants.js?pipe=sub></script> +<meta name="variant" content=""> +<meta name="variant" content="?wss"> +<div id=log></div> +<script> +async_test(function(t) { + var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/echo'); + ws.onopen = t.step_func(function(e) { + ws.send('Test'); + }); + ws.onmessage = t.step_func(function(e) { + ws.close(); + }); + ws.onclose = t.step_func(function(e) { + assert_equals(e.wasClean,true); + t.done(); + }); +}, null, {timeout:2000}); +</script> |