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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 '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.
2
3 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
4 var stringifiedValue = JSON.stringify(value);
5
6 test(function(){
7 var div = document.createElement('div');
8 div.style[property] = value;
9 assert_not_equals(div.style[property], "");
10 }, "e.style['" + property + "'] = " + stringifiedValue + " should set the va lue");
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
11
12 test(function(){
13 var div = document.createElement('div');
14 div.style[property] = value;
15 assert_equals(div.style[property], value);
16 }, "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
17 }
18
19 function assert_invalid_value(property, value) {
20 var stringifiedValue = JSON.stringify(value);
21
22 test(function(){
23 var div = document.createElement('div');
24 div.style[property] = value;
25 assert_equals(div.style[property], "");
26 }, "e.style['" + property + "'] = " + stringifiedValue + " should not set th e value");
suzyh_UTC10 (ex-contributor) 2017/05/22 01:11:45 I find this test description (and to a lesser exte
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698