Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255

This commit is contained in:
James Graham 2015-03-27 09:15:38 +00:00
parent b2a5225831
commit 1a81b18b9f
12321 changed files with 544385 additions and 6 deletions

View file

@ -0,0 +1,22 @@
<!doctype html>
<title>WebSockets: close()</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>
async_test(function(t) {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
ws.onclose = t.step_func(function(e) {
assert_equals(e instanceof CloseEvent, true, 'e instanceof CloseEvent');
assert_equals(e.wasClean, false, 'e.wasClean');
e.wasClean = true;
assert_equals(e.wasClean, false, 'e.wasClean = true');
delete e.wasClean;
assert_equals(e.wasClean, false, 'delete e.wasClean');
t.done();
});
ws.close();
assert_equals(ws.readyState, ws.CLOSING);
}, undefined, {timeout:9900});
</script>

View file

@ -0,0 +1,23 @@
<!doctype html>
<title>WebSockets: close() when connecting</title>
<meta name=timeout content=long>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../../../constants.js?pipe=sub></script>
<div id=log></div>
<script>
async_test(function(t) {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/sleep_10_v13');
setTimeout(t.step_func(function() {
assert_equals(ws.readyState, ws.CONNECTING);
ws.close();
assert_equals(ws.readyState, ws.CLOSING);
ws.onclose = t.step_func(function(e) {
assert_equals(ws.readyState, ws.CLOSED);
assert_equals(e.wasClean, false);
t.done();
});
}), 1000);
ws.onopen = ws.onclose = t.step_func(assert_unreached);
}, undefined, {timeout:12000});
</script>

View file

@ -0,0 +1,22 @@
<!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();
setTimeout(t.step_func(function() {
assert_equals(i, 1);
t.done()
}), 50);
});
</script>

View file

@ -0,0 +1,26 @@
<!doctype html>
<title>WebSockets: close() in close event handler</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>
async_test(function(t) {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
var i = 0;
ws.onclose = t.step_func(function(e) {
i++;
if (i == 1) {
assert_equals(ws.readyState, ws.CLOSED);
ws.close();
assert_equals(ws.readyState, ws.CLOSED);
}
setTimeout(t.step_func(function() {
assert_equals(i, 1);
t.done();
}), 50);
});
ws.close();
assert_equals(ws.readyState, ws.CLOSING);
}, undefined, {timeout:9900});
</script>

View file

@ -0,0 +1,13 @@
<!doctype html>
<title>WebSockets: replacing close</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>
test(function() {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
ws.close = 5;
assert_equals(ws.close, 5);
});
</script>

View file

@ -0,0 +1,12 @@
<!doctype html>
<title>WebSockets: close() return value</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>
test(function() {
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
assert_equals(ws.close(), undefined);
});
</script>