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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2857743006: Re-enable 3 DumpAccessibilityEvents tests that were disabled on windows. (Closed)
Patch Set: Rebase Created 3 years, 7 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: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index cb926b1a56ad614d5b036ef0f91e8bbcde3c0c5f..264a86bf9c05b2cdd2973ab9a24ec108cf0b2942 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -387,6 +387,13 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
connected_to_parent_tree_node_ = false;
}
+ // Fire any events related to changes to the tree.
+ for (auto& event : tree_events_) {
+ NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
+ event.first, event.second);
+ }
+ tree_events_.clear();
+
// Based on the changes to the tree, first fire focus events if needed.
// Screen readers might not do the right thing if they're not aware of what
// has focus, so always try that first. Nothing will be fired if the window
@@ -394,8 +401,8 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
GetRootManager()->FireFocusEventsIfNeeded(
BrowserAccessibilityEvent::FromBlink);
- // Now iterate over the events again and fire the events other than focus
- // events.
+ // Now iterate over the events from the renderer and fire the events
+ // other than focus events.
for (uint32_t index = 0; index < details.size(); index++) {
const AXEventNotificationDetails& detail = details[index];
@@ -1184,11 +1191,10 @@ void BrowserAccessibilityManager::OnAtomicUpdateFinished(
BrowserAccessibility* object = GetFromAXNode(created_node);
if (object && object->HasStringAttribute(ui::AX_ATTR_LIVE_STATUS)) {
if (object->GetRole() == ui::AX_ROLE_ALERT) {
- NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
- ui::AX_EVENT_ALERT, object);
+ tree_events_.push_back(std::make_pair(ui::AX_EVENT_ALERT, object));
} else {
- NotifyAccessibilityEvent(BrowserAccessibilityEvent::FromTreeChange,
- ui::AX_EVENT_LIVE_REGION_CREATED, object);
+ tree_events_.push_back(
+ std::make_pair(ui::AX_EVENT_LIVE_REGION_CREATED, object));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698