<html>
<title>InputEvent: Invalid selection should not crash</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
async_test(t => {
assert_not_equals(window.testRunner, undefined, 'This test requires testRunner.');
document.addEventListener('DOMContentLoaded', t.step_func_done(() => {
document.designMode = 'on';
document.execCommand('selectAll');
document.execCommand('insertText', false, 'abc');
document.documentElement.innerText = null;
testRunner.execCommand('undo');
}));
});
</script>
</html>