| 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 45abeecdbe3bf527902236758f8841cefb57b56f..29f81c1713c5883369ef193a75f2d1c2a9e27871 100644
|
| --- a/ui/views/controls/textfield/textfield_unittest.cc
|
| +++ b/ui/views/controls/textfield/textfield_unittest.cc
|
| @@ -396,6 +396,7 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController {
|
| }
|
|
|
| void OnAfterUserAction(Textfield* sender) override {
|
| + textfield_->SetCursorEnabled(true);
|
| ++on_after_user_action_;
|
| }
|
|
|
| @@ -3112,7 +3113,7 @@ 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
|
| +// Verifies if the cursor visibility is controlled by |cursor_enabled_| in
|
| // RenderText.
|
| TEST_F(TextfieldTest, CursorVisibility) {
|
| InitTextfield();
|
| @@ -3129,4 +3130,17 @@ TEST_F(TextfieldTest, CursorVisibility) {
|
| EXPECT_TRUE(test_api_->IsCursorVisible());
|
| }
|
|
|
| +// Verifies if the cursor visibility is changed to true from false after insert
|
| +// charactor in textfield.
|
| +TEST_F(TextfieldTest, CursorVisibilityChangeAfterInserting) {
|
| + InitTextfield();
|
| +
|
| + test_api_->GetRenderText()->SetCursorEnabled(false);
|
| + textfield_->OnBlur();
|
| + textfield_->OnFocus();
|
| + EXPECT_FALSE(test_api_->IsCursorVisible());
|
| + SendKeyEvent('a');
|
| + EXPECT_TRUE(test_api_->IsCursorVisible());
|
| +}
|
| +
|
| } // namespace views
|
|
|