Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: LayoutTests/fast/dom/characterdata-api-arguments.html

Issue 21581003: Drop [IsIndex] attribute from CharacterData API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/characterdata-api-arguments-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/characterdata-api-arguments.html
diff --git a/LayoutTests/fast/dom/characterdata-api-arguments.html b/LayoutTests/fast/dom/characterdata-api-arguments.html
index fec0c18f61eb954c8c84a749cc8e238ad2658f24..00d728f1310273a14b57678ac4ac35fbbc571969 100644
--- a/LayoutTests/fast/dom/characterdata-api-arguments.html
+++ b/LayoutTests/fast/dom/characterdata-api-arguments.html
@@ -28,7 +28,7 @@ shouldThrow("text.insertData(0)", "'TypeError: Not enough arguments'");
shouldBeEqualToString("text.data", "abcdefg");
shouldThrow("text.insertData(999, 'test')", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // offset greater than length.
shouldBeEqualToString("text.data", "abcdefg");
-shouldNotThrow("text.insertData(-4294967294, 'test')");
+shouldNotThrow("text.insertData(-4294967294, 'test')"); // Wraps to 2, which is a valid offset.
shouldBeEqualToString("text.data", "abtestcdefg");
// deleteData()
@@ -41,7 +41,9 @@ shouldThrow("text.deleteData(0)", "'TypeError: Not enough arguments'");
shouldBeEqualToString("text.data", "abcd");
shouldThrow("text.deleteData(999, 3)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // offset greater than length.
shouldBeEqualToString("text.data", "abcd");
-shouldNotThrow("text.deleteData(-4294967294, 2)");
+shouldThrow("text.deleteData(-1, 3)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // Wraps to 4294967295 which is greater than the data length
+shouldBeEqualToString("text.data", "abcd");
+shouldNotThrow("text.deleteData(-4294967294, 2)"); // Wraps to 2, which is a valid offset.
shouldBeEqualToString("text.data", "ab");
shouldNotThrow("text.deleteData(1, 999)"); // Length argument is too large, should be adjusted.
shouldBeEqualToString("text.data", "a");
@@ -58,10 +60,20 @@ shouldThrow("text.replaceData(0, 0)", "'TypeError: Not enough arguments'");
shouldBeEqualToString("text.data", "abcdefg");
shouldThrow("text.replaceData(999, 3, 'test')", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // offset greater than length.
shouldBeEqualToString("text.data", "abcdefg");
-shouldNotThrow("text.replaceData(-4294967294, 0, 'test')");
+shouldThrow("text.replaceData(-1, 3, 'test')", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // Wraps to 4294967295 which is greater than the data length
+shouldBeEqualToString("text.data", "abcdefg");
+shouldNotThrow("text.replaceData(-4294967294, 0, 'test')"); // Wraps to 2, which is a valid offset.
shouldBeEqualToString("text.data", "abtestcdefg");
shouldNotThrow("text.replaceData(1, 999, 'aaa')"); // Length argument is too large, should be adjusted.
shouldBeEqualToString("text.data", "aaaa");
+
+// substringData()
+text.data = "abcdefg";
+shouldBeEqualToString("text.substringData(4, 3)", "efg");
+shouldBeEqualToString("text.substringData(4, 999)", "efg"); // Length argument is too large, should be adjusted.
+shouldThrow("text.substringData(-1, 2)", "'IndexSizeError: Index or size was negative, or greater than the allowed value.'"); // Wraps to 4294967295 which is greater than the data length
+shouldBeEqualToString("text.substringData(-4294967294, 3)", "cde"); // Wraps to 2, which is a valid offset.
+
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/characterdata-api-arguments-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698