5 <title>Pointer Lock event constructor
</title>
6 <script src=
"/resources/testharness.js"></script>
7 <script src=
"/resources/testharnessreport.js"></script>
8 <link rel=
"help" href=
"http://www.w3.org/TR/pointerlock/#pointerlockchange-and-pointerlockerror-events">
9 <link rel=
"help" href=
"http://www.w3.org/TR/dom/#interface-event">
12 <p>Create Pointer Lock events and check each default value.
</p>
16 var ev
= new MouseEvent("pointerlockchange");
17 assert_equals(ev
.type
, "pointerlockchange");
18 assert_equals(ev
.target
, null);
19 assert_equals(ev
.currentTarget
, null);
20 assert_equals(ev
.bubbles
, false);
21 assert_equals(ev
.eventPhase
, Event
.NONE
);
22 assert_equals(ev
.cancelable
, false);
23 assert_true("preventDefault" in ev
);
24 assert_equals(ev
.defaultPrevented
, false);
25 assert_true(ev
.timeStamp
> 0);
26 assert_true("initEvent" in ev
);
27 assert_true("movementX" in ev
, "movementX exists");
28 assert_true("movementY" in ev
, "movementY exists");
29 assert_equals(ev
.movementX
, 0);
30 assert_equals(ev
.movementY
, 0);
31 }, "Default event values for mouse event interface and its pointer lock extensions.");
33 var ev
= new MouseEvent("pointerlockerror",
37 get defaultPrevented() {
38 assert_unreached("Should not look at the defaultPrevented property.");
42 assert_equals(ev
.type
, "pointerlockerror");
43 assert_equals(ev
.bubbles
, true); // this is synthetic event, so follow the dictionary
44 assert_equals(ev
.cancelable
, false);
45 assert_equals(ev
.defaultPrevented
, false);
46 assert_equals(ev
.movementX
, 10); // this is synthetic event, so follow the dictionary
47 assert_equals(ev
.movementY
, 10); // this is synthetic event, so follow the dictionary
48 }, "Default event values for pointerlockerror using a dictionary");