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

Unified Diff: LayoutTests/fast/js/script-tests/select-options-add.js

Issue 716773002: Use union types for HTMLSelectElement.add()'s arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added FIXME Created 6 years, 1 month 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/script-tests/select-options-add.js
diff --git a/LayoutTests/fast/js/script-tests/select-options-add.js b/LayoutTests/fast/js/script-tests/select-options-add.js
index aacf94d6113bc7078eb20869857a2efb28b2fde2..0703f1215b2ffa7e5fce4428938dae2171819e3b 100644
--- a/LayoutTests/fast/js/script-tests/select-options-add.js
+++ b/LayoutTests/fast/js/script-tests/select-options-add.js
@@ -237,91 +237,91 @@ debug("");
debug("2.8 Add an Option at index -2");
option2 = document.createElement("OPTION");
-shouldThrow("select2.options.add(option2, -2)");
-shouldBe("select2.options.length", "7");
+shouldNotThrow("select2.options.add(option2, -2)");
+shouldBe("select2.options.length", "8");
shouldBe("select2.selectedIndex", "1");
debug("");
debug("2.9 Add an Option at index -Infinity");
option2 = document.createElement("OPTION");
shouldNotThrow("select2.options.add(option2, -1/0)");
-shouldBe("select2.options.length", "8");
+shouldBe("select2.options.length", "9");
shouldBe("select2.selectedIndex", "2");
debug("");
debug("2.10 Add an Option at index NaN");
option2 = document.createElement("OPTION");
shouldNotThrow("select2.options.add(option2, 0/0)");
-shouldBe("select2.options.length", "9");
+shouldBe("select2.options.length", "10");
shouldBe("select2.selectedIndex", "3");
debug("");
debug("2.11 Add an Option at index Infinity");
option2 = document.createElement("OPTION");
shouldNotThrow("select2.options.add(option2, 1/0)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.12 Add a non-Option element");
option2 = document.createElement("DIV");
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.13 Add a non-element (string)");
option2 = "o";
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.14 Add a non-element (number)");
option2 = 3.14;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.15 Add a non-element (boolean)");
option2 = true;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.16 Add undefined");
option2 = undefined;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.17 Add null");
option2 = null;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.18 Add negative infinity");
option2 = -1/0;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.19 Add NaN");
option2 = 0/0;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
debug("2.20 Add positive infinity");
option2 = 1/0;
shouldThrow("select2.options.add(option2, 1)");
-shouldBe("select2.options.length", "10");
+shouldBe("select2.options.length", "11");
shouldBe("select2.selectedIndex", "4");
debug("");
« no previous file with comments | « LayoutTests/fast/forms/select/select-add-expected.txt ('k') | LayoutTests/fast/js/select-options-add-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698