 3);
    assert_equals(getSelection().direction, 'backward');
}, 'direction returns "backward" when there is a backward selection in the shadow tree');

test(() => {
    container.innerHTML = 'a<div id="host"></div>b';
    const shadowRoot = host.attachShadow({mode: 'closed'});
    shadowRoot.innerHTML = 'hello, world';
    getSelection().setBaseAndExtent(shadowRoot.firstChild, 7, container, 2);
    assert_equals(getSelection().direction, 'forward');
}, 'direction returns "forward" when there is a forward s