diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 21:17:19 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 21:17:19 +0000 |
commit | 1adcff8ef879cb0c74de7937862ab6eb0077113f (patch) | |
tree | dfbf826f18aec559bd16bd59ea6b60f879cb076a /chrome/browser/autocomplete/search_provider_unittest.cc | |
parent | 52787305fc89e955af6f4fd19fce95d8990c745a (diff) | |
download | chromium_src-1adcff8ef879cb0c74de7937862ab6eb0077113f.zip chromium_src-1adcff8ef879cb0c74de7937862ab6eb0077113f.tar.gz chromium_src-1adcff8ef879cb0c74de7937862ab6eb0077113f.tar.bz2 |
Regression test for 90316. Verifies navsuggest results don't have a
template_url set.
BUG=90316
TEST=see bug
R=pkasting@chromium.org
Review URL: http://codereview.chromium.org/7480021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/search_provider_unittest.cc')
-rw-r--r-- | chrome/browser/autocomplete/search_provider_unittest.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 99b07e0..1de0d8f 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -643,3 +643,29 @@ 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) { + QueryForInput(ASCIIToUTF16("a.c"), false); + + // Make sure the default providers suggest service was queried. + TestURLFetcher* fetcher = test_factory_.GetFetcherByID( + SearchProvider::kDefaultProviderURLFetcherID); + ASSERT_TRUE(fetcher); + + // Tell the SearchProvider the suggest query is done. + fetcher->delegate()->OnURLFetchComplete( + fetcher, GURL(), net::URLRequestStatus(), 200, net::ResponseCookies(), + "[\"a.c\",[\"a.com\"],[\"\"],[]," + "{\"google:suggesttype\":[\"NAVIGATION\"]}]"); + 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. + AutocompleteMatch nav_match; + EXPECT_TRUE(FindMatchWithDestination(GURL("http://a.com"), &nav_match)); + EXPECT_FALSE(nav_match.template_url); +} |