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

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

Issue 2600663002: Adding matrixTrasnform to DOMPointReadOnly interfaces as following spec. (Closed)
Patch Set: Adding matrixTrasnform to DOMPointReadOnly interfaces as following spec. Created 3 years, 11 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/LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>Geometry Interfaces: DOMPointReadOnly</title> 3 <title>Geometry Interfaces: DOMPointReadOnly</title>
4 <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMPoint"> 4 <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMPoint">
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="./resources/geometry-interfaces-test-helpers.js"></script> 7 <script src="./resources/geometry-interfaces-test-helpers.js"></script>
8 <script> 8 <script>
9 'use strict'; 9 'use strict';
10 10
11 test(() => { 11 test(() => {
12 var point = new DOMPointReadOnly();
13 assert_dom_point_equals(point, [0, 0, 0, 1]);
14 }, 'DOMPointReadOnly constructor without parameter');
15
16 test(() => {
17 var point = new DOMPointReadOnly(10);
18 assert_dom_point_equals(point, [10, 0, 0, 1]);
19 }, 'DOMPointReadOnly constructor with x parameter');
20
21 test(() => {
22 var point = new DOMPointReadOnly(10, 20);
23 assert_dom_point_equals(point, [10, 20, 0, 1]);
24 }, 'DOMPointReadOnly constructor with x, y parameters');
25
26 test(() => {
27 var point = new DOMPointReadOnly(10, 20, 30);
28 assert_dom_point_equals(point, [10, 20, 30, 1]);
29 }, 'DOMPointReadOnly constructor with x, y, z parameters');
30
31 test(() => {
12 var point = new DOMPointReadOnly(10, 20, 30, 40); 32 var point = new DOMPointReadOnly(10, 20, 30, 40);
13 assert_dom_point_equals(point, [10, 20, 30, 40]); 33 assert_dom_point_equals(point, [10, 20, 30, 40]);
14 }, 'DOMPointReadOnly constructor with x, y, z, w parameters'); 34 }, 'DOMPointReadOnly constructor with x, y, z, w parameters');
15 35
16 test(() => { 36 test(() => {
17 var point = new DOMPointReadOnly(1, 2, 3, 4); 37 var point = new DOMPointReadOnly(1, 2, 3, 4);
18 assert_readonly(point, 'x'); 38 assert_readonly(point, 'x');
19 assert_readonly(point, 'y'); 39 assert_readonly(point, 'y');
20 assert_readonly(point, 'z'); 40 assert_readonly(point, 'z');
21 assert_readonly(point, 'w'); 41 assert_readonly(point, 'w');
(...skipping 11 matching lines...) Expand all
33 53
34 test(() => { 54 test(() => {
35 var point = DOMPointReadOnly.fromPoint(); 55 var point = DOMPointReadOnly.fromPoint();
36 assert_dom_point_equals(point, [0, 0, 0, 1]); 56 assert_dom_point_equals(point, [0, 0, 0, 1]);
37 }, 'DOMPointReadOnly.fromPoint() should create a DOMPointReadOnly'); 57 }, 'DOMPointReadOnly.fromPoint() should create a DOMPointReadOnly');
38 58
39 test(() => { 59 test(() => {
40 var point1 = DOMPointReadOnly.fromPoint(); 60 var point1 = DOMPointReadOnly.fromPoint();
41 var point2 = DOMPointReadOnly.fromPoint(); 61 var point2 = DOMPointReadOnly.fromPoint();
42 assert_false(point1 == point2); 62 assert_false(point1 == point2);
43 assert_true(point1.x == point2.x); 63 assert_dom_point_equals(point1, point2);
44 assert_true(point1.y == point2.y);
45 assert_true(point1.z == point2.z);
46 assert_true(point1.w == point2.w);
47 }, 'DOMPointReadOnly.fromPoint() should create a new DOMPointReadOnly'); 64 }, 'DOMPointReadOnly.fromPoint() should create a new DOMPointReadOnly');
48 65
66 test(() => {
67 var point = new DOMPointReadOnly(5, 4);
68 var transformed_point = point.matrixTransform(new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]));
69 assert_dom_point_equals(transformed_point, new DOMPoint(20, 18));
70 }, 'DOMMatrixReadOnly.matrixTransform() - 2d matrixTransform');
71
72 test(() => {
73 var point = new DOMPointReadOnly(5, 4);
74 var transformed_point = point.matrixTransform(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]));
75 assert_dom_point_equals(transformed_point, new DOMPoint(38, 48, 58, 68));
76 }, 'DOMMatrixReadOnly.matrixTransform() - 3d matrixTransform');
77
49 </script> 78 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698