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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-readonly-filp.html

Issue 2260393002: add FlipX() and FlipY() funtion in DOMMatrixReadOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add FlipX() and FlipY() funtion in DOMMatrixReadOnly. Created 4 years, 4 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
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Geometry Interfaces: DOMMatrixReadOnly filp</title>
pdr. 2016/08/20 20:20:01 Nit: filp -> flip Nit: change filename from *read
Hwanseung Lee 2016/08/20 22:40:43 Done.
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 test(function() {
11 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
12 var flipX = matrix2d.flipX();
13 assert_true(flipX.is2D);
14 assert_equals(flipX.a, -1);
15 assert_equals(flipX.b, -2);
16 assert_equals(flipX.c, 3);
17 assert_equals(flipX.d, 3.1);
18 assert_equals(flipX.e, 2);
19 assert_equals(flipX.f, 1);
20 }, "DOMMatrixReadOnly flipX - 2D matrix");
21
22 test(function() {
23 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1 2, 13, 14, 15, 16.6]);
24 var flipX = matrix3d.flipX();
25 assert_false(flipX.is2D);
26 assert_equals(flipX.m11, -1);
27 assert_equals(flipX.m12, -2);
28 assert_equals(flipX.m13, -3);
29 assert_equals(flipX.m14, -4);
30 assert_equals(flipX.m21, 5);
31 assert_equals(flipX.m22, 6);
32 assert_equals(flipX.m23, 7);
33 assert_equals(flipX.m24, 8);
34 assert_equals(flipX.m31, 9);
35 assert_equals(flipX.m32, 10.1);
36 assert_equals(flipX.m33, 11);
37 assert_equals(flipX.m34, 12);
38 assert_equals(flipX.m41, 13);
39 assert_equals(flipX.m42, 14);
40 assert_equals(flipX.m43, 15);
41 assert_equals(flipX.m44, 16.6);
42 }, "DOMMatrixReadOnly flipX - 3D matrix");
pdr. 2016/08/20 20:20:01 Nit: add a newline between these tests
Hwanseung Lee 2016/08/20 22:40:43 Done.
43 test(function() {
44 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
45 var flipY = matrix2d.flipY();
46 assert_true(flipY.is2D);
47 assert_equals(flipY.a, 1);
48 assert_equals(flipY.b, 2);
49 assert_equals(flipY.c, -3);
50 assert_equals(flipY.d, -3.1);
51 assert_equals(flipY.e, 2);
52 assert_equals(flipY.f, 1);
53 }, "DOMMatrixReadOnly flipY - 2D matrix");
54
55 test(function() {
56 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1 2, 13, 14, 15, 16.6]);
57 var flipY = matrix3d.flipY();
58 assert_false(flipY.is2D);
59 assert_equals(flipY.m11, 1);
60 assert_equals(flipY.m12, 2);
61 assert_equals(flipY.m13, 3);
62 assert_equals(flipY.m14, 4);
63 assert_equals(flipY.m21, -5);
64 assert_equals(flipY.m22, -6);
65 assert_equals(flipY.m23, -7);
66 assert_equals(flipY.m24, -8);
67 assert_equals(flipY.m31, 9);
68 assert_equals(flipY.m32, 10.1);
69 assert_equals(flipY.m33, 11);
70 assert_equals(flipY.m34, 12);
71 assert_equals(flipY.m41, 13);
72 assert_equals(flipY.m42, 14);
73 assert_equals(flipY.m43, 15);
74 assert_equals(flipY.m44, 16.6);
75 }, "DOMMatrixReadOnly flipY - 3D matrix");
76 </script>
77 </body>
78 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698