<div id="container">
<p id="description"></p>
<ol>
<li>Place the caret at the start of the second line</li>
<li>Hit Baskspace or Delete to a back-delete</li>
<li>The two lines should then be merged and the caret should get placed after the text control.</li>
</ol>
<div contenteditable="true">
<span id="sample">text1<input type="text"/><br>text2</span>
</div>
</div>
<div id="console"></div>
<script src="../../resources/js-test.js"></script>
<script>
description('Testcase for verifying that the &lt;br&gt; does not get deleted when inlined after some non-textual content.');
function $(id) { return document.getElementById(id); }

function absoluteCaretBounds(node) {
    return window.internals ? internals.absoluteCaretBounds(node) : '';
}

var selection = window.getSelection();
selection.collapse(('sample'), 2);
var expectedCaretRect = absoluteCaretBounds(document);

selection.collapse(('sample'), 3);
document.execCommand("Delete");
var caretRect = absoluteCaretBounds(document);

shouldBe("caretRect.left", "expectedCaretRect.left");
shouldBe("caretRect.top", "expectedCaretRect.top");

if (window.testRunner)
    $('container').outerHTML = '';
</script>
<script src="../../resources/js-test.js"></script>

<div id="container">
<p id="description"></p>
<ol>
<li>Place the caret at the start of the second line</li>
<li>Hit Baskspace or Delete to a back-delete</li>
<li>The two lines should then be merged and the caret should get placed after the text control.</li>
</ol>
<div contenteditable="true">
<span id="sample">text1<input type="text"/><br>text2</span>
</div>
</div>
<div id="console"></div>
<script src="../../resources/js-test.js"></script>
<script>
description('Testcase for verifying that the &lt;br&gt; does not get deleted when inlined after some non-textual content.');
function $(id) { return document.getElementById(id); }

function absoluteCaretBounds(node) {
    return window.internals ? internals.absoluteCaretBounds(node) : '';
}

var selection = window.getSelection();
selection.collapse($('sample'), 2);
var expectedCaretRect = absoluteCaretBounds(document);

selection.collapse($('sample'), 3);
document.execCommand('Delete');
var caretRect = absoluteCaretBounds(document);

shouldBe('caretRect.left', 'expectedCaretRect.left');
shouldBe('caretRect.top', 'expectedCaretRect.top');

if (window.testRunner)
    $('container').outerHTML = '';
</script>
<script src="../../resources/js-test.js"></script>

Fix a broken selection test.
Fix a broken selection test.

Call function $(id) correctly.

BUG=

Review URL: https://codereview.chromium.org/230373002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@171130 bbb929c8-8fbe-4397-9dbb-9b2b20218538
