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

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

Issue 2399863002: views: call UpdateAfterChange() in Textfield::InsertOrReplaceText(). (Closed)
Patch Set: use TextfieldTestApi Created 4 years, 2 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 6838809353156ffd0990eb0825ff258265e9ebf0..4786bf1ed8b42e7287e028717f636d260e4b03eb 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -2840,6 +2840,16 @@ TEST_F(TextfieldTest, DestroyingTextfieldFromOnKeyEvent) {
EXPECT_FALSE(controller.target());
}
+TEST_F(TextfieldTest, CursorBlinkRestartsOnInsertOrReplace) {
+ InitTextfield();
+ textfield_->SetText(ASCIIToUTF16("abc"));
+ EXPECT_TRUE(test_api_->IsCursorBlinkTimerRunning());
+ textfield_->SelectRange(gfx::Range(1, 2));
+ EXPECT_FALSE(test_api_->IsCursorBlinkTimerRunning());
+ textfield_->InsertOrReplaceText(base::ASCIIToUTF16("foo"));
+ EXPECT_TRUE(test_api_->IsCursorBlinkTimerRunning());
+}
+
class TextfieldTouchSelectionTest : public TextfieldTest {
protected:
// Simulates a complete tap.
« 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