Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee

This commit is contained in:
WPT Sync Bot 2018-04-23 21:13:37 -04:00
parent c5f7c9ccf3
commit e891345f26
1328 changed files with 36632 additions and 20588 deletions

View file

@ -554,8 +554,9 @@ IdlArray.prototype.is_json_type = function(type)
function exposure_set(object, default_set) {
var exposed = object.extAttrs.filter(function(a) { return a.name == "Exposed" });
if (exposed.length > 1 || exposed.length < 0) {
throw new IdlHarnessError("Unexpected Exposed extended attributes on " + memberName + ": " + exposed);
if (exposed.length > 1) {
throw new IdlHarnessError(
`Multiple 'Exposed' extended attributes on ${object.name}`);
}
if (exposed.length === 0) {
@ -603,7 +604,6 @@ IdlArray.prototype.assert_throws = function(error, idlArrayFunc)
{
try {
idlArrayFunc.call(this, this);
throw new IdlHarnessError(`${idlArrayFunc} did not throw the expected IdlHarnessError`);
} catch (e) {
if (e instanceof AssertionError) {
throw e;
@ -613,9 +613,11 @@ IdlArray.prototype.assert_throws = function(error, idlArrayFunc)
error = error.message;
}
if (e.message !== error) {
throw new IdlHarnessError(`${idlArrayFunc} threw ${e}, not the expected IdlHarnessError`);
throw new IdlHarnessError(`${idlArrayFunc} threw "${e}", not the expected IdlHarnessError "${error}"`);
}
return;
}
throw new IdlHarnessError(`${idlArrayFunc} did not throw the expected IdlHarnessError`);
}
//@}
@ -682,6 +684,21 @@ IdlArray.prototype.test = function()
}
this["includes"] = {};
// Assert B defined for A : B
for (var member of Object.values(this.members).filter(m => m.base)) {
const lhs = member.name;
const rhs = member.base;
if (!(rhs in this.members)) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is undefined.`);
const lhs_is_interface = this.members[lhs] instanceof IdlInterface;
const rhs_is_interface = this.members[rhs] instanceof IdlInterface;
if (rhs_is_interface != lhs_is_interface) {
if (!lhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${lhs} is not an interface.`);
if (!rhs_is_interface) throw new IdlHarnessError(`${lhs} inherits ${rhs}, but ${rhs} is not an interface.`);
}
// Check for circular dependencies.
member.get_inheritance_stack();
}
Object.getOwnPropertyNames(this.members).forEach(function(memberName) {
var member = this.members[memberName];
if (!(member instanceof IdlInterface)) {
@ -1110,6 +1127,10 @@ IdlInterface.prototype.get_inheritance_stack = function() {
var base = this.array.members[idl_interface.base];
if (!base) {
throw new Error(idl_interface.type + " " + idl_interface.base + " not found (inherited by " + idl_interface.name + ")");
} else if (stack.indexOf(base) > -1) {
stack.push(base);
let dep_chain = stack.map(i => i.name).join(',');
throw new IdlHarnessError(`${this.name} has a circular dependency: ${dep_chain}`);
}
idl_interface = base;
stack.push(idl_interface);
@ -1670,7 +1691,6 @@ IdlInterface.prototype.test_self = function()
this.name + '.prototype should not have @@unscopables');
}
}.bind(this), this.name + ' interface: existence and properties of interface prototype object\'s @@unscopables property');
};
//@}
@ -2428,6 +2448,7 @@ IdlInterface.prototype.test_interface_of = function(desc, obj, exception, expect
}
if (!exposed_in(exposure_set(member, this.exposureSet))) {
test(function() {
assert_equals(exception, null, "Unexpected exception when evaluating object");
assert_false(member.name in obj);
}.bind(this), this.name + " interface: " + desc + ' must not have property "' + member.name + '"');
continue;