Index: third_party/WebKit/LayoutTests/external/wpt/css/motion-1/resources/testcommon.js |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/resources/testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/resources/testcommon.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..be2accdc47eb343a4d5b6f06d73b772403372bda |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/motion-1/resources/testcommon.js |
@@ -0,0 +1,27 @@ |
+'use strict'; |
suzyh_UTC10 (ex-contributor)
2017/05/22 01:46:20
My comments on https://codereview.chromium.org/288
|
+ |
+function assert_valid_value(property, 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"); |
+ |
+ test(function(){ |
+ var div = document.createElement('div'); |
+ div.style[property] = value; |
+ assert_equals(div.style[property], value); |
+ }, "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"); |
+} |