Chromium Code Reviews| Index: chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
| diff --git a/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
| index f1bc32e5a2f69a619317fa54158d8832595e238c..447d1a658465c2360a4080f50a41f9ad82b35465 100644 |
| --- a/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
| +++ b/chrome/browser/ui/views/accessibility/accessibility_event_router_views_unittest.cc |
| @@ -424,6 +424,36 @@ TEST_F(AccessibilityEventRouterViewsTest, AlertsFromWindowAndControl) { |
| window->CloseNow(); |
| } |
| +TEST_F(AccessibilityEventRouterViewsTest, AccessibilityFocusableView) { |
| + // Create a view with a child view. |
| + views::View* parent = new views::View(); |
| + views::View* child = new views::View(); |
| + parent->AddChildView(child); |
| + |
| + // Put the view in a window. |
| + views::Widget* window = CreateWindowWithContents(parent); |
| + |
| + // This view should be either the current view or the next accessibility |
| + // focusable view. |
| + views::View* accessible_view; |
| + |
| + // Since the child view has no accessiblity focusable ancestors, this |
| + // should still be the child view. |
| + accessible_view = |
|
sky
2014/07/25 21:12:31
nit: inline assignment so I don't have to worry ab
|
| + AccessibilityEventRouterViews::FindFirstAccessibleAncestor(child); |
| + EXPECT_EQ(accessible_view, child); |
| + |
| + // Now make the parent view accessiblity focusable. Calling |
| + // FindFirstAccessibleAncestor() again on child shoudl return the parent |
| + // view. |
| + parent->SetAccessibilityFocusable(true); |
| + accessible_view = |
| + AccessibilityEventRouterViews::FindFirstAccessibleAncestor(child); |
| + EXPECT_EQ(accessible_view, parent); |
| + |
| + window->CloseNow(); |
| +} |
| + |
| namespace { |
| class SimpleMenuDelegate : public ui::SimpleMenuModel::Delegate { |