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

Unified Diff: LayoutTests/accessibility/menu-list-popup-reuses-objects.html

Issue 1059503002: Re-land: Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: Fix optgroup Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/accessibility/menu-list-popup-reuses-objects.html
diff --git a/LayoutTests/accessibility/menu-list-selection-changed.html b/LayoutTests/accessibility/menu-list-popup-reuses-objects.html
similarity index 57%
copy from LayoutTests/accessibility/menu-list-selection-changed.html
copy to LayoutTests/accessibility/menu-list-popup-reuses-objects.html
index b584cee986add87c1fd8f770efde04ecca03db98..4c0d31e87594d41511a83d934e9f76e7b57640c1 100644
--- a/LayoutTests/accessibility/menu-list-selection-changed.html
+++ b/LayoutTests/accessibility/menu-list-popup-reuses-objects.html
@@ -20,20 +20,29 @@ if (window.testRunner && window.accessibilityController) {
var menulist = document.getElementById("menulist");
menulist.selectedIndex = 0;
+ var axMenuList = accessibilityController.accessibleElementById("menulist");
+ var axMenuListPopup = axMenuList.childAtIndex(0);
+ shouldBe("axMenuListPopup.role", "\"AXRole: AXMenuListPopup\"");
+ var axMenuListOption = axMenuListPopup.childAtIndex(0);
+ shouldBe("axMenuListOption.role", "\"AXRole: AXMenuListOption\"");
+
+ window.setTimeout(function() {
+
// Explore the whole accessibility tree. State change events won't fire on accessible objects that haven't
// been created yet.
accessibilityController.accessibleElementById('foo');
- var result = "";
accessibilityController.addNotificationListener(function(element, notification) {
- if (element.role == "AXRole: AXMenuListOption") {
- debug("Got notification on option " + element.stringValue + " isSelected=" + element.isSelected);
- if (element.isSelected)
- finishJSTest();
+ if (element.stringValue == axMenuListOption.stringValue) {
+ window.element = element;
+ shouldBe("element.isEqual(axMenuListOption)", "true");
+ shouldBe("element.parentElement().isEqual(axMenuListPopup)", "true");
+ finishJSTest();
}
});
- menulist.selectedIndex = 2;
+ menulist.selectedIndex = 1;
+ }, 0);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698