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,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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>