Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326

This commit is contained in:
Josh Matthews 2017-10-12 09:25:50 -04:00
parent 462c272380
commit 1f531f66ea
5377 changed files with 174916 additions and 84369 deletions

View file

@ -630,6 +630,12 @@ ReflectionTests.reflects = function(data, idlName, idlObj, domName, domObj) {
if (defaultVal === undefined) {
defaultVal = typeInfo.defaultVal;
}
if ((domObj.localName === "form" && domName === "action") ||
(["button", "input"].includes(domObj.localName) &&
domName === "formAction")) {
// Hard-coded special case
defaultVal = domObj.ownerDocument.URL;
}
if (defaultVal !== null || data.isNullable) {
ReflectionHarness.test(function() {
ReflectionHarness.assertEquals(idlObj[idlName], defaultVal);
@ -776,24 +782,43 @@ ReflectionTests.reflects = function(data, idlName, idlObj, domName, domObj) {
idlDomExpected = idlDomExpected.filter(function(element, index, array) { return idlIdlExpected[index] < 1000; });
idlIdlExpected = idlIdlExpected.filter(function(element, index, array) { return idlIdlExpected[index] < 1000; });
}
if (!data.customGetter) {
if ((domObj.localName === "form" && domName === "action") ||
(["button", "input"].includes(domObj.localName) &&
domName === "formAction")) {
// Hard-coded special case
for (var i = 0; i < domTests.length; i++) {
if (domExpected[i] === null && !data.isNullable) {
// If you follow all the complicated logic here, you'll find that
// this will only happen if there's no expected value at all (like
// for tabIndex, where the default is too complicated). So skip
// the test.
continue;
if (domTests[i] === "") {
domExpected[i] = domObj.ownerDocument.URL;
}
ReflectionHarness.test(function() {
domObj.setAttribute(domName, domTests[i]);
ReflectionHarness.assertEquals(domObj.getAttribute(domName),
String(domTests[i]), "getAttribute()");
ReflectionHarness.assertEquals(idlObj[idlName], domExpected[i],
"IDL get");
}, "setAttribute() to " + ReflectionHarness.stringRep(domTests[i]));
}
for (var i = 0; i < idlTests.length; i++) {
if (idlTests[i] === "") {
idlIdlExpected[i] = domObj.ownerDocument.URL;
}
}
}
if (data.customGetter) {
// These are reflected only on setting, not getting
domTests = [];
domExpected = [];
idlIdlExpected = idlIdlExpected.map(() => null);
}
for (var i = 0; i < domTests.length; i++) {
if (domExpected[i] === null && !data.isNullable) {
// If you follow all the complicated logic here, you'll find that
// this will only happen if there's no expected value at all (like
// for tabIndex, where the default is too complicated). So skip
// the test.
continue;
}
ReflectionHarness.test(function() {
domObj.setAttribute(domName, domTests[i]);
ReflectionHarness.assertEquals(domObj.getAttribute(domName),
String(domTests[i]), "getAttribute()");
ReflectionHarness.assertEquals(idlObj[idlName], domExpected[i],
"IDL get");
}, "setAttribute() to " + ReflectionHarness.stringRep(domTests[i]));
}
for (var i = 0; i < idlTests.length; i++) {