Commit 1ed88f93 authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

Utilize selection_test() in editing/deleting/5729680.html

This patch changes "5729680.html" to utilize |selection_test()| and renames to
"delete_range_before_space.html" for ease of maintenance and help to
implementing EditingNG.

Bug: 707656, 679977
Change-Id: Ifb10e35390c66f6d82c207a35d90d0324fa8d3fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220109
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773080}
parent 17ef0754
This tests deleting a selection that ends just before a space. There was a bug where it would be treated like a smart delete (the space would be incorrectly removed). To run it outside of DRT, you must delete manually. Press delete and you should see "Th is a test".
Th is a test.
<p>This tests deleting a selection that ends just before a space. There was a bug where it would be treated like a smart delete (the space would be incorrectly removed). To run it outside of DRT, you must delete manually. Press delete and you should see "Th is a test".</p>
<div id="div" contenteditable="true">This is a test.</div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
text = document.getElementById("div").firstChild;
window.getSelection().setBaseAndExtent(text, 2, text, 4);
if (window.eventSender)
eventSender.keyDown("Delete");
</script>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This tests deleting a selection that ends just before a space. There was a
// bug where it would be treated like a smart delete (the space would be
// incorrectly removed).
selection_test(
'<div contenteditable>Th^is| is a test.</div>',
selection => {
if (!window.eventSender)
throw 'This test requires eventSender.';
eventSender.keyDown('Delete');
},
'<div contenteditable>Th| is a test.</div>');
</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