chromium/third_party/blink/web_tests/editing/selection/inactive-selection.html

<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<iframe srcdoc="<div id='input' contenteditable='true'>should be an inactive selection</div>"></iframe>
<br>
<input id='input' type="text" value="random text">
<script>
async_test(t => {
  window.onload = t.step_func_done(() => {
    var div = frames[0].document.getElementById('input');
    frames[0].getSelection().setBaseAndExtent(div, 0, div, 1);
    frames[0].focus();

    window.focus();
    document.getElementById('input').focus();

    var selectionString = frames[0].getSelection().toString();
    assert_equals(div.innerText, selectionString,
                  'Inactive selection should be retained');
  });
}, 'An editable element in one frame retains an inactive ' +
   'selection after you\'ve made a selection in another frame');
</script>