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

Utilize selection_test() in editing/pasteboard/paste-sanitize-crash-1.html

This patch changes "paste-sanitize-crash-1.html" to utilize |selection_test()|
for ease of maintenance and help to implementing EditingNG.

Bug: 707656, 679977
Change-Id: I92299572cc59067d340a8295e9dbf50fcf0f1a56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215784
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771735}
parent aee013a2
<html> <!doctype html>
<head<></head> <script src="../../resources/testharness.js"></script>
<script> <script src="../../resources/testharnessreport.js"></script>
function runTest() <script src="../assert_selection.js"></script>
{ <script>
if (window.testRunner) selection_test(
testRunner.dumpAsText(); [
'<div contenteditable>',
var elem = document.getElementById("test"); '<div>one \u00A0</div>',
'<div>^two \u00A0|</div>',
x = elem.offsetLeft + elem.offsetWidth / 2; 'three \u00A0',
y = elem.offsetTop + elem.offsetHeight / 2; '<div>four \u00A0</div>',
'<div id="target"><br></div>',
eventSender.mouseMoveTo(x, y); '</div>',
eventSender.mouseDown(); ],
eventSender.mouseUp(); selection => {
eventSender.mouseDown(); if (!window.testRunner)
eventSender.mouseUp(); throw 'This test requires testRunner.';
eventSender.mouseDown(); selection.document.execCommand('Copy');
eventSender.mouseUp(); selection.collapse(selection.document.getElementById('target'), 0);
document.execCommand("copy"); selection.document.execCommand('Paste');
eventSender.keyDown("ArrowDown"); },
eventSender.keyDown("ArrowDown"); [
eventSender.keyDown("ArrowDown"); '<div contenteditable>',
document.execCommand("paste"); '<div>one \u00A0</div>',
} '<div>two \u00A0</div>',
</script> 'three \u00A0',
<body onload="runTest()" contenteditable="true" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> '<div>four \u00A0</div>',
<div>one &nbsp;</div> '<div id="target">two\u00A0\u00A0|</div>',
<div id="test">two &nbsp;</div>three &nbsp; '</div>',
<div>four &nbsp;</div> ]);
<div><br></div> </script>
</body>
</html>
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