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

Unified Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Fix test Created 4 years, 1 month 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
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 4786bf1ed8b42e7287e028717f636d260e4b03eb..dc14cc4a209afe6058e84dcf49c39f7939281959 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -20,7 +20,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
-#include "ui/accessibility/ax_view_state.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/dragdrop/drag_drop_types.h"
@@ -2997,18 +2997,22 @@ TEST_F(TextfieldTest, AccessiblePasswordTest) {
InitTextfield();
textfield_->SetText(ASCIIToUTF16("password"));
- ui::AXViewState state_regular;
- textfield_->GetAccessibleState(&state_regular);
- EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_regular.role);
- EXPECT_EQ(ASCIIToUTF16("password"), state_regular.value);
- EXPECT_FALSE(state_regular.HasStateFlag(ui::AX_STATE_PROTECTED));
+ ui::AXNodeData node_data_regular;
+ node_data_regular.state = 0;
+ textfield_->GetAccessibleNodeData(&node_data_regular);
+ EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, node_data_regular.role);
+ EXPECT_EQ(ASCIIToUTF16("password"),
+ node_data_regular.GetString16Attribute(ui::AX_ATTR_VALUE));
+ EXPECT_FALSE(node_data_regular.HasStateFlag(ui::AX_STATE_PROTECTED));
textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
- ui::AXViewState state_protected;
- textfield_->GetAccessibleState(&state_protected);
- EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_protected.role);
- EXPECT_EQ(ASCIIToUTF16("********"), state_protected.value);
- EXPECT_TRUE(state_protected.HasStateFlag(ui::AX_STATE_PROTECTED));
+ ui::AXNodeData node_data_protected;
+ node_data_protected.state = 0;
+ textfield_->GetAccessibleNodeData(&node_data_protected);
+ EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, node_data_protected.role);
+ EXPECT_EQ(ASCIIToUTF16("********"),
+ node_data_protected.GetString16Attribute(ui::AX_ATTR_VALUE));
+ EXPECT_TRUE(node_data_protected.HasStateFlag(ui::AX_STATE_PROTECTED));
}
} // namespace views
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/controls/tree/tree_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698