blob: b6598dfb7f30f7cd8b3254cc27e40ee35aa614b3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description("Tests the splitText API arguments.");
var text = document.createTextNode("abcdefg");
shouldBeEqualToString("text.data", "abcdefg");
shouldBeEqualToString("text.splitText(4).data", "efg");
shouldBeEqualToString("text.data", "abcd");
shouldThrow("text.splitText()", "'TypeError: Not enough arguments'");
shouldThrowErrorName("text.splitText(999)", 'IndexSizeError');
shouldThrowErrorName("text.splitText(-1)", 'IndexSizeError');
shouldBeEqualToString("text.data", "abcd");
shouldBeEqualToString("text.splitText(-4294967294).data", "cd");
shouldBeEqualToString("text.data", "ab");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>