| 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 var EPSILON = 1e-6; // float epsilon | 6 var EPSILON = 1e-6; // float epsilon |
| 7 var values = [ | 7 var values = [ |
| 8 {input: new CSSSkew(0, 0), ax: 0, ay: 0, cssString: "skew(0, 0)"}, | 8 {input: new CSSSkew(0, 0), ax: 0, ay: 0, cssText: "skew(0, 0)"}, |
| 9 {input: new CSSSkew(1, 2), ax: 1, ay: 2, cssString: "skew(1, 2)"}, | 9 {input: new CSSSkew(1, 2), ax: 1, ay: 2, cssText: "skew(1, 2)"}, |
| 10 {input: new CSSSkew(-2, -4), ax: -2, ay: -4, cssString: "skew(-2, -4)"}, | 10 {input: new CSSSkew(-2, -4), ax: -2, ay: -4, cssText: "skew(-2, -4)"}, |
| 11 {input: new CSSSkew(3.4, 2.7), ax: 3.4, ay: 2.7, cssString: "skew(3.4, 2.7)"} | 11 {input: new CSSSkew(3.4, 2.7), ax: 3.4, ay: 2.7, cssText: "skew(3.4, 2.7)"} |
| 12 ]; | 12 ]; |
| 13 | 13 |
| 14 test(function() { | 14 test(function() { |
| 15 for (var i = 0; i < values.length; ++i) { | 15 for (var i = 0; i < values.length; ++i) { |
| 16 assert_equals(values[i].input.ax, values[i].ax); | 16 assert_equals(values[i].input.ax, values[i].ax); |
| 17 assert_equals(values[i].input.ay, values[i].ay); | 17 assert_equals(values[i].input.ay, values[i].ay); |
| 18 } | 18 } |
| 19 }, "Test that the (ax, ay) values for CSSSkew are correct."); | 19 }, "Test that the (ax, ay) values for CSSSkew are correct."); |
| 20 | 20 |
| 21 test(function() { | 21 test(function() { |
| 22 for (var i = 0; i < values.length; ++i) { | 22 for (var i = 0; i < values.length; ++i) { |
| 23 assert_true(values[i].input.is2DComponent()); | 23 assert_true(values[i].input.is2DComponent()); |
| 24 } | 24 } |
| 25 }, "Test that the is2DComponent values for CSSSkew is correct."); | 25 }, "Test that the is2DComponent values for CSSSkew is correct."); |
| 26 | 26 |
| 27 test(function() { | 27 test(function() { |
| 28 for (var i = 0; i < values.length; ++i) { | 28 for (var i = 0; i < values.length; ++i) { |
| 29 assert_equals(values[i].input.cssString, values[i].cssString); | 29 assert_equals(values[i].input.cssText, values[i].cssText); |
| 30 } | 30 } |
| 31 }, "Test that the cssString for CSSSkew is correct."); | 31 }, "Test that the cssText for CSSSkew is correct."); |
| 32 | 32 |
| 33 test(function() { | 33 test(function() { |
| 34 assert_throws(null, function() { new CSSSkew(); }); | 34 assert_throws(null, function() { new CSSSkew(); }); |
| 35 assert_throws(null, function() { new CSSSkew(1); }); | 35 assert_throws(null, function() { new CSSSkew(1); }); |
| 36 }, "Test that invalid number of arguments for CSSSkew throws an exception."); | 36 }, "Test that invalid number of arguments for CSSSkew throws an exception."); |
| 37 | 37 |
| 38 function tanDegrees(degrees) { | 38 function tanDegrees(degrees) { |
| 39 var radians = degrees * Math.PI / 180; | 39 var radians = degrees * Math.PI / 180; |
| 40 return Math.tan(radians); | 40 return Math.tan(radians); |
| 41 } | 41 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 if (typeof expectedMatrix[attribute] === "number") { | 52 if (typeof expectedMatrix[attribute] === "number") { |
| 53 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]
, EPSILON); | 53 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]
, EPSILON); |
| 54 } else { | 54 } else { |
| 55 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]); | 55 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 }, "Test that asMatrix is constructed correctly for CSSSkew."); | 59 }, "Test that asMatrix is constructed correctly for CSSSkew."); |
| 60 | 60 |
| 61 </script> | 61 </script> |
| OLD | NEW |