blob: 433fcc5368936657f3075e0c7e34aac6c6659835 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests passing bad input to the Selection API.");
var selection = getSelection();
debug("* Not passing enough parameters");
shouldThrowErrorName("selection.collapse()", "TypeError");
shouldThrowErrorName("selection.containsNode()", "TypeError");
shouldThrowErrorName("selection.selectAllChildren()", "TypeError");
shouldThrowErrorName("selection.extend()", "TypeError");
shouldThrowErrorName("selection.getRangeAt()", "TypeError");
shouldThrowErrorName("selection.addRange()", "TypeError");
shouldThrowErrorName("selection.setBaseAndExtent()", "TypeError");
shouldThrowErrorName("selection.setBaseAndExtent(document.body)", "TypeError");
shouldThrowErrorName("selection.setBaseAndExtent(document.body, 0)", "TypeError");
shouldThrowErrorName("selection.setBaseAndExtent(document.body, 0, document.body)", "TypeError");
shouldThrowErrorName("selection.setPosition()", "TypeError");
debug("");
debug("* Passing null for non-nullable parameters");
shouldThrowErrorName("selection.containsNode(null)", "TypeError");
shouldThrowErrorName("selection.selectAllChildren(null)", "TypeError");
shouldThrowErrorName("selection.extend(null)", "TypeError");
shouldThrowErrorName("selection.addRange(null)", "TypeError");
debug("");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>