Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / chromedriver / js / is_option_element_toggleable_test.html
blobc4b1ce9c3dc2342a3557b0f01ed1fa94696e319f
1 <!DOCTYPE HTML>
2 <html>
3 <script src='test.js'></script>
4 <script src='is_option_element_toggleable.js'></script>
5 <script>
7 function testNonoptionElement() {
8 try {
9 isOptionElementToggleable(document.getElementById("s"));
10 assert(false);
11 } catch (error) {
12 assert(error.message);
13 assertEquals('element is not an option', error.message);
17 function testOptionNotInSelect() {
18 try {
19 isOptionElementToggleable(document.getElementById("b"));
20 assert(false);
21 } catch (error) {
22 assert(error.message);
23 assertEquals('option element is not in a select', error.message);
27 function testTogglable() {
28 document.getElementById("s").multiple = 'multiple';
29 assert(isOptionElementToggleable(document.getElementById("a")));
32 function testNotTogglable() {
33 document.getElementById("s").multiple = '';
34 assert(!isOptionElementToggleable(document.getElementById("a")));
37 </script>
38 <body>
39 <select id="s">
40 <option id="a">a</option>
41 </select>
42 <option id = "b">b</option>
43 </body>
44 </html>