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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/cssScale.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 CSSScale(0, 0), x: 0, y: 0, z: 1, is2DComponent: true, 8 {input: new CSSScale(0, 0), x: 0, y: 0, z: 1, is2DComponent: true,
9 cssString: "scale(0, 0)"}, 9 cssText: "scale(0, 0)"},
10 {input: new CSSScale(1, 2), x: 1, y: 2, z: 1, is2DComponent: true, 10 {input: new CSSScale(1, 2), x: 1, y: 2, z: 1, is2DComponent: true,
11 cssString: "scale(1, 2)"}, 11 cssText: "scale(1, 2)"},
12 {input: new CSSScale(-2, -4), x: -2, y: -4, z: 1, is2DComponent: true, 12 {input: new CSSScale(-2, -4), x: -2, y: -4, z: 1, is2DComponent: true,
13 cssString: "scale(-2, -4)"}, 13 cssText: "scale(-2, -4)"},
14 {input: new CSSScale(3.4, 2.7), x: 3.4, y: 2.7, z: 1, is2DComponent: true, 14 {input: new CSSScale(3.4, 2.7), x: 3.4, y: 2.7, z: 1, is2DComponent: true,
15 cssString: "scale(3.4, 2.7)"}, 15 cssText: "scale(3.4, 2.7)"},
16 {input: new CSSScale(0, 0, 0), x: 0, y: 0, z: 0, is2DComponent: false, 16 {input: new CSSScale(0, 0, 0), x: 0, y: 0, z: 0, is2DComponent: false,
17 cssString: "scale3d(0, 0, 0)"}, 17 cssText: "scale3d(0, 0, 0)"},
18 {input: new CSSScale(1, 2, 3), x: 1, y: 2, z: 3, is2DComponent: false, 18 {input: new CSSScale(1, 2, 3), x: 1, y: 2, z: 3, is2DComponent: false,
19 cssString: "scale3d(1, 2, 3)"}, 19 cssText: "scale3d(1, 2, 3)"},
20 {input: new CSSScale(3.5, -2.7, -2), x: 3.5, y: -2.7, z: -2, is2DComponent: fa lse, 20 {input: new CSSScale(3.5, -2.7, -2), x: 3.5, y: -2.7, z: -2, is2DComponent: fa lse,
21 cssString: "scale3d(3.5, -2.7, -2)"} 21 cssText: "scale3d(3.5, -2.7, -2)"}
22 ]; 22 ];
23 23
24 test(function() { 24 test(function() {
25 for (var i = 0; i < values.length; ++i) { 25 for (var i = 0; i < values.length; ++i) {
26 assert_equals(values[i].input.x, values[i].x); 26 assert_equals(values[i].input.x, values[i].x);
27 assert_equals(values[i].input.y, values[i].y); 27 assert_equals(values[i].input.y, values[i].y);
28 assert_equals(values[i].input.z, values[i].z); 28 assert_equals(values[i].input.z, values[i].z);
29 } 29 }
30 }, "Test that the (x, y, z) values for CSSScale are correct."); 30 }, "Test that the (x, y, z) values for CSSScale are correct.");
31 31
32 test(function() { 32 test(function() {
33 for (var i = 0; i < values.length; ++i) { 33 for (var i = 0; i < values.length; ++i) {
34 assert_equals(values[i].input.is2DComponent(), values[i].is2DComponent); 34 assert_equals(values[i].input.is2DComponent(), values[i].is2DComponent);
35 } 35 }
36 }, "Test that the is2DComponent values for CSSScale is correct."); 36 }, "Test that the is2DComponent values for CSSScale is correct.");
37 37
38 test(function() { 38 test(function() {
39 for (var i = 0; i < values.length; ++i) { 39 for (var i = 0; i < values.length; ++i) {
40 assert_equals(values[i].input.cssString, values[i].cssString); 40 assert_equals(values[i].input.cssText, values[i].cssText);
41 } 41 }
42 }, "Test that the cssString for CSSScale is correct."); 42 }, "Test that the cssText for CSSScale is correct.");
43 43
44 test(function() { 44 test(function() {
45 assert_throws(null, () => { new CSSScale(); }); 45 assert_throws(null, () => { new CSSScale(); });
46 assert_throws(null, () => { new CSSScale(1); }); 46 assert_throws(null, () => { new CSSScale(1); });
47 }, "Test that invalid number of arguments for CSSScale throws an exception."); 47 }, "Test that invalid number of arguments for CSSScale throws an exception.");
48 48
49 test(function() { 49 test(function() {
50 assert_throws(null, () => { new CSSScale(NaN, 0); }); 50 assert_throws(null, () => { new CSSScale(NaN, 0); });
51 assert_throws(null, () => { new CSSScale(0, NaN); }); 51 assert_throws(null, () => { new CSSScale(0, NaN); });
52 assert_throws(null, () => { new CSSScale(NaN, NaN); }); 52 assert_throws(null, () => { new CSSScale(NaN, NaN); });
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (typeof expectedMatrix[attribute] === "number") { 85 if (typeof expectedMatrix[attribute] === "number") {
86 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute] , EPSILON); 86 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute] , EPSILON);
87 } else { 87 } else {
88 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]); 88 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]);
89 } 89 }
90 } 90 }
91 } 91 }
92 }, "Test that asMatrix is constructed correctly for CSSScale."); 92 }, "Test that asMatrix is constructed correctly for CSSScale.");
93 93
94 </script> 94 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698