OLD | NEW |
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 Loading... |
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> |
OLD | NEW |