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

Unified Diff: chrome/browser/search_engines/template_url_unittest.cc

Issue 269293002: [AiS] Added version parameter to search query. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix revision number Created 6 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/search_engines/template_url.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_unittest.cc
diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc
index 89c033484eef018d486176f759cf1d8b63035b91..d6bf5057a863b0c9947935ca44fab5b8b3759ba1 100644
--- a/chrome/browser/search_engines/template_url_unittest.cc
+++ b/chrome/browser/search_engines/template_url_unittest.cc
@@ -1324,3 +1324,22 @@ TEST_F(TemplateURLTest, ReflectsBookmarkBarPinned) {
result = url.url_ref().ReplaceSearchTerms(search_terms_args);
EXPECT_EQ("http://www.google.com/?bmbp=1&q=foo", result);
}
+
+#if defined(OS_ANDROID)
+TEST_F(TemplateURLTest, AnswersHasVersion) {
+ TemplateURLData data;
+ UIThreadSearchTermsData::SetGoogleBaseURL("http://bar/");
+ data.SetURL("http://bar/search?q={searchTerms}&{google:searchVersion}xssi=t");
+
+ TemplateURL url(NULL, data);
+ TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foo"));
+ std::string result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://bar/search?q=foo&xssi=t", result);
+
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableAnswersInSuggest);
+ TemplateURL url2(NULL, data);
+ result = url2.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://bar/search?q=foo&gs_rn=42&xssi=t", result);
+}
+#endif
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698