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

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

Issue 276073002: [AiS] Provide Answers queries with a session token. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to HEAD, update kCurrentDataVersion 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 d6bf5057a863b0c9947935ca44fab5b8b3759ba1..54b809f673ca80fb179231da2565abdb02c636f3 100644
--- a/chrome/browser/search_engines/template_url_unittest.cc
+++ b/chrome/browser/search_engines/template_url_unittest.cc
@@ -1343,3 +1343,20 @@ TEST_F(TemplateURLTest, AnswersHasVersion) {
EXPECT_EQ("http://bar/search?q=foo&gs_rn=42&xssi=t", result);
}
#endif
+
+TEST_F(TemplateURLTest, SessionToken) {
+ TemplateURLData data;
+ UIThreadSearchTermsData::SetGoogleBaseURL("http://bar/");
+ data.SetURL("http://bar/search?q={searchTerms}&{google:sessionToken}xssi=t");
+
+ TemplateURL url(NULL, data);
+ TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foo"));
+ search_terms_args.session_token = "SESSIONTOKENGOESHERE";
+ std::string result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://bar/search?q=foo&psi=SESSIONTOKENGOESHERE&xssi=t", result);
+
+ TemplateURL url2(NULL, data);
+ search_terms_args.session_token = "";
+ result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://bar/search?q=foo&xssi=t", result);
+}
« 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