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/forms/select/select-add.html

Issue 879273002: Adding tests for HTMLSelect add() api (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/forms/select/select-add-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/select/select-add.html
diff --git a/LayoutTests/fast/forms/select/select-add.html b/LayoutTests/fast/forms/select/select-add.html
index 5e0a3d1a0bf6a4d9ed7303c597672c600df46bc5..15ff4b00d36e6dd785bafae590dd58b7d15a616f 100644
--- a/LayoutTests/fast/forms/select/select-add.html
+++ b/LayoutTests/fast/forms/select/select-add.html
@@ -78,6 +78,30 @@ function test(multiple) {
shouldBeEqualToString('addOption("foo")', 'X,0,1,2');
resetSelect(multiple);
+ shouldBeEqualToString('addOption("0")', 'X,0,1,2');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption("1")', '0,X,1,2');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(false)', 'X,0,1,2');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(true)', '0,X,1,2');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(2147483647)', '0,1,2,X');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(-2147483647)', '0,1,2,X');
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(2147483648)', '0,1,2,X');
bashi 2015/02/13 04:21:49 Is this an expected behavior?
shiva.jm 2015/02/13 04:43:57 I think as in link: http://www.w3.org/html/wg/draf
bashi 2015/02/13 04:50:29 Per the IDL spec, I guess that a TypeError should
+
+ resetSelect(multiple);
+ shouldBeEqualToString('addOption(-2147483648)', '0,1,2,X');
+
+ resetSelect(multiple);
shouldThrow('select.add()');
shouldThrow('select.add("foo")');
shouldThrow('select.add("foo", 0)');
@@ -85,6 +109,8 @@ function test(multiple) {
shouldThrow('select.add(undefined, 0)');
shouldThrow('select.add(null)');
shouldThrow('select.add(null, 0)');
+ shouldBeUndefined('select.add(new Option("X", "X", false, false), 0, 1)');
+ shouldBeUndefined('select.add(new Option("X", "X", false, false), select.options[0], 2)');
resetSelect(multiple);
var group = document.createElement('optgroup');
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/select-add-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698