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

Unified Diff: chrome/browser/autocomplete/search_provider_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
Index: chrome/browser/autocomplete/search_provider_unittest.cc
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index 764f3c34329b783d9fe04e5ec18a82621bf2a71d..f1c6316bb1ad3f7dc143384813b6d1a48faa2c02 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -2622,3 +2622,23 @@ TEST_F(SearchProviderTest, PrefetchMetadataParsing) {
}
}
}
+
+TEST_F(SearchProviderTest, ReflectsBookmarkBarState) {
+ profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false);
+ string16 term = term1_.substr(0, term1_.length() - 1);
+ QueryForInput(term, true, false);
+ ASSERT_FALSE(provider_->matches().empty());
+ EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
+ provider_->matches()[0].type);
+ ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL);
+ EXPECT_FALSE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned);
+
+ profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true);
+ term = term1_.substr(0, term1_.length() - 1);
+ QueryForInput(term, true, false);
+ ASSERT_FALSE(provider_->matches().empty());
+ EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
+ provider_->matches()[0].type);
+ ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL);
+ EXPECT_TRUE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned);
+}
« no previous file with comments | « chrome/browser/autocomplete/search_provider.cc ('k') | chrome/browser/search_engines/prepopulated_engines.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698