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

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

Issue 25324003: search: Log when bookmark bar is pinned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 7 years, 3 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 5882e5dc0212425cca145b54d301530a14a84381..99f5b906391ea6287223cd328b185f66798223ce 100644
--- a/chrome/browser/search_engines/template_url_unittest.cc
+++ b/chrome/browser/search_engines/template_url_unittest.cc
@@ -1233,3 +1233,29 @@ TEST_F(TemplateURLTest, IsSearchResults) {
search_provider.IsSearchURL(GURL(url_data[i].url)));
}
}
+
+TEST_F(TemplateURLTest, ReflectsBookmarkBarPinned) {
+ TemplateURLData data;
+ data.input_encodings.push_back("UTF-8");
+ data.SetURL("{google:baseURL}?{google:bookmarkBarPinned}q={searchTerms}");
+ TemplateURL url(NULL, data);
+ EXPECT_TRUE(url.url_ref().IsValid());
+ ASSERT_TRUE(url.url_ref().SupportsReplacement());
+ TemplateURLRef::SearchTermsArgs search_terms_args(ASCIIToUTF16("foo"));
+
+ // Do not add the param when InstantExtended is suppressed on SRPs.
+ url.url_ref_.showing_search_terms_ = false;
+ std::string result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://www.google.com/?q=foo", result);
+
+ // Add the param when InstantExtended is not suppressed on SRPs.
+ url.url_ref_.showing_search_terms_ = true;
+ search_terms_args.bookmark_bar_pinned = false;
+ result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://www.google.com/?bmbp=0&q=foo", result);
+
+ url.url_ref_.showing_search_terms_ = true;
+ search_terms_args.bookmark_bar_pinned = true;
+ result = url.url_ref().ReplaceSearchTerms(search_terms_args);
+ EXPECT_EQ("http://www.google.com/?bmbp=1&q=foo", 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