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

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc

Issue 2685123002: Make OAuth2TokenService and subclasses take delegate by unique_ptr (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
index 5b99cf62a0f7558a74dac600ae8ba80b39169e15..e2a6a7f2c76ac8eee7ff3a5e5bb37a3e65536d75 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc
@@ -131,11 +131,10 @@ class DeviceOAuth2TokenServiceTest : public testing::Test {
}
void CreateService() {
- DeviceOAuth2TokenServiceDelegate* delegate =
- new DeviceOAuth2TokenServiceDelegate(request_context_getter_.get(),
- scoped_testing_local_state_.Get());
+ auto delegate = base::MakeUnique<DeviceOAuth2TokenServiceDelegate>(
+ request_context_getter_.get(), scoped_testing_local_state_.Get());
delegate->max_refresh_token_validation_retries_ = 0;
- oauth2_service_.reset(new DeviceOAuth2TokenService(delegate));
+ oauth2_service_.reset(new DeviceOAuth2TokenService(std::move(delegate)));
msarda 2017/02/10 09:21:22 Optional: Consider using MakeUnique.
bsazonov 2017/02/10 10:41:50 The DeviceOAuth2TokenService ctor is private, so M
oauth2_service_->set_max_authorization_token_fetch_retries_for_testing(0);
}

Powered by Google App Engine
This is Rietveld 408576698