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

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

Issue 2754633002: Fix: Cursor missing in omnibox after entering a alphabet in NTP 'Search box' (Closed)
Patch Set: 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
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('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 45abeecdbe3bf527902236758f8841cefb57b56f..71d3ad8ca556465e47b116b7506401dc885914d7 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -252,7 +252,7 @@ void MockInputMethod::ClearComposition() {
result_text_.clear();
}
-// A Textfield wrapper to intercept OnKey[Pressed|Released]() ressults.
+// A Textfield wrapper to intercept OnKey[Pressed|Released]() results.
class TestTextfield : public views::Textfield {
public:
TestTextfield()
@@ -3112,20 +3112,14 @@ 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.
+// Verify that cursor visibility is controlled by SetCursorEnabled.
TEST_F(TextfieldTest, CursorVisibility) {
InitTextfield();
- gfx::RenderText* render_text = test_api_->GetRenderText();
- render_text->SetCursorEnabled(false);
- textfield_->OnBlur();
- textfield_->OnFocus();
+ textfield_->SetCursorEnabled(false);
EXPECT_FALSE(test_api_->IsCursorVisible());
- render_text->SetCursorEnabled(true);
- textfield_->OnBlur();
- textfield_->OnFocus();
+ textfield_->SetCursorEnabled(true);
EXPECT_TRUE(test_api_->IsCursorVisible());
}
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698