mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326
This commit is contained in:
parent
462c272380
commit
1f531f66ea
5377 changed files with 174916 additions and 84369 deletions
|
@ -3,13 +3,22 @@
|
|||
self.getterRejects = (t, obj, getterName, target) => {
|
||||
const getter = Object.getOwnPropertyDescriptor(obj, getterName).get;
|
||||
|
||||
return promise_rejects(t, new TypeError(), getter.call(target));
|
||||
return promise_rejects(t, new TypeError(), getter.call(target), getterName + ' should reject with a TypeError');
|
||||
};
|
||||
|
||||
self.getterRejectsForAll = (t, obj, getterName, targets) => {
|
||||
return Promise.all(targets.map(target => getterRejects(t, obj, getterName, target)));
|
||||
};
|
||||
|
||||
self.methodRejects = (t, obj, methodName, target, args) => {
|
||||
const method = obj[methodName];
|
||||
|
||||
return promise_rejects(t, new TypeError(), method.apply(target, args));
|
||||
return promise_rejects(t, new TypeError(), method.apply(target, args),
|
||||
methodName + ' should reject with a TypeError');
|
||||
};
|
||||
|
||||
self.methodRejectsForAll = (t, obj, methodName, targets, args) => {
|
||||
return Promise.all(targets.map(target => methodRejects(t, obj, methodName, target, args)));
|
||||
};
|
||||
|
||||
self.getterThrows = (obj, getterName, target) => {
|
||||
|
@ -18,12 +27,21 @@ self.getterThrows = (obj, getterName, target) => {
|
|||
assert_throws(new TypeError(), () => getter.call(target), getterName + ' should throw a TypeError');
|
||||
};
|
||||
|
||||
self.getterThrowsForAll = (obj, getterName, targets) => {
|
||||
targets.forEach(target => getterThrows(obj, getterName, target));
|
||||
}
|
||||
|
||||
self.methodThrows = (obj, methodName, target, args) => {
|
||||
const method = obj[methodName];
|
||||
assert_equals(typeof method, 'function', methodName + ' should exist');
|
||||
|
||||
assert_throws(new TypeError(), () => method.apply(target, args), methodName + ' should throw a TypeError');
|
||||
};
|
||||
|
||||
self.methodThrowsForAll = (obj, methodName, targets, args) => {
|
||||
targets.forEach(target => methodThrows(obj, methodName, target, args));
|
||||
}
|
||||
|
||||
self.garbageCollect = () => {
|
||||
if (self.gc) {
|
||||
// Use --expose_gc for V8 (and Node.js)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue