From a7a8fa286e2e9b82c917661cd80aa3cbe8dbaf59 Mon Sep 17 00:00:00 2001 From: "ddkilzer@apple.com" Date: Sun, 25 Nov 2007 07:15:33 +0000 Subject: [PATCH] Added tests for select.options.remove(boolean). Reviewed by Maciej. * fast/js/resources/select-options-add.js: Added two tests. * fast/js/select-options-add-expected.txt: Updated results. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28012 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 9 +++++ .../fast/js/resources/select-options-add.js | 34 +++++++++++++------ .../fast/js/select-options-add-expected.txt | 30 ++++++++++------ 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 59cb7026d612..8b263bdf21dd 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2007-11-24 David D. Kilzer + + Added tests for select.options.remove(boolean). + + Reviewed by Maciej. + + * fast/js/resources/select-options-add.js: Added two tests. + * fast/js/select-options-add-expected.txt: Updated results. + 2007-11-23 Antti Koivisto Set video src from script, not from the element attribute. This diff --git a/LayoutTests/fast/js/resources/select-options-add.js b/LayoutTests/fast/js/resources/select-options-add.js index 8457280fcc3f..d7317032196d 100644 --- a/LayoutTests/fast/js/resources/select-options-add.js +++ b/LayoutTests/fast/js/resources/select-options-add.js @@ -73,35 +73,42 @@ shouldBe("select1.options.length", "3"); shouldBe("select1.selectedIndex", "0"); debug(""); -debug("1.7 Add undefined"); +debug("1.7 Add a non-element (boolean)"); +option1 = true; +shouldThrow("select1.options.add(option1)"); +shouldBe("select1.options.length", "3"); +shouldBe("select1.selectedIndex", "0"); +debug(""); + +debug("1.8 Add undefined"); option1 = undefined; shouldThrow("select1.options.add(option1)"); shouldBe("select1.options.length", "3"); shouldBe("select1.selectedIndex", "0"); debug(""); -debug("1.8 Add null"); +debug("1.9 Add null"); option1 = null; shouldThrow("select1.options.add(option1)"); shouldBe("select1.options.length", "3"); shouldBe("select1.selectedIndex", "0"); debug(""); -debug("1.9 Add negative infinity"); +debug("1.10 Add negative infinity"); option1 = -1/0; shouldThrow("select1.options.add(option1)"); shouldBe("select1.options.length", "3"); shouldBe("select1.selectedIndex", "0"); debug(""); -debug("1.10 Add NaN"); +debug("1.11 Add NaN"); option1 = 0/0; shouldThrow("select1.options.add(option1)"); shouldBe("select1.options.length", "3"); shouldBe("select1.selectedIndex", "0"); debug(""); -debug("1.11 Add positive infinity"); +debug("1.12 Add positive infinity"); option1 = 1/0; shouldThrow("select1.options.add(option1)"); shouldBe("select1.options.length", "3"); @@ -277,35 +284,42 @@ shouldBe("select2.options.length", "7"); shouldBe("select2.selectedIndex", "1"); debug(""); -debug("2.15 Add undefined"); +debug("2.15 Add a non-element (boolean)"); +option2 = true; +shouldThrow("select2.options.add(option2, 1)"); +shouldBe("select2.options.length", "7"); +shouldBe("select2.selectedIndex", "1"); +debug(""); + +debug("2.16 Add undefined"); option2 = undefined; shouldThrow("select2.options.add(option2, 1)"); shouldBe("select2.options.length", "7"); shouldBe("select2.selectedIndex", "1"); debug(""); -debug("2.16 Add null"); +debug("2.17 Add null"); option2 = null; shouldThrow("select2.options.add(option2, 1)"); shouldBe("select2.options.length", "7"); shouldBe("select2.selectedIndex", "1"); debug(""); -debug("2.17 Add negative infinity"); +debug("2.18 Add negative infinity"); option2 = -1/0; shouldThrow("select2.options.add(option2, 1)"); shouldBe("select2.options.length", "7"); shouldBe("select2.selectedIndex", "1"); debug(""); -debug("2.18 Add NaN"); +debug("2.19 Add NaN"); option2 = 0/0; shouldThrow("select2.options.add(option2, 1)"); shouldBe("select2.options.length", "7"); shouldBe("select2.selectedIndex", "1"); debug(""); -debug("2.19 Add positive infinity"); +debug("2.20 Add positive infinity"); option2 = 1/0; shouldThrow("select2.options.add(option2, 1)"); shouldBe("select2.options.length", "7"); diff --git a/LayoutTests/fast/js/select-options-add-expected.txt b/LayoutTests/fast/js/select-options-add-expected.txt index f9c03fe2690f..afc6d1368ea8 100644 --- a/LayoutTests/fast/js/select-options-add-expected.txt +++ b/LayoutTests/fast/js/select-options-add-expected.txt @@ -43,27 +43,32 @@ PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM PASS select1.options.length is 3 PASS select1.selectedIndex is 0 -1.7 Add undefined +1.7 Add a non-element (boolean) PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select1.options.length is 3 PASS select1.selectedIndex is 0 -1.8 Add null +1.8 Add undefined PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select1.options.length is 3 PASS select1.selectedIndex is 0 -1.9 Add negative infinity +1.9 Add null PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select1.options.length is 3 PASS select1.selectedIndex is 0 -1.10 Add NaN +1.10 Add negative infinity PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select1.options.length is 3 PASS select1.selectedIndex is 0 -1.11 Add positive infinity +1.11 Add NaN +PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. +PASS select1.options.length is 3 +PASS select1.selectedIndex is 0 + +1.12 Add positive infinity PASS select1.options.add(option1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select1.options.length is 3 PASS select1.selectedIndex is 0 @@ -187,27 +192,32 @@ PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: D PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -2.15 Add undefined +2.15 Add a non-element (boolean) +PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. +PASS select2.options.length is 7 +PASS select2.selectedIndex is 1 + +2.16 Add undefined PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -2.16 Add null +2.17 Add null PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -2.17 Add negative infinity +2.18 Add negative infinity PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -2.18 Add NaN +2.19 Add NaN PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -2.19 Add positive infinity +2.20 Add positive infinity PASS select2.options.add(option2, 1) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. PASS select2.options.length is 7 PASS select2.selectedIndex is 1 -- 2.36.0