| Index: third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
|
| index 904efa46b76cbac83efcef3ca1eec69053ad8061..362d6ce5fe3dcc62d03939f4bc40d6d517888df3 100644
|
| --- a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_releasepointercapture_events_to_original_target-manual.html
|
| @@ -11,20 +11,24 @@
|
| <!-- Additional helper script for common checks across event types -->
|
| <script type="text/javascript" src="pointerevent_support.js"></script>
|
| <script type="text/javascript">
|
| + var test_pointerEvent;
|
| var detected_pointertypes = {};
|
| - var test_pointerEvent = async_test("lostpointercapture: subsequent events to target."); // set up test harness
|
| - // showPointerTypes is defined in pointerevent_support.js
|
| - // Requirements: the callback function will reference the test_pointerEvent object and
|
| - // will fail unless the async_test is created with the var name "test_pointerEvent".
|
| - add_completion_callback(showPointerTypes);
|
| -
|
| - var captured_event;
|
| + var captured_event = null;
|
| var test_done = false;
|
| var overEnterEventsFail = false;
|
| var outLeaveEventsFail = false;
|
| var f_gotPointerCapture = false;
|
| var f_lostPointerCapture = false;
|
|
|
| + function resetTestState() {
|
| + captured_event = null;
|
| + test_done = false;
|
| + overEnterEventsFail = false;
|
| + outLeaveEventsFail = false;
|
| + f_gotPointerCapture = false;
|
| + f_lostPointerCapture = false;
|
| + }
|
| +
|
| function listenerEventHandler(event) {
|
| if (test_done)
|
| return;
|
| @@ -39,10 +43,10 @@
|
| check_PointerEvent(event);
|
| }
|
| else if(event.type == "pointerover" || event.type == "pointerenter") {
|
| - if(!overEnterEventsFail) {
|
| + if(captured_event && !overEnterEventsFail) {
|
| test(function() {
|
| - assert_true(f_gotPointerCapture, "pointerover/enter should not be received when the target doesn't have capture and pointer is not over it.");
|
| - }, "pointerover/enter should not be received when the target doesn't have capture and pointer is not over it.");
|
| + assert_false(f_gotPointerCapture, "pointerover/enter should be received before the target receives gotpointercapture even when the pointer is not over it.");
|
| + }, expectedPointerType + " pointerover/enter should be received before the target receives gotpointercapture even when the pointer is not over it.");
|
| overEnterEventsFail = true;
|
| }
|
| }
|
| @@ -50,7 +54,7 @@
|
| if(!outLeaveEventsFail) {
|
| test(function() {
|
| assert_true(f_lostPointerCapture, "pointerout/leave should not be received unless the target just lost the capture.");
|
| - }, "pointerout/leave should not be received unless the target just lost the capture.");
|
| + }, expectedPointerType + " pointerout/leave should not be received unless the target just lost the capture.");
|
| outLeaveEventsFail = true;
|
| }
|
| }
|
| @@ -63,7 +67,7 @@
|
| // if any other events are received after releaseCapture, then the test fails
|
| test(function () {
|
| assert_unreached(event.target.id + "-" + event.type + " should be handled by target element handler");
|
| - }, "No other events should be recieved by capturing node after release");
|
| + }, expectedPointerType + " No other events should be recieved by capturing node after release");
|
| }
|
| }
|
| }
|
| @@ -75,7 +79,7 @@
|
| if(event.type != "pointerout" && event.type != "pointerleave") {
|
| test(function () {
|
| assert_unreached("The Target element should not have received any events while capture is active. Event recieved:" + event.type + ". ");
|
| - }, "The target element should not receive any events while capture is active");
|
| + }, expectedPointerType + " The target element should not receive any events while capture is active");
|
| }
|
| }
|
|
|
| @@ -90,13 +94,14 @@
|
| assert_equals(event.pointerId, captured_event.pointerId, "pointerID is same for event captured and after release");
|
| });
|
| if (event.type == "pointerup") {
|
| - test_pointerEvent.done(); // complete test
|
| test_done = true;
|
| + test_pointerEvent.done(); // complete test
|
| }
|
| }
|
| }
|
|
|
| function run() {
|
| + test_pointerEvent = setup_pointerevent_test("got/lost pointercapture: subsequent events to target", ALL_POINTERS); // set up test harness
|
| var listener = document.getElementById("listener");
|
| var target0 = document.getElementById("target0");
|
| target0.style["touchAction"] = "none";
|
| @@ -110,6 +115,7 @@
|
| </script>
|
| </head>
|
| <body onload="run()">
|
| + <h2 id="pointerTypeDescription"></h2>
|
| <div id="listener"></div>
|
| <h1>Pointer Event: releasePointerCapture() - subsequent events follow normal hitting testing mechanisms</h1>
|
| <h4>
|
|
|