Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/css/css-transforms-2/resources/testcommon.js

Issue 2882153004: CSS Transforms 2: Web Platform Tests for translate,rotate,scale parsing (Closed)
Patch Set: resources Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/css/css-transforms-2/resources/testcommon.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms-2/resources/testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms-2/resources/testcommon.js
new file mode 100644
index 0000000000000000000000000000000000000000..be2accdc47eb343a4d5b6f06d73b772403372bda
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms-2/resources/testcommon.js
@@ -0,0 +1,27 @@
+'use strict';
suzyh_UTC10 (ex-contributor) 2017/05/22 01:11:45 Consider naming this file something like testcommo
Eric Willigers 2017/05/22 07:13:39 Done.
+
+function assert_valid_value(property, value) {
suzyh_UTC10 (ex-contributor) 2017/05/22 01:11:45 I find it slightly surprising that a function name
Eric Willigers 2017/05/22 07:13:40 Done. I also came across another option, but I do
+ 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/22 01:11:44 Is 'sets the value' exactly synonymous with 'parse
Eric Willigers 2017/05/22 07:13:39 I have changed the function to accept an optional
+
+ 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);
suzyh_UTC10 (ex-contributor) 2017/05/22 01:11:45 Are we likely to want to test that X is a valid va
+}
+
+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");
suzyh_UTC10 (ex-contributor) 2017/05/22 01:11:45 I find this test description (and to a lesser exte
+}

Powered by Google App Engine
This is Rietveld 408576698