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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc

Issue 2119413004: a11y: Exclude children of nested keyboard accessible controls from a11y tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of 2704263002. Created 3 years, 10 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: ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
index 87616833a3135b3ee77a3cbd793bf3657b154c84..20bbadbcab95ca7f05907c590815c8b2daa14d57 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
@@ -158,32 +158,31 @@ TEST_F(TabbedPaneTest, SelectTabWithAccessibleAction) {
// Check the a11y information for each tab.
for (int i = 0; i < kNumTabs; ++i) {
- NativeViewAccessibility* nva = NativeViewAccessibility::Create(GetTabAt(i));
- ui::AXNodeData data = nva->GetData();
+ ui::AXNodeData data =
tapted 2017/02/21 06:01:12 same here - can these just be unique_ptr?
Patti Lor 2017/02/27 05:31:04 Done.
+ NativeViewAccessibility::GetForView(GetTabAt(i))->GetData();
SCOPED_TRACE(testing::Message() << "Tab at index: " << i);
EXPECT_EQ(ui::AX_ROLE_TAB, data.role);
EXPECT_EQ(DefaultTabTitle(), data.GetString16Attribute(ui::AX_ATTR_NAME));
EXPECT_TRUE(data.HasStateFlag(ui::AX_STATE_SELECTABLE));
EXPECT_EQ(i == 0, data.HasStateFlag(ui::AX_STATE_SELECTED));
- nva->Destroy();
}
ui::AXActionData action;
action.action = ui::AX_ACTION_SET_SELECTION;
// Select the first tab.
- NativeViewAccessibility* nva = NativeViewAccessibility::Create(GetTabAt(0));
- nva->AccessibilityPerformAction(action);
+
+ NativeViewAccessibility::GetForView(GetTabAt(0))
+ ->AccessibilityPerformAction(action);
EXPECT_EQ(0, tabbed_pane_->GetSelectedTabIndex());
- nva->Destroy();
// Select the second tab.
- nva = NativeViewAccessibility::Create(GetTabAt(1));
+ NativeViewAccessibility* nva =
+ NativeViewAccessibility::GetForView(GetTabAt(1));
nva->AccessibilityPerformAction(action);
EXPECT_EQ(1, tabbed_pane_->GetSelectedTabIndex());
// Select the second tab again.
nva->AccessibilityPerformAction(action);
EXPECT_EQ(1, tabbed_pane_->GetSelectedTabIndex());
- nva->Destroy();
widget->CloseNow();
}

Powered by Google App Engine
This is Rietveld 408576698