blob: 78ed9e4ca2a674afe3b5d4e49fe0155a386b2918 [file] [log] [blame]
<!doctype html>
<title>WebSockets: close() several times</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../../../constants.js?pipe=sub></script>
<div id=log></div>
<script>
var i = 0;
async_test(function(t) {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
ws.onclose = function(e) {
i++;
}
ws.close();
ws.close();
ws.close();
var f = t.step_func(function() {
if (i < 1) {
setTimeout(f, 500);
return;
}
assert_equals(i, 1);
t.done()
});
setTimeout(f, 500);
});
</script>