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

Unified Diff: LayoutTests/fast/js/resources/select-options-remove.js

Issue 23602016: Make index argument to HTMLOptionsCollection.remove() mandatory (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
Index: LayoutTests/fast/js/resources/select-options-remove.js
diff --git a/LayoutTests/fast/js/resources/select-options-remove.js b/LayoutTests/fast/js/resources/select-options-remove.js
index 7c1b007fd98c2a392d2651367148a73e3cdc9dc7..fa112681a67eb92ebf9ef1e110f8e84ef111993f 100644
--- a/LayoutTests/fast/js/resources/select-options-remove.js
+++ b/LayoutTests/fast/js/resources/select-options-remove.js
@@ -67,7 +67,7 @@ shouldBe("select1.selectedIndex", "-1");
debug("");
debug("1.10 Remove no args from empty Options");
-shouldBe("select1.options.remove()", "undefined");
+shouldThrow("select1.options.remove()", "'TypeError: Not enough arguments'");
shouldBe("select1.options.length", "0");
shouldBe("select1.selectedIndex", "-1");
debug("");
@@ -194,45 +194,45 @@ shouldBe("select2.options[0].value", "'K'");
debug("");
debug("2.11 Remove no args from non-empty Options");
-shouldBe("select2.options.remove()", "undefined");
-shouldBe("select2.options.length", "5");
-shouldBe("select2.selectedIndex", "3");
-shouldBe("select2.options[0].value", "'L'");
+shouldThrow("select2.options.remove()", "'TypeError: Not enough arguments'");
+shouldBe("select2.options.length", "6");
+shouldBe("select2.selectedIndex", "4");
+shouldBe("select2.options[0].value", "'K'");
debug("");
debug("2.12 Remove too many args from non-empty Options");
shouldThrow("select2.options.remove(0, 'foo')");
-shouldBe("select2.options.length", "5");
-shouldBe("select2.selectedIndex", "3");
-shouldBe("select2.options[0].value", "'L'");
+shouldBe("select2.options.length", "6");
+shouldBe("select2.selectedIndex", "4");
+shouldBe("select2.options[0].value", "'K'");
debug("");
debug("2.13 Remove invalid index -2 from non-empty Options");
shouldBe("select2.options.remove(-2)", "undefined");
-shouldBe("select2.options.length", "5");
-shouldBe("select2.selectedIndex", "3");
-shouldBe("select2.options[2].value", "'N'");
+shouldBe("select2.options.length", "6");
+shouldBe("select2.selectedIndex", "4");
+shouldBe("select2.options[2].value", "'M'");
debug("");
debug("2.14 Remove invalid index -1 from non-empty Options");
shouldBe("select2.options.remove(-1)", "undefined");
-shouldBe("select2.options.length", "5");
-shouldBe("select2.selectedIndex", "3");
-shouldBe("select2.options[3].value", "'O'");
+shouldBe("select2.options.length", "6");
+shouldBe("select2.selectedIndex", "4");
+shouldBe("select2.options[3].value", "'N'");
debug("");
debug("2.15 Remove index 0 from non-empty Options");
shouldBe("select2.options.remove(0)", "undefined");
-shouldBe("select2.options.length", "4");
-shouldBe("select2.selectedIndex", "2");
-shouldBe("select2.options[0].value", "'M'");
+shouldBe("select2.options.length", "5");
+shouldBe("select2.selectedIndex", "3");
+shouldBe("select2.options[0].value", "'L'");
debug("");
debug("2.16 Remove index 1 from non-empty Options");
shouldBe("select2.options.remove(1)", "undefined");
-shouldBe("select2.options.length", "3");
-shouldBe("select2.selectedIndex", "1");
-shouldBe("select2.options[1].value", "'O'");
+shouldBe("select2.options.length", "4");
+shouldBe("select2.selectedIndex", "2");
+shouldBe("select2.options[1].value", "'N'");
debug("");
debug("2.17 Detach select element");

Powered by Google App Engine
This is Rietveld 408576698