Commit e317ddd7 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in "editing/selection/android-longtap-not-select-empty.html.html"

This patch changes "android-longtap-not-select-empty.html.html" to utilize
|selection_test()| for ease of maintenance.

Following patch will move "android-longtap-not-select-empty.html.html" to
"mouse/" directory for test classification.

Bug: 679977
Change-Id: Iebab8184db6d228320748cf0b8f3090889ba247f
Reviewed-on: https://chromium-review.googlesource.com/987837
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarYoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547412}
parent f8ad0975
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="log"></div>
<p id="p1"><span id="span1">paragraph A</span></p>
<p>paragraph B</p>
<script src="../assert_selection.js"></script>
<script>
test(function () {
var boundsP1 = p1.getBoundingClientRect();
var boundsSpan1 = span1.getBoundingClientRect();
selection_test(
[
'<p><span id="span1">paragraph A</span></p>',
'<p>paragraph B</p>',
],
selection => {
if (!window.eventSender)
throw 'This test requires eventSender.';
window.eventSender.gestureLongPress((boundsSpan1.right + boundsP1.right) / 2, (boundsSpan1.top + boundsSpan1.bottom) / 2);
assert_equals(window.getSelection().toString(), "", "long tap on empty area between span and p");
});
const span1 = selection.document.getElementById('span1');
eventSender.gestureLongPress(
selection.computeLeft(span1) + span1.offsetWidth + 20,
selection.computeTop(span1) + span1.offsetHeight / 2);
},
[
'<p><span id="span1">paragraph A|</span></p>',
'<p>paragraph B</p>',
],
'Long tap on empty area between span and p');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment