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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_no_pointercapture-manual.html

Issue 2807433003: No pointer captured when the pointer lock is applied (Closed)
Patch Set: pointer lock Created 3 years, 7 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
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Pointer Events pointer lock tests</title>
5 <meta name="viewport" content="width=device-width">
6 <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css" >
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <!-- Additional helper script for common checks across event types -->
10 <script type="text/javascript" src="../pointerevent_support.js"></script >
11 <script>
12 var capture_count = 0;
13 var mouse_move_count = 0;
14
15 function resetTestState() {
16 }
17
18 function run() {
19 var test_pointerEvent = setup_pointerevent_test("no pointercaptu re while pointerlock", ['mouse']);
20 var div1 = document.getElementById("div1");
21 var div2 = document.getElementById("div2");
22
23 on_event(div1, 'pointerdown', function(event) {
24 div1.requestPointerLock();
25 });
26 on_event(div1, 'pointermove', function(event) {
scheib 2017/05/19 19:54:17 ditto pointermove concerns
27 mouse_move_count++;
28 if (mouse_move_count == 2) {
29 try {
30 div2.setPointerCapture(event.pointerId);
31 test_pointerEvent.step(function () {
32 assert_unreached("DOMException: InvalidStateErro r should have been thrown.");
33 });
34 } catch (e) {
35 test_pointerEvent.step(function () {
36 assert_equals(e.name, "InvalidStateError", "DOME xception should be InvalidStateError");
37 assert_equals(capture_count, 0, "no capture");
38 });
39 }
40 test_pointerEvent.done();
41 }
42 });
43 on_event(div2, 'gotpointercapture', function(event) {
44 capture_count++;
45 });
46 on_event(div2, 'lostpointercapture', function(event) {
47 capture_count++;
48 });
49 on_event(document, 'pointerlockchange', function(event) {
50 test_pointerEvent.step(function() {
51 assert_equals(document.pointerLockElement, div1, "docume nt.pointerLockElement should be div1.");
52 });
53 });
54 }
55 </script>
56 </head>
57 <body onload="run()">
58 <h1>Pointer Events pointer lock test</h1>
59 <h2 id="pointerTypeDescription"></h2>
60 <h4>
61 Test Description: This test checks that we will throw an error when we are trying to set the pointer capture when any element in the page already ge ts a pointer lock.
62 <ol>
63 <li>Press left button down on the green rectangle and hold it.< /li>
64 <li>Move the mouse inside the green rectangle.</li>
65 </ol>
66
67 Test passes if an InvalidStateError is caught when setting pointer c apture on yellow rectangle while the green rectangle already gets the pointer lo ck.
68 </h4>
69 <div id="testContainer">
70 <div id="div1" style="width:800px;height:250px;background:green"></d iv>
71 <div id="div2" style="width:800px;height:250px;background:yellow"></ div>
72 </div>
73 <div class="spacer"></div>
74 </body>
75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698