Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-scale.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-scale.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-scale.html |
| index 0ed32141b4f88647d1627e5430a5376b600d9b58..2d963af13a8aba3ece4cbb6589a88f026f00af0b 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-scale.html |
| +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-scale.html |
| @@ -3,21 +3,54 @@ |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="./resources/geometry-interfaces-test-helpers.js"></script> |
| <script> |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale(); |
| + assert_identity_2d_matrix(result); |
| + assert_identity_2d_matrix(matrix); |
|
dominicc (has gone to gerrit)
2016/10/14 08:16:00
Since matrix and result have the same value, maybe
Hwanseung Lee
2016/10/15 01:16:43
Done.
|
| +}, "DOMMatrix.scale()"); |
| + |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| var result = matrix.scale(3); |
| assert_2d_matrix_equals(result, [3, 0, 0, 3, 0, 0]); |
| assert_identity_2d_matrix(matrix); |
| -}, "DOMMatrix.scale(scale)"); |
| +}, "DOMMatrix.scale(sx)"); |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale(3, 3); |
| + assert_2d_matrix_equals(result, [3, 0, 0, 3, 0, 0]); |
| + assert_identity_2d_matrix(matrix); |
| +}, "DOMMatrix.scale(sx, sy)"); |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale(3, 8); |
| + assert_2d_matrix_equals(result, [3, 0, 0, 8, 0, 0]); |
| + assert_identity_2d_matrix(matrix); |
| +}, "DOMMatrix.scale(sx, sy)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scale(3, 4, 2); |
| + var result = matrix.scale(3, 3, 1, 4, 2); |
| assert_2d_matrix_equals(result, [3, 0, 0, 3, -8, -4]); |
| assert_identity_2d_matrix(matrix); |
| -}, "DOMMatrix.scale(scale, ox, oy)"); |
| +}, "DOMMatrix.scale(sx, sy, sz, ox, oy)"); |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale(2, 3, 0.5, 2, -4, -1); |
| + assert_3d_matrix_equals(result, [2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0.5, 0, -2, 8, -0.5, 1]); |
| + assert_identity_2d_matrix(matrix); |
| +}, "DOMMatrix.scale(sx, sy, sz, ox, oy, oz)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| @@ -38,10 +71,10 @@ test(function() { |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scaleNonUniform(2, 3, 0.5, 2, -4, -1); |
| - assert_3d_matrix_equals(result, [2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0.5, 0, -2, 8, -0.5, 1]); |
| + var result = matrix.scaleSelf(); |
| + assert_identity_2d_matrix(result); |
| assert_identity_2d_matrix(matrix); |
|
dominicc (has gone to gerrit)
2016/10/14 08:15:59
With the *Self methods it's enough to test that re
Hwanseung Lee
2016/10/15 01:16:43
Done.
|
| -}, "DOMMatrix.scaleNonUniform(sx, sy, sz, ox, oy, oz)"); |
| +}, "DOMMatrix.scaleSelf()"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| @@ -49,45 +82,65 @@ test(function() { |
| var result = matrix.scaleSelf(3); |
| assert_2d_matrix_equals(result, [3, 0, 0, 3, 0, 0]); |
| assert_2d_matrix_equals(matrix, [3, 0, 0, 3, 0, 0]); |
| -}, "DOMMatrix.scaleSelf(scale)"); |
| +}, "DOMMatrix.scaleSelf(sx)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scaleSelf(3, 4, 2); |
| - assert_2d_matrix_equals(result, [3, 0, 0, 3, -8, -4]); |
| - assert_2d_matrix_equals(matrix, [3, 0, 0, 3, -8, -4]); |
| -}, "DOMMatrix.scaleSelf(scale)"); |
| + var result = matrix.scaleSelf(3, 3); |
| + assert_2d_matrix_equals(result, [3, 0, 0, 3, 0, 0]); |
| + assert_2d_matrix_equals(matrix, [3, 0, 0, 3, 0, 0]); |
| +}, "DOMMatrix.scaleSelf(sx, sy)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scale3dSelf(3); |
| - assert_3d_matrix_equals(result, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1]); |
| - assert_3d_matrix_equals(matrix, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1]); |
| -}, "DOMMatrix.scale3dSelf(scale)"); |
| + var result = matrix.scaleSelf(3, 7); |
| + assert_2d_matrix_equals(result, [3, 0, 0, 7, 0, 0]); |
| + assert_2d_matrix_equals(matrix, [3, 0, 0, 7, 0, 0]); |
| +}, "DOMMatrix.scaleSelf(sx, sy)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scale3dSelf(3, 2, 7, -1); |
| - assert_3d_matrix_equals(result, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, -4, -14, 2, 1]); |
| - assert_3d_matrix_equals(matrix, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, -4, -14, 2, 1]); |
| -}, "DOMMatrix.scale3dSelf(scale, ox, oy, oz)"); |
| + var result = matrix.scaleSelf(3, 3, 1, 4, 2); |
| + assert_2d_matrix_equals(result, [3, 0, 0, 3, -8, -4]); |
| + assert_2d_matrix_equals(matrix, [3, 0, 0, 3, -8, -4]); |
| +}, "DOMMatrix.scaleSelf(sx, sy, sz, ox, oy)"); |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scaleNonUniformSelf(2, 3, 0.5, 2, -4, -1); |
| + var result = matrix.scaleSelf(2, 3, 0.5, 2, -4, -1); |
| assert_3d_matrix_equals(result, [2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0.5, 0, -2, 8, -0.5, 1]); |
| assert_3d_matrix_equals(matrix, [2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0.5, 0, -2, 8, -0.5, 1]); |
| -}, "DOMMatrix.scaleNonUniformSelf(sx, sy, sz, ox, oy, oz)"); |
| +}, "DOMMatrix.scaleSelf(sx, sy, sz, ox, oy, oz)"); |
| +// origin value is used to move base point before scale. |
| +// after scale, base point is return to negative origin value. |
| +// if scale value were 1, value of matrix should be same before scale. |
| test(function() { |
| var matrix = new DOMMatrix(); |
| assert_identity_2d_matrix(matrix); |
| - var result = matrix.scaleNonUniformSelf(1, 1, 1, 2, -4, -1); |
| + var result = matrix.scaleSelf(1, 1, 1, 2, -4, -1); |
| assert_identity_3d_matrix(result); |
| assert_identity_3d_matrix(matrix); |
| -}, "DOMMatrix.scaleNonUniformSelf(1, 1, 1, ox, oy, oz)"); |
| +}, "DOMMatrix.scaleSelf(1, 1, 1, ox, oy, oz)"); |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale3dSelf(3); |
| + assert_3d_matrix_equals(result, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1]); |
| + assert_3d_matrix_equals(matrix, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1]); |
| +}, "DOMMatrix.scale3dSelf(scale)"); |
| + |
| +test(function() { |
| + var matrix = new DOMMatrix(); |
| + assert_identity_2d_matrix(matrix); |
| + var result = matrix.scale3dSelf(3, 2, 7, -1); |
| + assert_3d_matrix_equals(result, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, -4, -14, 2, 1]); |
| + assert_3d_matrix_equals(matrix, [3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, -4, -14, 2, 1]); |
| +}, "DOMMatrix.scale3dSelf(scale, ox, oy, oz)"); |
| + |
| </script> |