OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link rel="help" href="http://www.w3.org/TR/2012/WD-dom-20121206/#interface-char
acterdata"> | 4 <link rel="help" href="http://www.w3.org/TR/2012/WD-dom-20121206/#interface-char
acterdata"> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 description("Tests that the CharacterData API arguments are correctly validated.
"); | 9 description("Tests that the CharacterData API arguments are correctly validated.
"); |
10 | 10 |
11 var text = document.createTextNode("abcd"); | 11 var text = document.createTextNode("abcd"); |
12 shouldBeEqualToString("text.data", "abcd"); | 12 shouldBeEqualToString("text.data", "abcd"); |
13 shouldBe("text.__proto__.__proto__", "CharacterData.prototype"); | 13 shouldBe("text.__proto__.__proto__", "CharacterData.prototype"); |
14 | 14 |
15 // appendData() | 15 // appendData() |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 shouldThrow("text.substringData()", '"TypeError: Failed to execute \'substringDa
ta\' on \'CharacterData\': 2 arguments required, but only 0 present."'); | 73 shouldThrow("text.substringData()", '"TypeError: Failed to execute \'substringDa
ta\' on \'CharacterData\': 2 arguments required, but only 0 present."'); |
74 shouldThrow("text.substringData(0)", '"TypeError: Failed to execute \'substringD
ata\' on \'CharacterData\': 2 arguments required, but only 1 present."'); | 74 shouldThrow("text.substringData(0)", '"TypeError: Failed to execute \'substringD
ata\' on \'CharacterData\': 2 arguments required, but only 1 present."'); |
75 shouldBeEqualToString("text.substringData(4, 999)", "efg"); // Length argument i
s too large, should be adjusted. | 75 shouldBeEqualToString("text.substringData(4, 999)", "efg"); // Length argument i
s too large, should be adjusted. |
76 shouldBeEqualToString("text.substringData(4, -1)", "efg"); // Length argument is
too large (after wrapping), should be adjusted. | 76 shouldBeEqualToString("text.substringData(4, -1)", "efg"); // Length argument is
too large (after wrapping), should be adjusted. |
77 shouldThrow("text.substringData(-1, 2)", '"IndexSizeError: Failed to execute \'s
ubstringData\' on \'CharacterData\': The offset 4294967295 is greater than the n
ode\'s length (7)."'); // Wraps to 4294967295 which is greater than the data len
gth | 77 shouldThrow("text.substringData(-1, 2)", '"IndexSizeError: Failed to execute \'s
ubstringData\' on \'CharacterData\': The offset 4294967295 is greater than the n
ode\'s length (7)."'); // Wraps to 4294967295 which is greater than the data len
gth |
78 shouldBeEqualToString("text.substringData(-4294967294, 3)", "cde"); // Wraps to
2, which is a valid offset. | 78 shouldBeEqualToString("text.substringData(-4294967294, 3)", "cde"); // Wraps to
2, which is a valid offset. |
79 | 79 |
80 </script> | 80 </script> |
81 </body> | 81 </body> |
82 </html> | 82 </html> |
OLD | NEW |