diff options
author | Josh Matthews <josh@joshmatthews.net> | 2018-01-31 09:13:41 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-01-31 12:24:47 -0500 |
commit | 0e1caebaf4671498ee05abc24027ce0da3b5e601 (patch) | |
tree | a7f7a718f32ceb363def49ceee022368d9e952d7 /tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js | |
parent | c88dc51d03a81e9e405688ccd2baae75d61ffffd (diff) | |
download | servo-0e1caebaf4671498ee05abc24027ce0da3b5e601.tar.gz servo-0e1caebaf4671498ee05abc24027ce0da3b5e601.zip |
Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js')
-rw-r--r-- | tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js b/tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js index 688356bd0f9..9427f53d81b 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js +++ b/tests/wpt/web-platform-tests/css/css-transforms/parsing/resources/parsing-testcommon.js @@ -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[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); + if (serializedValue instanceof Array) + assert_true(serializedValue.includes(readValue), "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[property], readValue, "serialization should round-trip"); + + }, "e.style['" + property + "'] = " + stringifiedValue + " should set the property value"); } function test_invalid_value(property, value) { |