Update device orientation & motion permission native SPI as per latest proposal
[WebKit-https.git] / LayoutTests / accessibility / combo-box-collapsed-selection-changed.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script>
6
7 </script>
8 </head>
9 <body>
10 <form>
11 <select id="combo">
12 <option selected value='foo'>foo</option>
13 <option value='bar'>bar</option>
14 <option value='baz'>baz</option>
15 </select>
16 </form>
17
18 <p id="description"></p>
19 <div id="console"></div>
20
21 <script>
22 window.jsTestIsAsync = true;
23
24 description("This tests that a combo box notifies when the selected child has changed while arrowing through the options of a combobox while collapsed.");
25
26 var selectionChangedNotifications = 0;
27
28 if (window.testRunner && window.accessibilityController) {
29     testRunner.dumpAsText();
30
31     // Focus in the combobox and move around the options. The signal
32     // 'state-change:selected' should be emitted with every change.
33     document.getElementById("combo").focus();
34
35     axCombo = accessibilityController.focusedElement;
36     axCombo.addNotificationListener(function (notification) {
37         if (notification == "AXSelectedChildrenChanged")
38             selectionChangedNotifications++;
39     });
40
41     eventSender.keyDown("downArrow");
42     eventSender.keyDown("downArrow");
43     eventSender.keyDown("upArrow");
44     eventSender.keyDown("upArrow");
45
46     window.setTimeout(function() {
47         if (window.accessibilityController)
48             axCombo.removeNotificationListener();
49
50         shouldBe("selectionChangedNotifications", "4");
51         finishJSTest();
52     }, 0);
53 }
54 </script>
55 <script src="../resources/js-test-post.js"></script>
56 </body>
57 </html>