mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Update web-platform-tests to revision 388ba3a049a3473b1945b9f8f81e9d6e342a249e
This commit is contained in:
parent
43e21dc845
commit
bdaf11b099
139 changed files with 3089 additions and 807 deletions
|
@ -106,16 +106,22 @@ addTest(function() {
|
|||
C.location[prop]; // Shouldn't throw.
|
||||
Object.getOwnPropertyDescriptor(C.location, prop); // Shouldn't throw.
|
||||
assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), "hasOwnProperty for " + prop);
|
||||
assert_throws("SecurityError", function() { C.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
|
||||
}
|
||||
else if (prop == 'href') {
|
||||
Object.getOwnPropertyDescriptor(C.location, prop); // Shouldn't throw.
|
||||
assert_true(Object.prototype.hasOwnProperty.call(C.location, prop), "hasOwnProperty for " + prop);
|
||||
assert_throws("SecurityError", function() { C.location[prop] },
|
||||
"Should throw reading href on Location");
|
||||
}
|
||||
else {
|
||||
assert_throws("SecurityError", function() { C[prop]; }, "Should throw when accessing " + prop + " on Location");
|
||||
assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(C, prop); },
|
||||
assert_throws("SecurityError", function() { C.location[prop]; }, "Should throw when accessing " + prop + " on Location");
|
||||
assert_throws("SecurityError", function() { Object.getOwnPropertyDescriptor(C.location, prop); },
|
||||
"Should throw when accessing property descriptor for " + prop + " on Location");
|
||||
assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(C, prop); },
|
||||
assert_throws("SecurityError", function() { Object.prototype.hasOwnProperty.call(C.location, prop); },
|
||||
"Should throw when invoking hasOwnProperty for " + prop + " on Location");
|
||||
assert_throws("SecurityError", function() { C.location[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
|
||||
}
|
||||
if (prop != 'href')
|
||||
assert_throws("SecurityError", function() { C[prop] = undefined; }, "Should throw when writing to " + prop + " on Location");
|
||||
}
|
||||
}, "Only whitelisted properties are accessible cross-origin");
|
||||
|
||||
|
@ -150,11 +156,22 @@ addTest(function() {
|
|||
assert_throws(new TypeError, function() { protoSetter.call(C, new Object()); }, "proto setter |call| on cross-origin Window");
|
||||
assert_throws(new TypeError, function() { protoSetter.call(C.location, new Object()); }, "proto setter |call| on cross-origin Location");
|
||||
});
|
||||
// Hack to avoid "duplicate test name" harness issues.
|
||||
setters.forEach(function(protoSetter) {
|
||||
test(function() { protoSetter.call(C, null); },
|
||||
"proto setter |call| on cross-origin Window with null (" + protoSetter + ")");
|
||||
test(function() { protoSetter.call(C.location, null); },
|
||||
"proto setter |call| on cross-origin Location with null (" + protoSetter + ")");
|
||||
});
|
||||
if (Reflect.setPrototypeOf) {
|
||||
assert_false(Reflect.setPrototypeOf(C, new Object()),
|
||||
"Reflect.setPrototypeOf on cross-origin Window");
|
||||
assert_true(Reflect.setPrototypeOf(C, null),
|
||||
"Reflect.setPrototypeOf on cross-origin Window with null");
|
||||
assert_false(Reflect.setPrototypeOf(C.location, new Object()),
|
||||
"Reflect.setPrototypeOf on cross-origin Location");
|
||||
assert_true(Reflect.setPrototypeOf(C.location, null),
|
||||
"Reflect.setPrototypeOf on cross-origin Location with null");
|
||||
}
|
||||
}, "[[SetPrototypeOf]] should return false");
|
||||
|
||||
|
@ -230,6 +247,19 @@ addTest(function() {
|
|||
assert_equals(typeof D.then, "object");
|
||||
}, "[[GetOwnProperty]] - Subframe named 'then' should shadow the default 'then' value");
|
||||
|
||||
addTest(function() {
|
||||
assert_equals(typeof D.close, "function");
|
||||
assert_equals(typeof D.open, "object");
|
||||
}, "[[GetOwnProperty]] - Subframes should be visible cross-origin only if their names don't match the names of cross-origin-exposed IDL properties");
|
||||
|
||||
addTest(function() {
|
||||
assert_equals(typeof Object.getOwnPropertyDescriptor(C, '0').value, "object");
|
||||
assert_equals(typeof Object.getOwnPropertyDescriptor(C, '1').value, "object");
|
||||
assert_throws("SecurityError", function() {
|
||||
Object.getOwnPropertyDescriptor(C, '2');
|
||||
});
|
||||
}, "[[GetOwnProperty]] - Should be able to get a property descriptor for an indexed property only if it corresponds to a child window.");
|
||||
|
||||
/*
|
||||
* [[Delete]]
|
||||
*/
|
||||
|
|
|
@ -6,5 +6,9 @@
|
|||
<!-- A subframe to test "then" behavior -->
|
||||
<iframe name="then"></iframe>
|
||||
<iframe name="b"></iframe>
|
||||
<!-- Two subframes with names corresponding to IDL-defined properties; one
|
||||
a cross-origin-exposed property and one not exposed cross-origin -->
|
||||
<iframe name="close"></iframe>
|
||||
<iframe name="open"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue