| OLD | NEW |
| (Empty) |
| 1 description("Test that collapseToStart() and collapseToEnd() throw INVALID_STATE
_ERR if no selection is made."); | |
| 2 | |
| 3 var sel = window.getSelection(); | |
| 4 var textNode = document.createTextNode("abcdef"); | |
| 5 document.body.appendChild(textNode); | |
| 6 | |
| 7 shouldThrow("sel.collapseToStart()", '"InvalidStateError: Failed to execute \'co
llapseToStart\' on \'Selection\': there is no selection."'); | |
| 8 shouldThrow("sel.collapseToEnd()", '"InvalidStateError: Failed to execute \'coll
apseToEnd\' on \'Selection\': there is no selection."'); | |
| 9 | |
| 10 sel.selectAllChildren(textNode); | |
| 11 | |
| 12 shouldBe("sel.collapseToStart()", "undefined"); | |
| 13 shouldBe("sel.collapseToEnd()", "undefined"); | |
| 14 | |
| 15 document.body.removeChild(textNode); | |
| OLD | NEW |