ript src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup(() => {
  dialog.showModal();
  add_completion_callback(() => {
    dialog.close();
    getSelection().removeAllRanges();
  });
});

function checkSelection(expectedText) {
  const selection = getSelection();
  selection.selectAllChildren(document.documentElement);
  const actualText = selection.toString().trim();
  assert_equals(actualText, expectedText);
}

test(function() {
  checkSelecti