| OLD | NEW |
| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual ~TestBaseSearchProvider() {} | 88 virtual ~TestBaseSearchProvider() {} |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 DISALLOW_COPY_AND_ASSIGN(TestBaseSearchProvider); | 91 DISALLOW_COPY_AND_ASSIGN(TestBaseSearchProvider); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class BaseSearchProviderTest : public testing::Test { | 94 class BaseSearchProviderTest : public testing::Test { |
| 95 public: | 95 public: |
| 96 virtual ~BaseSearchProviderTest() {} | 96 ~BaseSearchProviderTest() override {} |
| 97 | 97 |
| 98 protected: | 98 protected: |
| 99 virtual void SetUp() { | 99 void SetUp() override { |
| 100 service_.reset( | 100 service_.reset( |
| 101 new TemplateURLService(NULL, | 101 new TemplateURLService(NULL, |
| 102 scoped_ptr<SearchTermsData>(new SearchTermsData), | 102 scoped_ptr<SearchTermsData>(new SearchTermsData), |
| 103 NULL, | 103 NULL, |
| 104 scoped_ptr<TemplateURLServiceClient>(), | 104 scoped_ptr<TemplateURLServiceClient>(), |
| 105 NULL, | 105 NULL, |
| 106 NULL, | 106 NULL, |
| 107 base::Closure())); | 107 base::Closure())); |
| 108 provider_ = new NiceMock<TestBaseSearchProvider>( | 108 provider_ = new NiceMock<TestBaseSearchProvider>( |
| 109 service_.get(), | 109 service_.get(), |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 EXPECT_EQ(answer_type, match.answer_type); | 183 EXPECT_EQ(answer_type, match.answer_type); |
| 184 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type); | 184 EXPECT_EQ(AutocompleteMatchType::SEARCH_HISTORY, match.type); |
| 185 EXPECT_EQ(1300, match.relevance); | 185 EXPECT_EQ(1300, match.relevance); |
| 186 | 186 |
| 187 EXPECT_EQ(answer_contents, duplicate.answer_contents); | 187 EXPECT_EQ(answer_contents, duplicate.answer_contents); |
| 188 EXPECT_EQ(answer_type, duplicate.answer_type); | 188 EXPECT_EQ(answer_type, duplicate.answer_type); |
| 189 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type); | 189 EXPECT_EQ(AutocompleteMatchType::SEARCH_SUGGEST, duplicate.type); |
| 190 EXPECT_EQ(850, duplicate.relevance); | 190 EXPECT_EQ(850, duplicate.relevance); |
| 191 | 191 |
| 192 } | 192 } |
| OLD | NEW |