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

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

Issue 2746813002: Hide AXPlatformNode on ChromeOS. (Closed)
Patch Set: has_native_accessibility Created 3 years, 9 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 3a5287614e9d52581935917881aefacfd7ccc0a3..37a006055be544ca872e1f75b275141a6147eb88 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc
@@ -12,8 +12,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enums.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
-#include "ui/views/accessibility/native_view_accessibility.h"
#include "ui/views/test/test_views.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
@@ -158,8 +158,14 @@ TEST_F(TabbedPaneTest, SelectTabWithAccessibleAction) {
// Check the a11y information for each tab.
for (int i = 0; i < kNumTabs; ++i) {
- ui::AXNodeData data =
- NativeViewAccessibility::Create(GetTabAt(i))->GetData();
+ ui::AXNodeData data;
+
+ // AXViewObjWrapper::Serialize() and NativeViewAccessibilityBase::GetData()
+ // are normally responsible for clearing the state from the default
+ // AXNodeData constructor. Do the same here.
+ data.state = 0;
+
+ GetTabAt(i)->GetAccessibleNodeData(&data);
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));
@@ -171,20 +177,16 @@ TEST_F(TabbedPaneTest, SelectTabWithAccessibleAction) {
action.action = ui::AX_ACTION_SET_SELECTION;
// Select the first tab.
- NativeViewAccessibility::Create(GetTabAt(0))
- ->AccessibilityPerformAction(action);
+ GetTabAt(0)->HandleAccessibleAction(action);
EXPECT_EQ(0, tabbed_pane_->GetSelectedTabIndex());
// Select the second tab.
- std::unique_ptr<NativeViewAccessibility> nva =
- NativeViewAccessibility::Create(GetTabAt(1));
- nva->AccessibilityPerformAction(action);
+ GetTabAt(1)->HandleAccessibleAction(action);
EXPECT_EQ(1, tabbed_pane_->GetSelectedTabIndex());
// Select the second tab again.
- nva->AccessibilityPerformAction(action);
+ GetTabAt(1)->HandleAccessibleAction(action);
EXPECT_EQ(1, tabbed_pane_->GetSelectedTabIndex());
- nva.reset();
widget->CloseNow();
}
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_win_unittest.cc ('k') | ui/views/controls/webview/webview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698