chromium/third_party/blink/web_tests/editing/spelling/spellcheck_with_text_directions.html

<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>

<script>
spellcheck_test(
    [
      '<div contenteditable>',
        '|the the adlj adaasj sdklj. there there',
      '</div>'
    ].join(''),
    '',
    [
      '<div contenteditable>',
        'the ~the~ #adlj# #adaasj# #sdklj#. there ~there~',
      '</div>'
    ].join(''),
    'LTR');

spellcheck_test(
    [
      '<div contenteditable style="direction: rtl; unicode-bidi: bidi-override;">',
        '|the the adlj adaasj sdklj. there there',
      '</div>'
    ].join(''),
    '',
    [
      '<div contenteditable style="direction: rtl; unicode-bidi: bidi-override;">',
        'the ~the~ #adlj# #adaasj# #sdklj#. there ~there~',
      '</div>'
    ].join(''),
    'RTL');

spellcheck_test(
    [
      '<div contenteditable style="text-overflow:ellipsis">',
        '|the the adlj adaasj sdklj. there there',
      '</div>'
    ].join(''),
    '',
    [
      '<div contenteditable style="text-overflow:ellipsis">',
        'the ~the~ #adlj# #adaasj# #sdklj#. there ~there~',
      '</div>'
    ].join(''),
    'LTR (text-overflow:ellipses)');

spellcheck_test(
    [
      '<div contenteditable style="direction: rtl; unicode-bidi: bidi-override; text-overflow:ellipsis">',
        '|the the adlj adaasj sdklj. there there',
      '</div>'
    ].join(''),
    '',
    [
      '<div contenteditable style="direction: rtl; unicode-bidi: bidi-override; text-overflow:ellipsis">',
        'the ~the~ #adlj# #adaasj# #sdklj#. there ~there~',
      '</div>'
    ].join(''),
    'RTL (text-overflow:ellipses)');
</script>