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

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

Issue 10381121: Add SearchProvider's most relevant NavigationResult to |matches_|. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use max_element instead of sorting results. Created 8 years, 7 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 | « chrome/browser/autocomplete/search_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/search_provider_unittest.cc
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index f69854ae5d87c1b4034fe485eff0b21bbd07f3fa..14fbe3b61319d38bab2cfa9f03dbe752c0041d89 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -641,9 +641,9 @@ TEST_F(SearchProviderTest, UpdateKeywordDescriptions) {
EXPECT_NE(result.match_at(0).description, result.match_at(1).description);
}
-// Verifies Navsuggest results don't set a TemplateURL (which instant relies
-// on).
-TEST_F(SearchProviderTest, NoTemplateURLForNavsuggest) {
+// Verifies Navsuggest results don't set a TemplateURL, which instant relies on.
+// Also verifies that just the *first* navigational result is listed as a match.
+TEST_F(SearchProviderTest, Navsuggest) {
QueryForInput(ASCIIToUTF16("a.c"), false);
// Make sure the default providers suggest service was queried.
@@ -654,16 +654,17 @@ TEST_F(SearchProviderTest, NoTemplateURLForNavsuggest) {
// Tell the SearchProvider the suggest query is done.
fetcher->set_response_code(200);
fetcher->SetResponseString(
- "[\"a.c\",[\"a.com\"],[\"\"],[],"
- "{\"google:suggesttype\":[\"NAVIGATION\"]}]");
+ "[\"a.c\",[\"a.com\", \"a.com/b\"],[\"\"],[],"
+ "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"]}]");
fetcher->delegate()->OnURLFetchComplete(fetcher);
fetcher = NULL;
// Run till the history results complete.
RunTillProviderDone();
- // Make sure there is a match for 'a.com' and it doesn't have a template_url.
+ // Make sure the only match is 'a.com' and it doesn't have a template_url.
AutocompleteMatch nav_match;
EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match));
+ EXPECT_FALSE(FindMatchWithDestination(GURL("http://a.com/b"), &nav_match));
EXPECT_TRUE(nav_match.keyword.empty());
}
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698