Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/resources/parsing-testcommon.js |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/resources/parsing-testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/resources/parsing-testcommon.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..62fb0994d4115e8145f260bb5a38ea1edca3cc62 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/parsing/resources/parsing-testcommon.js |
| @@ -0,0 +1,33 @@ |
| +'use strict'; |
| + |
| +function assert_valid_value(property, value, serializedValue) { |
| + if (arguments.length < 3) |
| + serializedValue = value; |
| + |
| + var stringifiedValue = JSON.stringify(value); |
| + |
| + test(function(){ |
| + var div = document.createElement('div'); |
| + div.style[property] = value; |
| + assert_not_equals(div.style[property], ""); |
| + }, "e.style['" + property + "'] = " + stringifiedValue + " should set the value"); |
|
suzyh_UTC10 (ex-contributor)
2017/05/25 01:55:38
I believe you modified this description in the ver
Eric Willigers
2017/05/25 11:43:12
Done.
|
| + |
| + test(function(){ |
| + var div = document.createElement('div'); |
| + div.style[property] = value; |
| + var readValue = div.style[property]; |
| + assert_equals(readValue, serializedValue); |
| + div.style[property] = readValue; |
| + assert_equals(div.style[property], readValue); |
| + }, "Serialization should round-trip after setting e.style['" + property + "'] = " + stringifiedValue); |
| +} |
| + |
| +function assert_invalid_value(property, value) { |
| + var stringifiedValue = JSON.stringify(value); |
| + |
| + test(function(){ |
| + var div = document.createElement('div'); |
| + div.style[property] = value; |
| + assert_equals(div.style[property], ""); |
| + }, "e.style['" + property + "'] = " + stringifiedValue + " should not set the value"); |
| +} |