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..2d739885d8143645510d41c6e80665db803b456a 100644 |
--- a/chrome/browser/autocomplete/search_provider_unittest.cc |
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc |
@@ -2622,3 +2622,27 @@ TEST_F(SearchProviderTest, PrefetchMetadataParsing) { |
} |
} |
} |
+ |
+TEST_F(SearchProviderTest, SetsBookmarkBarNotPinned) { |
+ profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); |
+ string16 term = term1_.substr(0, term1_.length() - 1); |
+ QueryForInput(term, true, false); |
+ |
+ ASSERT_FALSE(provider_->matches().empty()); |
+ ASSERT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, |
Peter Kasting
2013/10/01 01:03:31
Nit: Can be EXPECT_EQ
Jered
2013/10/01 18:46:15
Done.
|
+ provider_->matches()[0].type); |
+ ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL); |
+ EXPECT_FALSE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned); |
+} |
+ |
+TEST_F(SearchProviderTest, SetsBookmarkBarPinned) { |
Peter Kasting
2013/10/01 01:03:31
Nit: I'd combine these two tests into one, Bookmar
Jered
2013/10/01 18:46:15
Done.
|
+ profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); |
+ string16 term = term1_.substr(0, term1_.length() - 1); |
+ QueryForInput(term, true, false); |
+ |
+ ASSERT_FALSE(provider_->matches().empty()); |
+ ASSERT_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); |
+} |