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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssSkew.html

Issue 2888403004: [css-typed-om] replace all attribute with DOMMatrix in cssMatrixComponent (Closed)
Patch Set: fix the typo 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html b/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
index c526903899b136ff65c87fe31d1ab7a1ad52c6bf..285325464dbe559e087254fcf8fde96f538ff8f2 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssSkew.html
@@ -55,10 +55,10 @@ test(function() {
assert_true(inputAsMatrix.is2D());
var tanAx = tanDegrees(input.ax.degrees);
var tanAy = tanDegrees(input.ay.degrees);
- var expectedMatrix = new CSSMatrixComponent(1, tanAy, tanAx, 1, 0, 0);
+ var expectedMatrix = new CSSMatrixComponent(new DOMMatrixReadOnly([1, tanAy, tanAx, 1, 0, 0]));
for (var attribute in expectedMatrix) {
- if (typeof expectedMatrix[attribute] === "number") {
- assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute], EPSILON);
+ if (attribute == "matrix") {
+ assert_matrix_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]);
} else {
assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]);
}
@@ -66,4 +66,14 @@ test(function() {
}
}, "asMatrix is constructed correctly for CSSSkew.");
+function assert_array_approx_equals(actual, expected) {
+ for (var i = 0; i < actual.length; i++) {
+ assert_approx_equals(actual[i], expected[i], EPSILON);
+ }
+}
+
+function assert_matrix_approx_equals(actual, expected) {
+ assert_array_approx_equals(actual.toFloat64Array(), expected.toFloat64Array());
+}
+
</script>

Powered by Google App Engine
This is Rietveld 408576698