Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / select / select-disabled.html
blobd79c44be6495dd59f97aad041be51ba6159601d9
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="../resources/common.js"></script>
6 </head>
7 <body>
9 <select id=select1 size=3>
10 <option selected>a</option>
11 <option>b</option>
12 <option>c</option>
13 </select>
15 <select id=select2>
16 <option selected>a</option>
17 <option>b</option>
18 <option>c</option>
19 </select>
21 <select id=select3>
22 <option selected>a</option>
23 </select>
25 <select id=select4>
26 <option selected>a</option>
27 <option>b</option>
28 <option>c</option>
29 </select>
31 <input id="text"></input>
33 <script>
34 description('Tests that user cannot change disabled select by keyboard');
36 var select1 = document.getElementById('select1');
37 select1.focus();
38 shouldBeEqualToString('select1.value', 'a');
39 eventSender.keyDown('downArrow');
40 shouldBeEqualToString('select1.value', 'b');
41 select1.disabled = true;
42 eventSender.keyDown('downArrow');
43 shouldBeEqualToString('select1.value', 'b');
44 eventSender.keyDown('c');
45 shouldBeEqualToString('select1.value', 'b');
47 var select2 = document.getElementById('select2');
48 select2.focus();
49 shouldBeEqualToString('select2.value', 'a');
50 eventSender.keyDown('b');
51 shouldBeEqualToString('select2.value', 'b');
52 select2.disabled = true;
53 eventSender.keyDown('downArrow');
54 shouldBeEqualToString('select2.value', 'b');
55 eventSender.keyDown('c');
56 shouldBeEqualToString('select2.value', 'b');
58 debug('Tests on select disable, popup menu is hidden');
59 var select3 = document.getElementById('select3');
60 clickElement(select3);
61 shouldBeTrue("internals.isSelectPopupVisible(select3)");
62 select3.disabled = true;
63 shouldBeFalse("internals.isSelectPopupVisible(select3)");
65 debug('Tests on select disable, value cannot be changed');
66 var select4 = document.getElementById('select4');
67 select4.focus();
68 eventSender.keyDown('b');
69 shouldBeEqualToString('select4.value', 'b');
70 select4.disabled = true;
71 eventSender.keyDown('c');
72 shouldBeEqualToString('select4.value', 'b');
75 </script>
76 </body>
77 </html>