mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,11 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting readyState in connecting</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(t) {
|
||||
assert_equals((new WebSocket(SCHEME_DOMAIN_PORT+'/')).readyState, WebSocket.CONNECTING);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: setting readyState</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(t) {
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
ws.readyState = 5;
|
||||
assert_equals(ws.readyState, ws.CONNECTING);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: delete readyState</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(t) {
|
||||
delete WebSocket.prototype.readyState;
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
ws.close();
|
||||
delete ws.readyState;
|
||||
assert_equals(ws.readyState, ws.CLOSING);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: defineProperty getter for readyState</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() {
|
||||
Object.defineProperty(WebSocket.prototype, 'readyState', {
|
||||
get: function() { return 'foo'; }
|
||||
});
|
||||
var ws = new WebSocket('ws://example.invalid/');
|
||||
assert_equals(ws.readyState, 'foo');
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: defineProperty setter for readyState</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(){
|
||||
window.setter_ran = false;
|
||||
Object.defineProperty(WebSocket.prototype, 'readyState', {
|
||||
set: function(v) { window[v] = true; }
|
||||
});
|
||||
var ws = new WebSocket('ws://example.invalid/');
|
||||
ws.readyState = 'setter_ran';
|
||||
assert_true(setter_ran);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting readyState in open</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+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
assert_equals(ws.readyState, ws.OPEN);
|
||||
ws.close();
|
||||
t.done();
|
||||
});
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function() {assert_unreached()});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,17 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting readyState in closing</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+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
ws.close();
|
||||
assert_equals(ws.readyState, ws.CLOSING);
|
||||
t.done();
|
||||
});
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function() {assert_unreached()});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting readyState in closed</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+'/echo');
|
||||
ws.onopen = t.step_func(function(e) {
|
||||
ws.onclose = t.step_func(function(e) {
|
||||
assert_equals(ws.readyState, ws.CLOSED);
|
||||
t.done();
|
||||
})
|
||||
ws.close();
|
||||
});
|
||||
ws.onerror = ws.onmessage = ws.onclose = t.step_func(function() {assert_unreached()});
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue