function assertSurroundDoesntChangeSelectionWithOffsets(
    offset1, offset2, expectedHtml) {
  const div = dom.getElement('bug1480638');
  dom.setTextContent(div, 'foobar');
  const rangeToSelect =
      Range.createFromNodes(div.firstChild, 2, div.firstChild, 5);
  rangeToSelect.select();

  const rangeToSurround =
      Range.createFromNodes(div.firstChild, offset1, div.firstChild, offset2);
  rangeToSurround.surroundWithNodes(
      dom.createDom(TagName.SPAN), dom.createDom(TagName.SPAN));

  // Make sure that the selection didn't change.
  assertHTMLEquals(
      'Selection must not change when contents are surrounded.', expectedHtml,
      Range.createFromWindow().getHtmlFragment());
}
Given two offsets into the 'foobar' node, make sure that inserting
nodes at those offsets doesn't change a selection of 'oba'.
@bug 1480638