Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-long-press.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-long-press.html b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-long-press.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a4e08dea7cbac982362a11b5d486d85d7873dddd |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-long-press.html |
| @@ -0,0 +1,68 @@ |
| +<!DOCTYPE HTML> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| + |
| +<style> |
| +div.box { |
| + margin: 10px; |
| + padding: 50px; |
| + float: left; |
| +} |
| +</style> |
| + |
| +<script> |
| +var receivedEvents = []; |
| + |
| +function testReceivedEvents(expectedEvents, testLabel) { |
| + test(function() { |
| + assert_array_equals(receivedEvents, expectedEvents); |
| + }, testLabel); |
| + receivedEvents = []; |
| +} |
| + |
| +function init() { |
| + var targetDiv = document.getElementById("target"); |
| + targetEvents = ["mousedown", "mouseup", "mousemove", "contextmenu", |
| + "mouseenter", "mouseleave", "mouseover", "mouseout", |
| + "pointerdown", "pointerup", "pointermove", "pointercancel", |
| + "pointerenter", "pointerleave", "pointerover", "pointerout"]; |
| + |
| + targetEvents.forEach(function(eventName) { |
| + targetDiv.addEventListener(eventName, function(event) { |
| + receivedEvents.push(event.type); |
| + }); |
| + }); |
| +} |
| + |
| +function runTests() { |
| + var rect = document.getElementById("target").getBoundingClientRect(); |
| + eventSender.gestureLongPress(rect.left + 5, rect.top + 5); |
| + testReceivedEvents([ |
| + "mouseover", "mouseenter", "mousemove", "mousedown", "contextmenu" |
| + ], "Long press events"); |
| + |
| +} |
| + |
| +function run() { |
| + setup({explicit_done: true}); |
| + |
| + if (!window.eventSender) |
| + assert_true(true, "No eventSender, skipped tests"); |
| + else if (!window.PointerEvent) |
| + assert_true(true, "No PointerEvent, skipped tests"); |
| + else { |
| + init(); |
| + runTests(); |
| + } |
| + |
| + done(); |
| +} |
| +</script> |
| + |
| +<body onload="run()"> |
|
dtapuska
2016/07/18 21:16:31
is there a reason why this can't follow the
test(
mustaq
2016/07/19 15:50:27
Good catch. Don't recall why I originally did it f
|
| + <h1>PointerEvent: Verifies that long press doesn't fire redundant pointer events</h1> |
| + |
| + <div id="target" class="box" style="background-color:red"></div> |
| + |
| + <div id="log"></div> |
| +</body> |