mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +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,15 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting constants on constructor</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 constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function(){
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
assert_equals(WebSocket[constants[i]], i, 'WebSocket.'+constants[i]);
|
||||
}, "Constants on constructors " + constants[i]);
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: setting constants</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>
|
||||
// this test is testing WebIDL stuff
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
var constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function() {
|
||||
WebSocket[constants[i]] = 5; // should be ignored, has { ReadOnly }
|
||||
WebSocket.prototype[constants[i]] = 5; // should be ignored, has { ReadOnly }
|
||||
ws[constants[i]] = 5; // should be ignored, { ReadOnly } is inherited from prototype
|
||||
assert_equals(WebSocket[constants[i]], i, 'WebSocket.'+constants[i]);
|
||||
assert_equals(WebSocket.prototype[constants[i]], i, 'WebSocket.prototype.'+constants[i]);
|
||||
assert_equals(ws[constants[i]], i, 'ws.'+constants[i]);
|
||||
}, "Readonly constants " + constants[i]);
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: deleting constants</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 constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function(){
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
delete WebSocket[constants[i]]; // should be ignored, has { DontDelete }
|
||||
delete WebSocket.prototype[constants[i]]; // should be ignored, has { DontDelete }
|
||||
delete ws[constants[i]]; // should be ignored, there is no such property on the object
|
||||
assert_equals(WebSocket[constants[i]], i, 'WebSocket.'+constants[i]);
|
||||
assert_equals(WebSocket.prototype[constants[i]], i, 'WebSocket.prototype.'+constants[i]);
|
||||
assert_equals(ws[constants[i]], i, 'ws.'+constants[i]);
|
||||
})
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: getting constants on prototype and object</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 constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function() {
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
assert_equals(WebSocket.prototype[constants[i]], i);
|
||||
}, 'WebSocket.prototype.'+constants[i]);
|
||||
test(function() {
|
||||
var ws = new WebSocket(SCHEME_DOMAIN_PORT+'/');
|
||||
assert_equals(ws[constants[i]], i);
|
||||
}, 'ws.'+constants[i]);
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: defineProperty getter for constants</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 constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() {
|
||||
Object.defineProperty(WebSocket.prototype, constants[i], {
|
||||
get: function() { return 'foo'; }
|
||||
});
|
||||
});
|
||||
}, "defineProperty getter " + constants[i]);
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<title>WebSockets: defineProperty setter for constants</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 constants = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
|
||||
for (var i = 0; i < constants.length; ++i) {
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function(){
|
||||
Object.defineProperty(WebSocket.prototype, constants[i], {
|
||||
set: function() { return 'foo'; }
|
||||
});
|
||||
});
|
||||
}, "defineProperty setter " + constants[i])
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue