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

Side by Side 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, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/select-add-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description('Test select.add() method'); 8 description('Test select.add() method');
9 9
10 debug('Test select'); 10 debug('Test select');
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 resetSelect(multiple); 71 resetSelect(multiple);
72 shouldBeEqualToString('addOption(Infinity)', 'X,0,1,2'); 72 shouldBeEqualToString('addOption(Infinity)', 'X,0,1,2');
73 73
74 resetSelect(multiple); 74 resetSelect(multiple);
75 shouldBeEqualToString('addOption(-Infinity)', 'X,0,1,2'); 75 shouldBeEqualToString('addOption(-Infinity)', 'X,0,1,2');
76 76
77 resetSelect(multiple); 77 resetSelect(multiple);
78 shouldBeEqualToString('addOption("foo")', 'X,0,1,2'); 78 shouldBeEqualToString('addOption("foo")', 'X,0,1,2');
79 79
80 resetSelect(multiple); 80 resetSelect(multiple);
81 shouldBeEqualToString('addOption("0")', 'X,0,1,2');
82
83 resetSelect(multiple);
84 shouldBeEqualToString('addOption("1")', '0,X,1,2');
85
86 resetSelect(multiple);
87 shouldBeEqualToString('addOption(false)', 'X,0,1,2');
88
89 resetSelect(multiple);
90 shouldBeEqualToString('addOption(true)', '0,X,1,2');
91
92 resetSelect(multiple);
93 shouldBeEqualToString('addOption(2147483647)', '0,1,2,X');
94
95 resetSelect(multiple);
96 shouldBeEqualToString('addOption(-2147483647)', '0,1,2,X');
97
98 resetSelect(multiple);
99 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
100
101 resetSelect(multiple);
102 shouldBeEqualToString('addOption(-2147483648)', '0,1,2,X');
103
104 resetSelect(multiple);
81 shouldThrow('select.add()'); 105 shouldThrow('select.add()');
82 shouldThrow('select.add("foo")'); 106 shouldThrow('select.add("foo")');
83 shouldThrow('select.add("foo", 0)'); 107 shouldThrow('select.add("foo", 0)');
84 shouldThrow('select.add(undefined)'); 108 shouldThrow('select.add(undefined)');
85 shouldThrow('select.add(undefined, 0)'); 109 shouldThrow('select.add(undefined, 0)');
86 shouldThrow('select.add(null)'); 110 shouldThrow('select.add(null)');
87 shouldThrow('select.add(null, 0)'); 111 shouldThrow('select.add(null, 0)');
112 shouldBeUndefined('select.add(new Option("X", "X", false, false), 0, 1)');
113 shouldBeUndefined('select.add(new Option("X", "X", false, false), select.opt ions[0], 2)');
88 114
89 resetSelect(multiple); 115 resetSelect(multiple);
90 var group = document.createElement('optgroup'); 116 var group = document.createElement('optgroup');
91 group.appendChild(new Option('X', 'X', false, false)); 117 group.appendChild(new Option('X', 'X', false, false));
92 group.appendChild(new Option('Y', 'Y', false, false)); 118 group.appendChild(new Option('Y', 'Y', false, false));
93 select.add(group, 1); 119 select.add(group, 1);
94 shouldBeEqualToString('getSelectOptions()', '0,X,Y,1,2'); 120 shouldBeEqualToString('getSelectOptions()', '0,X,Y,1,2');
95 } 121 }
96 </script> 122 </script>
97 </body> 123 </body>
98 </html> 124 </html>
OLDNEW
« 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