| OLD | NEW |
| 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(10, 20, 30, 40); | 12 var point = new DOMPointReadOnly(10, 20, 30, 40); |
| 13 assert_dom_point_equals(point, [10, 20, 30, 40]); | 13 assert_dom_point_equals(point, [10, 20, 30, 40]); |
| 14 }, 'DOMPointReadOnly constructor with x, y, z, w parameters'); | 14 }, 'DOMPointReadOnly constructor with x, y, z, w parameters'); |
| 15 | 15 |
| 16 test(() => { | 16 test(() => { |
| 17 var point = new DOMPointReadOnly(1, 2, 3, 4); | 17 var point = new DOMPointReadOnly(1, 2, 3, 4); |
| 18 assert_readonly(point, 'x'); | 18 assert_readonly(point, 'x'); |
| 19 assert_readonly(point, 'y'); | 19 assert_readonly(point, 'y'); |
| 20 assert_readonly(point, 'z'); | 20 assert_readonly(point, 'z'); |
| 21 assert_readonly(point, 'w'); | 21 assert_readonly(point, 'w'); |
| 22 }, 'DOMPointReadOnly readonly test'); | 22 }, 'DOMPointReadOnly readonly test'); |
| 23 | 23 |
| 24 </script> | 24 test(() => { |
| 25 var point = DOMPointReadOnly.fromPoint({x: 1, y: 2, z: 3, w: 4}); |
| 26 assert_dom_point_equals(point, [1, 2, 3, 4]); |
| 27 }, 'DOMPointReadOnly.fromPoint({x: 1, y: 2, z: 3, w: 4}) should create a DOMPoin
tReadOnly'); |
| 28 |
| 29 test(() => { |
| 30 var point = DOMPointReadOnly.fromPoint(); |
| 31 assert_dom_point_equals(point, [0, 0, 0, 1]); |
| 32 }, 'DOMPointReadOnly.fromPoint() should create a DOMPointReadOnly'); |
| 33 |
| 34 test(() => { |
| 35 var point1 = DOMPointReadOnly.fromPoint(); |
| 36 var point2 = DOMPointReadOnly.fromPoint(); |
| 37 assert_false(point1 == point2); |
| 38 assert_true(point1.x == point2.x); |
| 39 assert_true(point1.y == point2.y); |
| 40 assert_true(point1.z == point2.z); |
| 41 assert_true(point1.w == point2.w); |
| 42 }, 'DOMPointReadOnly.fromPoint() should create a new DOMPointReadOnly'); |
| 43 |
| 44 </script> |
| OLD | NEW |