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

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

Issue 2435103002: Omnibox: Preserve display text and select all on a focus search (Closed)
Patch Set: Use display_text.length() as caret pos for KEYBOARD_SHORTCUT 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 | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a4422bf8e44fdfb7701588b18464c12112a374f1 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();
}
+
+ // Calling FocusSearch() when the permanent URL is showing should result in an
+ // empty 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();
+ }
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698