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

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

Issue 2728433002: Unnecessarily cursor appears in omnibox after clicking inside the 'Search box' (Closed)
Patch Set: address comments 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
« no previous file with comments | « ui/views/controls/textfield/textfield_test_api.h ('k') | no next file » | 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 46b012831c7e9852716fcc26ff0ae2d64647834e..45abeecdbe3bf527902236758f8841cefb57b56f 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -3112,4 +3112,21 @@ TEST_F(TextfieldTest, AccessiblePasswordTest) {
EXPECT_TRUE(node_data_protected.HasStateFlag(ui::AX_STATE_PROTECTED));
}
+// Test if the cursor visibility is controlled by |cursor_enabled_| in
+// RenderText.
+TEST_F(TextfieldTest, CursorVisibility) {
+ InitTextfield();
+ gfx::RenderText* render_text = test_api_->GetRenderText();
+
+ render_text->SetCursorEnabled(false);
+ textfield_->OnBlur();
+ textfield_->OnFocus();
+ EXPECT_FALSE(test_api_->IsCursorVisible());
+
+ render_text->SetCursorEnabled(true);
+ textfield_->OnBlur();
+ textfield_->OnFocus();
+ EXPECT_TRUE(test_api_->IsCursorVisible());
+}
+
} // namespace views
« no previous file with comments | « ui/views/controls/textfield/textfield_test_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698