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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/listbox-focus.html

Issue 2024053003: Revert of Uses the activedescendant_changed event received from Blink to fire the right focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <select id="listbox" size="3"> 4 <select id="listbox" size="3">
5 <option id="item0">Alicia</option> 5 <option id="item0">Alicia</option>
6 <option id="item1">Peter</option> 6 <option id="item1">Peter</option>
7 <option id="item2">Kalinda</option> 7 <option id="item2">Kalinda</option>
8 </select> 8 </select>
9 <script> 9 <script>
10 async_test(function(t) 10 async_test(function(t)
11 { 11 {
12 var listbox = document.getElementById("listbox"); 12 var listbox = document.getElementById("listbox");
13 listbox.selectedIndex = 0; 13 listbox.selectedIndex = 0;
14 listbox.focus(); 14 listbox.focus();
15 15
16 accessibilityController.accessibleElementById('dummy'); 16 accessibilityController.accessibleElementById('dummy');
17 17
18 var gotCheckedStateChanged = false; 18 var gotCheckedStateChanged = false;
19 var gotSelectedChildrenChanged = false; 19 var gotSelectedChildrenChanged = false;
20 var gotFocus = false;
20 21
21 window.setTimeout(function() { 22 window.setTimeout(function() {
22 var result = ""; 23 var result = "";
23 accessibilityController.addNotificationListener(t.step_func(function lis tener(element, notification) { 24 accessibilityController.addNotificationListener(t.step_func(function lis tener(element, notification) {
24 if (notification == "CheckedStateChanged") { 25 if (notification == "CheckedStateChanged") {
25 assert_equals(element.role, "AXRole: AXListBoxOption"); 26 assert_equals(element.role, "AXRole: AXListBoxOption");
26 gotCheckedStateChanged = true; 27 gotCheckedStateChanged = true;
27 } 28 }
28 if (notification == "SelectedChildrenChanged") { 29 if (notification == "SelectedChildrenChanged") {
29 assert_equals(element.role, "AXRole: AXListBox"); 30 assert_equals(element.role, "AXRole: AXListBox");
30 gotSelectedChildrenChanged = true; 31 gotSelectedChildrenChanged = true;
31 } 32 }
32 if (gotCheckedStateChanged && gotSelectedChildrenChanged) { 33 if (notification == "Focus") {
34 assert_equals(element.role, "AXRole: AXListBoxOption");
35 gotFocus = true;
36 }
37 if (gotCheckedStateChanged && gotSelectedChildrenChanged && gotFocus ) {
33 t.done(); 38 t.done();
34 } 39 }
35 })); 40 }));
36 41
37 listbox.selectedIndex = 1; 42 listbox.selectedIndex = 1;
38 }, 0); 43 }, 0);
39 }, "menu list fires correct events when active index changes."); 44 }, "menu list fires focus event on close");
40 </script> 45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698