chromium/third_party/blink/web_tests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../resources/testharness.js"></script>
<script src="../../../../resources/testharnessreport.js"></script>
<script src="../../../../resources/gesture-util.js"></script>
<script src="../../../../resources/testdriver.js"></script>
<script src="../../../../resources/testdriver-actions.js"></script>
<script src="../../../..//resources/testdriver-vendor.js"></script>
</head>
<body onload="runTest()">
<p>This test checks that a long press gesture selects word when touch editing is enabled.</p>
<div><span id="target">Some selectable text</span></div>
<script>
function runTest() {
  promise_test(async t => {
    preventContextMenu(t);
    const target = document.getElementById("target");
    await touchLongPressElement(target, {
        // Touch based text editing requires a hefty longpress duration.
        duration: 1200
    });
    const selectedText = document.getSelection();
    assert_equals(selectedText.toString(), "selectable");
  }, 'Long press gesture selects word when touch editing is enabled');
}
</script>
</body>
</html>