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

Side by Side Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 490123003: Move bookmark_pref_names.* into bookmarks namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/omnibox/search_provider.h" 5 #include "components/omnibox/search_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
2910 const Match& match = cases[i].matches[j]; 2910 const Match& match = cases[i].matches[j];
2911 SCOPED_TRACE(" and match index: " + base::IntToString(j)); 2911 SCOPED_TRACE(" and match index: " + base::IntToString(j));
2912 EXPECT_EQ(match.contents, base::UTF16ToUTF8(matches[j].contents)); 2912 EXPECT_EQ(match.contents, base::UTF16ToUTF8(matches[j].contents));
2913 EXPECT_EQ(match.deletion_url, matches[j].GetAdditionalInfo( 2913 EXPECT_EQ(match.deletion_url, matches[j].GetAdditionalInfo(
2914 "deletion_url")); 2914 "deletion_url"));
2915 } 2915 }
2916 } 2916 }
2917 } 2917 }
2918 2918
2919 TEST_F(SearchProviderTest, ReflectsBookmarkBarState) { 2919 TEST_F(SearchProviderTest, ReflectsBookmarkBarState) {
2920 profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); 2920 profile_.GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false);
2921 base::string16 term = term1_.substr(0, term1_.length() - 1); 2921 base::string16 term = term1_.substr(0, term1_.length() - 1);
2922 QueryForInput(term, true, false); 2922 QueryForInput(term, true, false);
2923 ASSERT_FALSE(provider_->matches().empty()); 2923 ASSERT_FALSE(provider_->matches().empty());
2924 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, 2924 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
2925 provider_->matches()[0].type); 2925 provider_->matches()[0].type);
2926 ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL); 2926 ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL);
2927 EXPECT_FALSE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned); 2927 EXPECT_FALSE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned);
2928 2928
2929 profile_.GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); 2929 profile_.GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, true);
2930 term = term1_.substr(0, term1_.length() - 1); 2930 term = term1_.substr(0, term1_.length() - 1);
2931 QueryForInput(term, true, false); 2931 QueryForInput(term, true, false);
2932 ASSERT_FALSE(provider_->matches().empty()); 2932 ASSERT_FALSE(provider_->matches().empty());
2933 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, 2933 EXPECT_EQ(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
2934 provider_->matches()[0].type); 2934 provider_->matches()[0].type);
2935 ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL); 2935 ASSERT_TRUE(provider_->matches()[0].search_terms_args != NULL);
2936 EXPECT_TRUE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned); 2936 EXPECT_TRUE(provider_->matches()[0].search_terms_args->bookmark_bar_pinned);
2937 } 2937 }
2938 2938
2939 TEST_F(SearchProviderTest, CanSendURL) { 2939 TEST_F(SearchProviderTest, CanSendURL) {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
3260 AutocompleteInput input(base::ASCIIToUTF16("weather l"), 3260 AutocompleteInput input(base::ASCIIToUTF16("weather l"),
3261 base::string16::npos, base::string16(), GURL(), 3261 base::string16::npos, base::string16(), GURL(),
3262 metrics::OmniboxEventProto::INVALID_SPEC, false, 3262 metrics::OmniboxEventProto::INVALID_SPEC, false,
3263 false, true, true, 3263 false, true, true,
3264 ChromeAutocompleteSchemeClassifier(&profile_)); 3264 ChromeAutocompleteSchemeClassifier(&profile_));
3265 provider_->DoAnswersQuery(input); 3265 provider_->DoAnswersQuery(input);
3266 EXPECT_EQ(base::ASCIIToUTF16("weather los angeles"), 3266 EXPECT_EQ(base::ASCIIToUTF16("weather los angeles"),
3267 provider_->prefetch_data_.full_query_text); 3267 provider_->prefetch_data_.full_query_text);
3268 EXPECT_EQ(base::ASCIIToUTF16("2334"), provider_->prefetch_data_.query_type); 3268 EXPECT_EQ(base::ASCIIToUTF16("2334"), provider_->prefetch_data_.query_type);
3269 } 3269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698