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

Side by Side Diff: components/omnibox/browser/history_url_provider_unittest.cc

Issue 2252343002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/browser/history_url_provider.h" 5 #include "components/omnibox/browser/history_url_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 {"http://7.com/2b", "Two B", 4, 1, 8}, 152 {"http://7.com/2b", "Two B", 4, 1, 8},
153 {"http://7.com/3a", "Three", 2, 1, 16}, 153 {"http://7.com/3a", "Three", 2, 1, 16},
154 {"http://7.com/4a", "Four A", 1, 1, 32}, 154 {"http://7.com/4a", "Four A", 1, 1, 32},
155 {"http://7.com/4b", "Four B", 1, 1, 64}, 155 {"http://7.com/4b", "Four B", 1, 1, 64},
156 {"http://7.com/5a", "Five A", 8, 0, 64}, // never typed. 156 {"http://7.com/5a", "Five A", 8, 0, 64}, // never typed.
157 }; 157 };
158 158
159 class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient { 159 class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient {
160 public: 160 public:
161 FakeAutocompleteProviderClient(bool create_history_db) { 161 FakeAutocompleteProviderClient(bool create_history_db) {
162 set_template_url_service( 162 set_template_url_service(base::MakeUnique<TemplateURLService>(nullptr, 0));
163 base::WrapUnique(new TemplateURLService(nullptr, 0)));
164 if (history_dir_.CreateUniqueTempDir()) { 163 if (history_dir_.CreateUniqueTempDir()) {
165 history_service_ = history::CreateHistoryService( 164 history_service_ = history::CreateHistoryService(
166 history_dir_.path(), create_history_db); 165 history_dir_.path(), create_history_db);
167 } 166 }
168 } 167 }
169 168
170 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override { 169 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override {
171 return scheme_classifier_; 170 return scheme_classifier_;
172 } 171 }
173 172
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 // the default experimental scoring. 1118 // the default experimental scoring.
1120 autocomplete_->scoring_params_.experimental_scoring_enabled = true; 1119 autocomplete_->scoring_params_.experimental_scoring_enabled = true;
1121 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), 1120 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input),
1122 std::string(), false, output, max_matches)); 1121 std::string(), false, output, max_matches));
1123 for (int j = 0; j < max_matches; ++j) { 1122 for (int j = 0; j < max_matches; ++j) {
1124 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, 1123 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance,
1125 matches_[j].relevance); 1124 matches_[j].relevance);
1126 } 1125 }
1127 } 1126 }
1128 } 1127 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/base_search_provider.cc ('k') | components/omnibox/browser/omnibox_edit_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698