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

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

Issue 2097093002: [Typed OM] Rename cssString methods to cssText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename-transformvalue
Patch Set: Update usage in csspaint logging for tests Created 4 years, 5 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 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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698