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

Side by Side Diff: components/omnibox/base_search_provider_unittest.cc

Issue 1185723002: Prepare HistoryProvider for componentization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/base_search_provider.h" 5 #include "components/omnibox/base_search_provider.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/omnibox/autocomplete_match.h" 9 #include "components/omnibox/autocomplete_match.h"
10 #include "components/omnibox/autocomplete_match_type.h" 10 #include "components/omnibox/autocomplete_match_type.h"
(...skipping 13 matching lines...) Expand all
24 24
25 class MockAutocompleteProviderClient : public AutocompleteProviderClient { 25 class MockAutocompleteProviderClient : public AutocompleteProviderClient {
26 public: 26 public:
27 MockAutocompleteProviderClient() {} 27 MockAutocompleteProviderClient() {}
28 MOCK_METHOD0(RequestContext, net::URLRequestContextGetter*()); 28 MOCK_METHOD0(RequestContext, net::URLRequestContextGetter*());
29 MOCK_METHOD0(IsOffTheRecord, bool()); 29 MOCK_METHOD0(IsOffTheRecord, bool());
30 MOCK_METHOD0(AcceptLanguages, std::string()); 30 MOCK_METHOD0(AcceptLanguages, std::string());
31 MOCK_METHOD0(SearchSuggestEnabled, bool()); 31 MOCK_METHOD0(SearchSuggestEnabled, bool());
32 MOCK_METHOD0(ShowBookmarkBar, bool()); 32 MOCK_METHOD0(ShowBookmarkBar, bool());
33 MOCK_METHOD0(SchemeClassifier, const AutocompleteSchemeClassifier&()); 33 MOCK_METHOD0(SchemeClassifier, const AutocompleteSchemeClassifier&());
34 MOCK_METHOD0(HistoryService, history::HistoryService*());
35 MOCK_METHOD0(BookmarkModel, bookmarks::BookmarkModel*());
34 MOCK_METHOD6( 36 MOCK_METHOD6(
35 Classify, 37 Classify,
36 void(const base::string16& text, 38 void(const base::string16& text,
37 bool prefer_keyword, 39 bool prefer_keyword,
38 bool allow_exact_keyword_match, 40 bool allow_exact_keyword_match,
39 metrics::OmniboxEventProto::PageClassification page_classification, 41 metrics::OmniboxEventProto::PageClassification page_classification,
40 AutocompleteMatch* match, 42 AutocompleteMatch* match,
41 GURL* alternate_nav_url)); 43 GURL* alternate_nav_url));
42 MOCK_METHOD0(InMemoryDatabase, history::URLDatabase*()); 44 MOCK_METHOD0(InMemoryDatabase, history::URLDatabase*());
43 MOCK_METHOD2(DeleteMatchingURLsForKeywordFromHistory, 45 MOCK_METHOD2(DeleteMatchingURLsForKeywordFromHistory,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 EXPECT_TRUE(answer2->Equals(*match.answer)); 197 EXPECT_TRUE(answer2->Equals(*match.answer));
196 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type); 198 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type);
197 EXPECT_EQ(1300, match.relevance); 199 EXPECT_EQ(1300, match.relevance);
198 200
199 EXPECT_EQ(answer_contents, duplicate.answer_contents); 201 EXPECT_EQ(answer_contents, duplicate.answer_contents);
200 EXPECT_EQ(answer_type, duplicate.answer_type); 202 EXPECT_EQ(answer_type, duplicate.answer_type);
201 EXPECT_TRUE(answer->Equals(*duplicate.answer)); 203 EXPECT_TRUE(answer->Equals(*duplicate.answer));
202 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type); 204 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type);
203 EXPECT_EQ(850, duplicate.relevance); 205 EXPECT_EQ(850, duplicate.relevance);
204 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698