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

Unified Diff: chrome/browser/autocomplete/autocomplete_browsertest.cc

Issue 2435103002: Omnibox: Preserve display text and select all on a focus search (Closed)
Patch Set: Remove printfs 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
Index: chrome/browser/autocomplete/autocomplete_browsertest.cc
diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc
index 8cce36c1ba41532eb1da62e04c5b1f46a00c0e83..414247a23276a6bbc7a01ddbc468b2309c5bce3b 100644
--- a/chrome/browser/autocomplete/autocomplete_browsertest.cc
+++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc
@@ -329,4 +329,22 @@ IN_PROC_BROWSER_TEST_F(AutocompleteBrowserTest, FocusSearch) {
omnibox_view->RevertAll();
}
+
+ // Focus search when the permanent URL is showing should result in an empty
Peter Kasting 2016/10/25 02:46:33 Nit: Focus search -> Calling FocusSearch()
Tom (Use chromium acct) 2016/10/25 18:50:31 Done.
+ // query string.
+ {
+ FocusSearchCheckPreconditions();
+
+ omnibox_model->UpdatePermanentText();
+ EXPECT_EQ(base::ASCIIToUTF16(url::kAboutBlankURL), omnibox_view->GetText());
+
+ location_bar->FocusSearch();
+ EXPECT_FALSE(location_bar->GetDestinationURL().is_valid());
+ EXPECT_EQ(base::string16(), omnibox_view->GetText());
+ EXPECT_EQ(default_search_keyword, omnibox_model->keyword());
+ EXPECT_FALSE(omnibox_model->is_keyword_hint());
+ EXPECT_TRUE(omnibox_model->is_keyword_selected());
+
+ omnibox_view->RevertAll();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698