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

Unified Diff: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc

Issue 2425703003: Fix failing DCHECK in AutoCompleteInput() (Closed)
Patch Set: use pkasting's suggested code 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/ui/omnibox/omnibox_view_browsertest.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
index 2320a3faba89b59ab96f438bdc54ed6aa7c8ee14..23e28df07691b091d7845d493d205a8e7d2d49c5 100644
--- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
@@ -869,6 +869,21 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, BasicTextOperations) {
EXPECT_EQ(old_text.size(), end);
}
+// Make sure the cursor position doesn't get set past the last character of
+// user input text when the URL is longer than the keyword.
+// (http://crbug.com/656209)
+IN_PROC_BROWSER_TEST_F(OmniboxViewTest, FocusSearchLongUrl) {
+ OmniboxView* omnibox_view = NULL;
+ ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
+
+ ASSERT_GT(strlen(url::kAboutBlankURL), strlen(kSearchKeyword));
+ ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL));
+
+ // Make sure nothing DCHECKs.
+ chrome::FocusSearch(browser());
+ ASSERT_NO_FATAL_FAILURE(WaitForAutocompleteControllerDone());
+}
+
IN_PROC_BROWSER_TEST_F(OmniboxViewTest, AcceptKeywordByTypingQuestionMark) {
OmniboxView* omnibox_view = NULL;
ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view));
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698