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

Side by Side Diff: components/omnibox/browser/omnibox_edit_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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 SessionID session_id_; 210 SessionID session_id_;
211 TestingSchemeClassifier scheme_classifier_; 211 TestingSchemeClassifier scheme_classifier_;
212 AutocompleteClassifier autocomplete_classifier_; 212 AutocompleteClassifier autocomplete_classifier_;
213 AutocompleteMatch alternate_nav_match_; 213 AutocompleteMatch alternate_nav_match_;
214 214
215 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxClient); 215 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxClient);
216 }; 216 };
217 217
218 TestingOmniboxClient::TestingOmniboxClient() 218 TestingOmniboxClient::TestingOmniboxClient()
219 : autocomplete_classifier_( 219 : autocomplete_classifier_(
220 base::WrapUnique(new AutocompleteController( 220 base::MakeUnique<AutocompleteController>(
221 CreateAutocompleteProviderClient(), 221 CreateAutocompleteProviderClient(),
222 nullptr, 222 nullptr,
223 AutocompleteClassifier::kDefaultOmniboxProviders)), 223 AutocompleteClassifier::kDefaultOmniboxProviders),
224 base::WrapUnique(new TestingSchemeClassifier())) {} 224 base::MakeUnique<TestingSchemeClassifier>()) {}
225 225
226 TestingOmniboxClient::~TestingOmniboxClient() { 226 TestingOmniboxClient::~TestingOmniboxClient() {
227 autocomplete_classifier_.Shutdown(); 227 autocomplete_classifier_.Shutdown();
228 } 228 }
229 229
230 std::unique_ptr<AutocompleteProviderClient> 230 std::unique_ptr<AutocompleteProviderClient>
231 TestingOmniboxClient::CreateAutocompleteProviderClient() { 231 TestingOmniboxClient::CreateAutocompleteProviderClient() {
232 std::unique_ptr<MockAutocompleteProviderClient> provider_client( 232 std::unique_ptr<MockAutocompleteProviderClient> provider_client(
233 new MockAutocompleteProviderClient()); 233 new MockAutocompleteProviderClient());
234 EXPECT_CALL(*provider_client.get(), GetBuiltinURLs()) 234 EXPECT_CALL(*provider_client.get(), GetBuiltinURLs())
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 0); 399 0);
400 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 400 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
401 client->alternate_nav_match().fill_into_edit)); 401 client->alternate_nav_match().fill_into_edit));
402 402
403 model()->SetUserText(base::ASCIIToUTF16("ab cd")); 403 model()->SetUserText(base::ASCIIToUTF16("ab cd"));
404 model()->OpenMatch(match, CURRENT_TAB, alternate_nav_url, base::string16(), 404 model()->OpenMatch(match, CURRENT_TAB, alternate_nav_url, base::string16(),
405 0); 405 0);
406 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 406 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
407 client->alternate_nav_match().fill_into_edit)); 407 client->alternate_nav_match().fill_into_edit));
408 } 408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698