diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/pointerlock/constructor.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/pointerlock/constructor.html')
-rw-r--r-- | testing/web-platform/tests/pointerlock/constructor.html | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/web-platform/tests/pointerlock/constructor.html b/testing/web-platform/tests/pointerlock/constructor.html new file mode 100644 index 000000000..8c43cf6da --- /dev/null +++ b/testing/web-platform/tests/pointerlock/constructor.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <title>Pointer Lock event constructor</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="http://www.w3.org/TR/pointerlock/#pointerlockchange-and-pointerlockerror-events"> + <link rel="help" href="http://www.w3.org/TR/dom/#interface-event"> + </head> + <body> + <p>Create Pointer Lock events and check each default value.</p> + <div id='log'></div> + <script> +test(function() { + var ev = new MouseEvent("pointerlockchange"); + assert_equals(ev.type, "pointerlockchange"); + assert_equals(ev.target, null); + assert_equals(ev.currentTarget, null); + assert_equals(ev.bubbles, false); + assert_equals(ev.eventPhase, Event.NONE); + assert_equals(ev.cancelable, false); + assert_true("preventDefault" in ev); + assert_equals(ev.defaultPrevented, false); + assert_true(ev.timeStamp > 0); + assert_true("initEvent" in ev); + assert_true("movementX" in ev, "movementX exists"); + assert_true("movementY" in ev, "movementY exists"); + assert_equals(ev.movementX, 0); + assert_equals(ev.movementY, 0); +}, "Default event values for mouse event interface and its pointer lock extensions."); +test(function() { + var ev = new MouseEvent("pointerlockerror", + { type: "trololol", + bubbles: true, + cancelable: false, + get defaultPrevented() { + assert_unreached("Should not look at the defaultPrevented property."); + }, + movementX: 10, + movementY: 10}); + assert_equals(ev.type, "pointerlockerror"); + assert_equals(ev.bubbles, true); // this is synthetic event, so follow the dictionary + assert_equals(ev.cancelable, false); + assert_equals(ev.defaultPrevented, false); + assert_equals(ev.movementX, 10); // this is synthetic event, so follow the dictionary + assert_equals(ev.movementY, 10); // this is synthetic event, so follow the dictionary +}, "Default event values for pointerlockerror using a dictionary"); + </script> + +</body> + +</html> |