| Index: chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
|
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
|
| index f6718c78ed2d131abe6579a95317629920ecd5dc..b7c9341ad05432da3fdd558f48cf4f3b7b25ee92 100644
|
| --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
|
| +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
|
| @@ -149,6 +149,10 @@ class OmniboxViewViewsTest : public testing::Test {
|
| omnibox_view()->EmphasizeURLComponents();
|
| }
|
|
|
| + bool IsCursorEnabled() const {
|
| + return test_api_->GetRenderText()->cursor_enabled();
|
| + }
|
| +
|
| private:
|
| // testing::Test:
|
| void SetUp() override {
|
| @@ -202,6 +206,17 @@ TEST_F(OmniboxViewViewsTest, UpdatePopupCall) {
|
| 3, base::ASCIIToUTF16("a"), gfx::Range(1));
|
| }
|
|
|
| +// Test that text cursor is shown in the omnibox after entering any single
|
| +// character in NTP 'Search box'. Test for crbug.com/698172.
|
| +TEST_F(OmniboxViewViewsTest, EditTextfield) {
|
| + omnibox_textfield()->SetCursorEnabled(false);
|
| + ui::KeyEvent char_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::DomCode::US_A, 0,
|
| + ui::DomKey::FromCharacter('a'),
|
| + ui::EventTimeForNow());
|
| + omnibox_textfield()->InsertChar(char_event);
|
| + EXPECT_TRUE(IsCursorEnabled());
|
| +}
|
| +
|
| // Test that the scheduled text edit command is cleared when Textfield receives
|
| // a key press event. This ensures that the scheduled text edit command property
|
| // is always in the correct state. Test for http://crbug.com/613948.
|
|
|