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

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: Adding a layout test 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 <script src="../../resources/testharness.js"></script>
pdr. 2016/08/18 16:49:48 Nit: please add <!DOCTYPE HTML> This prevents very
2 <script src="../../resources/testharnessreport.js"></script>
3 <script>
4 test(function() {
5 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
6 assert_true(matrix2d.is2D);
7 assert_equals(matrix2d.a, 1);
8 assert_equals(matrix2d.b, 2);
9 assert_equals(matrix2d.c, 3);
10 assert_equals(matrix2d.d, 3.1);
11 assert_equals(matrix2d.e, 2);
12 assert_equals(matrix2d.f, 1);
13 }, "DOMMatrixReadOnly constructor - 2D matrix");
14
15 test(function() {
16 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1 2, 13, 14, 15, 16.6]);
17 assert_false(matrix3d.is2D);
18 assert_equals(matrix3d.m11, 1);
19 assert_equals(matrix3d.m12, 2);
20 assert_equals(matrix3d.m13, 3);
21 assert_equals(matrix3d.m14, 4);
22 assert_equals(matrix3d.m21, 5);
23 assert_equals(matrix3d.m22, 6);
24 assert_equals(matrix3d.m23, 7);
25 assert_equals(matrix3d.m24, 8);
26 assert_equals(matrix3d.m31, 9);
27 assert_equals(matrix3d.m32, 10.1);
28 assert_equals(matrix3d.m33, 11);
29 assert_equals(matrix3d.m34, 12);
30 assert_equals(matrix3d.m41, 13);
31 assert_equals(matrix3d.m42, 14);
32 assert_equals(matrix3d.m43, 15);
33 assert_equals(matrix3d.m44, 16.6);
34 }, "DOMMatrixReadOnly constructor - 3D matrix");
35
36 test(function() {
37 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly(1, 2, 3, 4 , 5, 6); },
38 "DOMMatrixReadOnly constructor only accepts 1 argument");
39 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly("myString" ); },
40 "DOMMatrixReadOnly constructor only accepts 1 number sequence");
41 assert_throws(new TypeError(), function() { new DOMMatrixReadOnly([1, 2, 3]) ; },
42 "DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 elements.");
43 }, "DOMMatrixReadOnly constructor - invalid arguments");
44 </script>
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