<!doctype HTML>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=51344">WebKit issue 51344</a>: move left/right by character should not hang.
<div id="ltr" dir="ltr" contenteditable>١١123مارس</div>
<div id="rtl" dir="rtl" contenteditable>זח ‪דה‪car ו‬‬ </div>
<div id="log"></div>
<script>
test(function() {
var sample = document.getElementById('ltr');
var selection = window.getSelection();
selection.collapse(sample.firstChild, 6);
selection.modify('move', 'right', 'character');
assert_equals(selection.anchorOffset, 7);
}, 'move right character');
test(function() {
var sample = document.getElementById('rtl');
var selection = window.getSelection();
selection.collapse(sample.firstChild, 3);
selection.modify('move', 'left', 'character');
assert_equals(selection.anchorOffset, 4);
}, 'move left character');
</script>