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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/menu-list-open.html

Issue 1899823002: 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: Fixed menu-list-open Layout test. 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="menulist"> 4 <select id="menulist">
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 menulist = document.getElementById("menulist"); 12 var menulist = document.getElementById("menulist");
13 menulist.selectedIndex = 0; 13 menulist.selectedIndex = 0;
14 menulist.focus(); 14 menulist.focus();
15 15
16 var result = ""; 16 var eventCount = 0;
17 accessibilityController.addNotificationListener(function listener(element, n otification) { 17 accessibilityController.addNotificationListener(function listener(element, n otification) {
18 if (notification == "Focus") { 18 if (notification == "ActiveDescendantChanged") {
19 assert_equals(element.role, "AXRole: AXMenuListPopup");
20 ++eventCount;
21 }
22 if (notification == "MenuListItemSelected") {
19 assert_equals(element.role, "AXRole: AXMenuListOption"); 23 assert_equals(element.role, "AXRole: AXMenuListOption");
20 assert_equals(element.name, "Alicia"); 24 assert_equals(element.name, "Alicia");
25 ++eventCount;
26 }
27
28 if (eventCount == 2)
21 t.done(); 29 t.done();
22 }
23 }); 30 });
24 31
25 var axMenuList = accessibilityController.accessibleElementById("menulist"); 32 var axMenuList = accessibilityController.accessibleElementById("menulist");
26 eventSender.mouseMoveTo(axMenuList.x + 10, axMenuList.y + 10); 33 eventSender.mouseMoveTo(axMenuList.x + 10, axMenuList.y + 10);
27 eventSender.mouseDown(); 34 eventSender.mouseDown();
28 eventSender.mouseUp(); 35 eventSender.mouseUp();
29 }, "menu list fires focus event on open"); 36 }, "menu list fires correct events on open");
30 </script> 37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698