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

Unified Diff: chrome/browser/ui/search/instant_extended_interactive_uitest.cc

Issue 481693004: Omnibox: Prevent Asynchronous Suggestions from Changing Default Match (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mike's extensive changes to tests Created 6 years, 4 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/search/instant_extended_interactive_uitest.cc
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index a3f8867c160b78d186a5eebca220ea2585f25a72..fb9bbc40a2175d22fda97112bcfe2dddc82cf32c 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -834,17 +834,19 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, SetPrefetchQuery) {
observer.Wait();
// Set the fake response for suggest request. Response has prefetch details.
- // Ensure that the page received the prefetch query.
+ // Ensure that the page received the suggest response, then add another
+ // keystroke to allow the asynchronously-received inline autocomplete
+ // suggestion to actually be inlined (which in turn triggers it to prefetch).
fake_factory()->SetFakeResponse(
- instant_url().Resolve("#q=pupp"),
- "[\"pupp\",[\"puppy\", \"puppies\"],[],[],"
+ instant_url().Resolve("#q=pup"),
+ "[\"pup\",[\"puppy\", \"puppies\"],[],[],"
"{\"google:clientdata\":{\"phi\": 0},"
"\"google:suggesttype\":[\"QUERY\", \"QUERY\"],"
"\"google:suggestrelevance\":[1400, 9]}]",
net::HTTP_OK,
net::URLRequestStatus::SUCCESS);
- SetOmniboxText("pupp");
+ SetOmniboxText("pup");
while (!omnibox()->model()->autocomplete_controller()->done()) {
content::WindowedNotificationObserver ready_observer(
chrome::NOTIFICATION_AUTOCOMPLETE_CONTROLLER_RESULT_READY,
@@ -852,6 +854,7 @@ IN_PROC_BROWSER_TEST_F(InstantExtendedPrefetchTest, SetPrefetchQuery) {
omnibox()->model()->autocomplete_controller()));
ready_observer.Wait();
}
+ SetOmniboxText("pupp");
ASSERT_EQ(3, CountSearchProviderSuggestions());
content::WebContents* active_tab =

Powered by Google App Engine
This is Rietveld 408576698