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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/search_engines/template_url.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 url.url_ref_.showing_search_terms_ = true; 1317 url.url_ref_.showing_search_terms_ = true;
1318 search_terms_args.bookmark_bar_pinned = false; 1318 search_terms_args.bookmark_bar_pinned = false;
1319 result = url.url_ref().ReplaceSearchTerms(search_terms_args); 1319 result = url.url_ref().ReplaceSearchTerms(search_terms_args);
1320 EXPECT_EQ("http://www.google.com/?bmbp=0&q=foo", result); 1320 EXPECT_EQ("http://www.google.com/?bmbp=0&q=foo", result);
1321 1321
1322 url.url_ref_.showing_search_terms_ = true; 1322 url.url_ref_.showing_search_terms_ = true;
1323 search_terms_args.bookmark_bar_pinned = true; 1323 search_terms_args.bookmark_bar_pinned = true;
1324 result = url.url_ref().ReplaceSearchTerms(search_terms_args); 1324 result = url.url_ref().ReplaceSearchTerms(search_terms_args);
1325 EXPECT_EQ("http://www.google.com/?bmbp=1&q=foo", result); 1325 EXPECT_EQ("http://www.google.com/?bmbp=1&q=foo", result);
1326 } 1326 }
1327
1328 #if defined(OS_ANDROID)
1329 TEST_F(TemplateURLTest, AnswersHasVersion) {
1330 TemplateURLData data;
1331 UIThreadSearchTermsData::SetGoogleBaseURL("http://bar/");
1332 data.SetURL("http://bar/search?q={searchTerms}&{google:searchVersion}xssi=t");
1333
1334 TemplateURL url(NULL, data);
1335 TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foo"));
1336 std::string result = url.url_ref().ReplaceSearchTerms(search_terms_args);
1337 EXPECT_EQ("http://bar/search?q=foo&xssi=t", result);
1338
1339 CommandLine::ForCurrentProcess()->AppendSwitch(
1340 switches::kEnableAnswersInSuggest);
1341 TemplateURL url2(NULL, data);
1342 result = url2.url_ref().ReplaceSearchTerms(search_terms_args);
1343 EXPECT_EQ("http://bar/search?q=foo&gs_rn=42&xssi=t", result);
1344 }
1345 #endif
OLDNEW
« 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