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

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

Issue 2255563002: Add constructor for DOMMatrixReadOnly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Geometry Interfaces: DOMMatrixReadOnly</title>
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 assert_true(matrix2d.is2D);
13 assert_equals(matrix2d.a, 1);
14 assert_equals(matrix2d.b, 2);
15 assert_equals(matrix2d.c, 3);
16 assert_equals(matrix2d.d, 3.1);
17 assert_equals(matrix2d.e, 2);
18 assert_equals(matrix2d.f, 1);
19 }, "DOMMatrixReadOnly constructor - 2D matrix");
20
21 test(function() {
22 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1 2, 13, 14, 15, 16.6]);
23 assert_false(matrix3d.is2D);
24 assert_equals(matrix3d.m11, 1);
25 assert_equals(matrix3d.m12, 2);
26 assert_equals(matrix3d.m13, 3);
27 assert_equals(matrix3d.m14, 4);
28 assert_equals(matrix3d.m21, 5);
29 assert_equals(matrix3d.m22, 6);
30 assert_equals(matrix3d.m23, 7);
31 assert_equals(matrix3d.m24, 8);
32 assert_equals(matrix3d.m31, 9);
33 assert_equals(matrix3d.m32, 10.1);
34 assert_equals(matrix3d.m33, 11);
35 assert_equals(matrix3d.m34, 12);
36 assert_equals(matrix3d.m41, 13);
37 assert_equals(matrix3d.m42, 14);
38 assert_equals(matrix3d.m43, 15);
39 assert_equals(matrix3d.m44, 16.6);
40 }, "DOMMatrixReadOnly constructor - 3D matrix");
41
42 test(function() {
43 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(1, 2, 3, 4 , 5, 6); },
44 "DOMMatrixReadOnly constructor only accepts 1 argument");
45 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly("myString" ); },
46 "DOMMatrixReadOnly constructor only accepts 1 number sequence");
47 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly([1, 2, 3]) ; },
48 "DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 elements.");
49 }, "DOMMatrixReadOnly constructor - invalid arguments");
50 </script>
51 </body>
52 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DOMMatrixReadOnly.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698