Fix keypad issue when ime context transit to another context
[framework/web/webkit-efl.git] / LayoutTests / accessibility / notification-listeners.html
1 <html>
2 <head>
3 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7
8 <p id="description"></p>
9
10 <select id="select" value="Select"><option>A<option>B</select>
11
12 <div id="slider" tabindex="0" role="slider" aria-valuenow="5">Slider</div>
13
14 <div id="console"></div>
15
16 <script>
17 description("This tests that a notification listener on an element only listens to that one element, and that a global notification listener listens to all notifications.");
18
19 function runTest() {
20     if (window.testRunner)
21         testRunner.waitUntilDone();
22
23     window.jsTestIsAsync = true;
24
25     window.selectNotificationCount = 0;
26     window.sliderNotificationCount = 0;
27     window.globalNotificationCount = 0;
28
29     if (window.accessibilityController) {
30         document.getElementById("select").focus();
31         window.select = accessibilityController.focusedElement;
32         select.addNotificationListener(function(notification) {
33             selectNotificationCount++;
34             debug("SELECT " + notification);
35         });
36
37         document.getElementById("slider").focus();
38         window.slider = accessibilityController.focusedElement;
39         slider.addNotificationListener(function(notification) {
40             sliderNotificationCount++;
41             debug("SLIDER " + notification);
42         });
43
44         accessibilityController.addNotificationListener(function(element, notification) {
45             if (element.isEqual(slider) || element.isEqual(select)) {
46                 globalNotificationCount++;
47                 debug("GLOBAL " + notification + " on element with role " + element.role);
48             }
49         });
50     }
51
52     // This should trigger a "invalid status changed" notification on the select.
53     document.getElementById("select").setAttribute("aria-invalid", "true");
54
55     // This should trigger a "value changed" notification on the slider.
56     document.getElementById("slider").setAttribute("aria-valuenow", "6");
57
58     window.setTimeout(function() {
59         shouldBe("selectNotificationCount", "1");
60         shouldBe("sliderNotificationCount", "1");
61         shouldBe("globalNotificationCount", "2");
62
63         if (window.accessibilityController) {
64             accessibilityController.removeNotificationListener();
65             select.removeNotificationListener();
66             slider.removeNotificationListener();
67         }
68
69         finishJSTest();
70     }, 10);
71 }
72
73 runTest();
74
75 </script>
76
77 <script src="../fast/js/resources/js-test-post.js"></script>
78 </body>
79 </html>