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

Unified Diff: chrome/browser/instant/instant_browsertest.cc

Issue 5787008: Makes instant not suggest string that look like urls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and convert active to displayable Created 10 years 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/instant/instant_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_browsertest.cc
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index 8fb61f8b0f4c6ae2c2e5490307032fb8af2fa3db..45867c42916d0342463559703aa37892692e0374 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -468,3 +468,31 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_OnCancelEvent) {
EXPECT_NO_FATAL_FAILURE(CheckIntValueFromJavascript(
1, "window.oncancelcalls", contents));
}
+
+// Verify that suggestion that looks like a url ('www.google.com' in this case)
+// is not shown.
+IN_PROC_BROWSER_TEST_F(InstantTest, DontShowURLSuggest) {
+ ASSERT_TRUE(test_server()->Start());
+ ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("suggest_google.html"));
+ ASSERT_NO_FATAL_FAILURE(FindLocationBar());
+ location_bar_->location_entry()->SetUserText(L"w");
+ InstantController* instant = browser()->instant();
+ ASSERT_TRUE(instant);
+ ASSERT_TRUE(instant->IsShowingInstant());
+ ASSERT_TRUE(instant->GetPreviewContents());
+ ui_test_utils::WaitForNavigation(
+ &(instant->GetPreviewContents()->controller()));
+ ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
+ instant->GetPreviewContents()));
+ // TODO: remove this second change when 66104 is fixed.
+ location_bar_->location_entry()->SetUserText(L"ww");
+ ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
+ instant->GetPreviewContents()));
+ ASSERT_TRUE(instant->is_displayable());
+
+ location_bar_->location_entry()->SetUserText(L"www");
+ ASSERT_NO_FATAL_FAILURE(WaitForMessageToBeProcessedByRenderer(
+ instant->GetPreviewContents()));
+ ASSERT_EQ(UTF16ToWide(string16()),
+ UTF16ToWide(instant->GetCompleteSuggestedText()));
+}
« no previous file with comments | « no previous file | chrome/browser/instant/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698