Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_no_pointercapture-manual.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_no_pointercapture-manual.html b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_no_pointercapture-manual.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..214fee062099e8734c8f45f5c4408c72fcea846e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_no_pointercapture-manual.html |
| @@ -0,0 +1,74 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Pointer Events pointer lock tests</title> |
| + <meta name="viewport" content="width=device-width"> |
| + <link rel="stylesheet" type="text/css" href="../pointerevent_styles.css"> |
| + <script src="/resources/testharness.js"></script> |
| + <script src="/resources/testharnessreport.js"></script> |
| + <!-- Additional helper script for common checks across event types --> |
| + <script type="text/javascript" src="../pointerevent_support.js"></script> |
| + <script> |
| + var capture_count = 0; |
| + var mouse_down_count = 0; |
| + |
| + function resetTestState() { |
| + } |
| + |
| + function run() { |
| + var test_pointerEvent = setup_pointerevent_test("no pointercapture while pointerlock", ['mouse']); |
| + var div1 = document.getElementById("div1"); |
| + var div2 = document.getElementById("div2"); |
| + |
| + on_event(div1, 'pointerdown', function(event) { |
| + mouse_down_count++; |
| + if (mouse_down_count == 1) { |
| + div1.requestPointerLock(); |
| + } else { |
| + try { |
| + div2.setPointerCapture(event.pointerId); |
| + test_pointerEvent.step(function () { |
| + assert_true(false, "DOMException: InvalidStateError should have been thrown."); |
|
Navid Zolghadr
2017/05/17 16:30:10
There is another function called assert_unreached
lanwei
2017/05/19 15:05:00
Acknowledged.
|
| + }); |
| + } catch (e) { |
| + test_pointerEvent.step(function () { |
| + assert_equals(e.name, "InvalidStateError", "DOMException should be InvalidStateError"); |
| + assert_equals(capture_count, 0, "no capture"); |
| + }); |
| + } |
| + test_pointerEvent.done(); |
| + } |
| + }); |
| + on_event(div2, 'gotpointercapture', function(event) { |
| + capture_count++; |
| + }); |
| + on_event(div2, 'lostpointercapture', function(event) { |
| + capture_count++; |
| + }); |
| + on_event(document, 'pointerlockchange', function(event) { |
| + test_pointerEvent.step(function() { |
| + assert_equals(document.pointerLockElement, div1, "document.pointerLockElement should be div1."); |
| + }); |
| + }); |
| + } |
| + </script> |
| + </head> |
| + <body onload="run()"> |
| + <h1>Pointer Events pointer lock test</h1> |
| + <h2 id="pointerTypeDescription"></h2> |
| + <h4> |
| + Test Description: This test checks that we do not set the pointer capture when any element in the page gets a pointer lock. |
| + <ol> |
| + <li>Press left button down on the blue rectangle and hold it.</li> |
|
Navid Zolghadr
2017/05/17 16:30:10
ditto
|
| + <li>Press middle button down on the blue rectangle and hold it.</li> |
| + </ol> |
| + |
| + Test passes if the pointer capture is not set when the blue rectangle gets the pointer lock. |
| + </h4> |
| + <div id="testContainer"> |
| + <div id="div1" style="width:800px;height:250px;background:green"></div> |
| + <div id="div2" style="width:800px;height:250px;background:yellow"></div> |
| + </div> |
| + <div class="spacer"></div> |
| + </body> |
| +</html> |