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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html

Issue 2423753002: [GeometryInterface] add transformPoint(point) function. (Closed)
Patch Set: update test msg. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
new file mode 100644
index 0000000000000000000000000000000000000000..1463a00b9ac5012477b492e39dcc86f05685aafa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html
@@ -0,0 +1,102 @@
+<!DOCTYPE HTML>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="./resources/geometry-interfaces-test-helpers.js"></script>
+<script>
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]);
+ var point = matrix2d.transformPoint();
+ assert_point_equals(point, new DOMPoint(5, 6, 0, 1));
+}, "DOMMatrixReadOnly transformPoint() - 2d matrix ");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint();
+ assert_point_equals(point, new DOMPoint(13, 14, 15, 16));
+}, "DOMMatrixReadOnly transformPoint() - 3d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5));
+ assert_point_equals(point, new DOMPoint(20, 10, 0, 1));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 0, 0, 0));
+ assert_point_equals(point, new DOMPoint(10, 0, 0, 0));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 4));
+ assert_point_equals(point, new DOMPoint(20, 18, 0, 1));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 4, 0, 0));
+ assert_point_equals(point, new DOMPoint(10, 8, 0, 0));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3));
+ assert_point_equals(point, new DOMPoint(20, 18, 3, 1));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3, 0));
+ assert_point_equals(point, new DOMPoint(10, 8, 3, 0));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 2d matrix");
+
+test(function() {
+ var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
+ var point = matrix2d.transformPoint(new DOMPoint(5, 4, 14, 5));
+ assert_point_equals(point, new DOMPoint(60, 58, 14, 5));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 2d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5));
+ assert_point_equals(point, new DOMPoint(18, 24, 30, 36));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 0, 0, 0));
+ assert_point_equals(point, new DOMPoint(5, 10, 15, 20));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 4));
+ assert_point_equals(point, new DOMPoint(38, 48, 58, 68));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 4, 0, 0));
+ assert_point_equals(point, new DOMPoint(25, 34, 43, 52));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3));
+ assert_point_equals(point, new DOMPoint(65, 78, 91, 104));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3, 0));
+ assert_point_equals(point, new DOMPoint(52, 64, 76, 88));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 3d matrix");
+
+test(function() {
+ var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
+ var point = matrix3d.transformPoint(new DOMPoint(5, 4, 14, 5));
+ assert_point_equals(point, new DOMPoint(216, 244, 272, 300));
+}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 3d matrix");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698