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

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

Issue 836213002: Assume all providers may give zero suggest responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation issue in athena Created 5 years, 11 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
« no previous file with comments | « components/omnibox/autocomplete_provider.cc ('k') | components/omnibox/keyword_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 scoped_ptr<AutocompleteProviderClient>(client), 62 scoped_ptr<AutocompleteProviderClient>(client),
63 type) {} 63 type) {}
64 MOCK_METHOD1(DeleteMatch, void(const AutocompleteMatch& match)); 64 MOCK_METHOD1(DeleteMatch, void(const AutocompleteMatch& match));
65 MOCK_CONST_METHOD1(AddProviderInfo, void(ProvidersInfo* provider_info)); 65 MOCK_CONST_METHOD1(AddProviderInfo, void(ProvidersInfo* provider_info));
66 MOCK_CONST_METHOD1(GetTemplateURL, const TemplateURL*(bool is_keyword)); 66 MOCK_CONST_METHOD1(GetTemplateURL, const TemplateURL*(bool is_keyword));
67 MOCK_CONST_METHOD1(GetInput, const AutocompleteInput(bool is_keyword)); 67 MOCK_CONST_METHOD1(GetInput, const AutocompleteInput(bool is_keyword));
68 MOCK_CONST_METHOD1(ShouldAppendExtraParams, 68 MOCK_CONST_METHOD1(ShouldAppendExtraParams,
69 bool(const SearchSuggestionParser::SuggestResult& result)); 69 bool(const SearchSuggestionParser::SuggestResult& result));
70 MOCK_METHOD1(RecordDeletionResult, void(bool success)); 70 MOCK_METHOD1(RecordDeletionResult, void(bool success));
71 71
72 MOCK_METHOD2(Start, 72 MOCK_METHOD3(Start,
73 void(const AutocompleteInput& input, bool minimal_changes)); 73 void(const AutocompleteInput& input, bool minimal_changes,
74 bool called_due_to_focus));
74 void AddMatchToMap(const SearchSuggestionParser::SuggestResult& result, 75 void AddMatchToMap(const SearchSuggestionParser::SuggestResult& result,
75 const std::string& metadata, 76 const std::string& metadata,
76 int accepted_suggestion, 77 int accepted_suggestion,
77 bool mark_as_deletable, 78 bool mark_as_deletable,
78 bool in_keyword_mode, 79 bool in_keyword_mode,
79 MatchMap* map) { 80 MatchMap* map) {
80 BaseSearchProvider::AddMatchToMap(result, 81 BaseSearchProvider::AddMatchToMap(result,
81 metadata, 82 metadata,
82 accepted_suggestion, 83 accepted_suggestion,
83 mark_as_deletable, 84 mark_as_deletable,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 EXPECT_TRUE(answer2->Equals(*match.answer)); 195 EXPECT_TRUE(answer2->Equals(*match.answer));
195 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type); 196 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type);
196 EXPECT_EQ(1300, match.relevance); 197 EXPECT_EQ(1300, match.relevance);
197 198
198 EXPECT_EQ(answer_contents, duplicate.answer_contents); 199 EXPECT_EQ(answer_contents, duplicate.answer_contents);
199 EXPECT_EQ(answer_type, duplicate.answer_type); 200 EXPECT_EQ(answer_type, duplicate.answer_type);
200 EXPECT_TRUE(answer->Equals(*duplicate.answer)); 201 EXPECT_TRUE(answer->Equals(*duplicate.answer));
201 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type); 202 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type);
202 EXPECT_EQ(850, duplicate.relevance); 203 EXPECT_EQ(850, duplicate.relevance);
203 } 204 }
OLDNEW
« no previous file with comments | « components/omnibox/autocomplete_provider.cc ('k') | components/omnibox/keyword_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698