Update web-platform-tests to revision 81962ac8802223d038b188b6f9cb88a0a9c5beee

This commit is contained in:
WPT Sync Bot 2018-05-18 22:02:29 -04:00
parent fe1a057bd1
commit 24183668c4
1960 changed files with 29853 additions and 10555 deletions

View file

@ -1,5 +1,8 @@
'use strict';
// serializedValue can be the expected serialization of value,
// or an array of permitted serializations,
// or omitted if value should serialize as value.
function test_valid_value(property, value, serializedValue) {
if (arguments.length < 3)
serializedValue = value;
@ -9,17 +12,20 @@ function test_valid_value(property, value, serializedValue) {
test(function(){
var div = document.createElement('div');
div.style[property] = value;
assert_not_equals(div.style[property], "");
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
assert_not_equals(div.style.getPropertyValue(property), "", "property should be set");
test(function(){
var div = document.createElement('div');
div.style[property] = value;
var readValue = div.style[property];
assert_equals(readValue, serializedValue);
var readValue = div.style.getPropertyValue(property);
if (serializedValue instanceof Array)
assert_in_array(readValue, serializedValue, "serialization should be sound");
else
assert_equals(readValue, serializedValue, "serialization should be canonical");
div.style[property] = readValue;
assert_equals(div.style[property], readValue);
}, "Serialization should round-trip after setting e.style['" + property + "'] = " + stringifiedValue);
assert_equals(div.style.getPropertyValue(property), readValue, "serialization should round-trip");
}, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value");
}
function test_invalid_value(property, value) {
@ -28,6 +34,6 @@ function test_invalid_value(property, value) {
test(function(){
var div = document.createElement('div');
div.style[property] = value;
assert_equals(div.style[property], "");
assert_equals(div.style.getPropertyValue(property), "");
}, "e.style['" + property + "'] = " + stringifiedValue + " should not set the property value");
}