js"></script>
<script src='../../../resources/testdriver-vendor.js'></script>
<div id="container"></div>
<script>

test(() => {
    getSelection().removeAllRanges();
    assert_equals(getSelection().direction, 'none');
}, 'direction returns "none" when there is no selection');

test(() => {
    container.innerHTML = 'hello, world';
    getSelection().setBaseAndExtent(container.firstChild, 0, container.firstChild, 5);
    assert_equals(getSelection().direction, 'forward');
}, 'direction returns "forward" whe