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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html

Issue 2879233002: [css-typed-om] Replace cssText with stringifier at CSSTransformComponent (Closed)
Patch Set: [css-typed-om] replace cssText with toString at CSSTransformComponent 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <script> 5 <script>
6 6
7 var simpleLength = new CSSSimpleLength(0, "px"); 7 var simpleLength = new CSSSimpleLength(0, "px");
8 var decimalLength = new CSSSimpleLength(1.1, "px"); 8 var decimalLength = new CSSSimpleLength(1.1, "px");
9 var negativeLength = new CSSSimpleLength(-2.2, "em"); 9 var negativeLength = new CSSSimpleLength(-2.2, "em");
10 var calcLengthPx = new CSSCalcLength({px: 1}); 10 var calcLengthPx = new CSSCalcLength({px: 1});
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }, "Test that the (x, y, z) values for CSSTranslation are correct."); 72 }, "Test that the (x, y, z) values for CSSTranslation are correct.");
73 73
74 test(function() { 74 test(function() {
75 for (var i = 0; i < values.length; ++i) { 75 for (var i = 0; i < values.length; ++i) {
76 assert_equals(values[i].input.is2D(), values[i].is2D); 76 assert_equals(values[i].input.is2D(), values[i].is2D);
77 } 77 }
78 }, "Test that the is2D values for CSSTranslation is correct."); 78 }, "Test that the is2D values for CSSTranslation is correct.");
79 79
80 test(function() { 80 test(function() {
81 for (var i = 0; i < values.length; ++i) { 81 for (var i = 0; i < values.length; ++i) {
82 assert_equals(values[i].input.cssText, expectedCssString(values[i])); 82 assert_equals(values[i].input.toString(), expectedCssString(values[i]));
83 } 83 }
84 }, "Test that cssText values for CSSTranslation is correct."); 84 }, "Test that toString values for CSSTranslation is correct.");
85 85
86 test(function() { 86 test(function() {
87 assert_throws(null, function() { new CSSTranslation(simpleLength, simpleLength , simplePercent); }); 87 assert_throws(null, function() { new CSSTranslation(simpleLength, simpleLength , simplePercent); });
88 assert_throws(null, function() { new CSSTranslation(simpleLength, simpleLength , calcPercent); }); 88 assert_throws(null, function() { new CSSTranslation(simpleLength, simpleLength , calcPercent); });
89 assert_throws(null, function() { new CSSTranslation(simplePercent, simplePerce nt, simplePercent); }); 89 assert_throws(null, function() { new CSSTranslation(simplePercent, simplePerce nt, simplePercent); });
90 }, "Test that CSSTranslation constructor throws when z component contains percen t."); 90 }, "Test that CSSTranslation constructor throws when z component contains percen t.");
91 91
92 test(function() { 92 test(function() {
93 assert_throws(null, function() { new CSSTranslation(); }); 93 assert_throws(null, function() { new CSSTranslation(); });
94 assert_throws(null, function() { new CSSTranslation(simpleLength); }); 94 assert_throws(null, function() { new CSSTranslation(simpleLength); });
95 }, "Test that invalid number of arguments for CSSTranslation throws an exception ."); 95 }, "Test that invalid number of arguments for CSSTranslation throws an exception .");
96 96
97 </script> 97 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698