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

Unified Diff: google_apis/gaia/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: google_apis/gaia/oauth2_token_service_unittest.cc
diff --git a/google_apis/gaia/oauth2_token_service_unittest.cc b/google_apis/gaia/oauth2_token_service_unittest.cc
index 565b6f4f7062272624e3dd29928005cd2358ec24..bd770cf6b7e781eb134601e9cf7b65f5373b37d6 100644
--- a/google_apis/gaia/oauth2_token_service_unittest.cc
+++ b/google_apis/gaia/oauth2_token_service_unittest.cc
@@ -47,8 +47,9 @@ class RetryingTestingOAuth2TokenServiceConsumer
class TestOAuth2TokenService : public OAuth2TokenService {
public:
- explicit TestOAuth2TokenService(FakeOAuth2TokenServiceDelegate* delegate)
- : OAuth2TokenService(delegate) {}
+ explicit TestOAuth2TokenService(
+ std::unique_ptr<FakeOAuth2TokenServiceDelegate> delegate)
+ : OAuth2TokenService(std::move(delegate)) {}
void CancelAllRequestsForTest() { CancelAllRequests(); }
@@ -65,8 +66,9 @@ class OAuth2TokenServiceTest : public testing::Test {
public:
void SetUp() override {
oauth2_service_.reset(new TestOAuth2TokenService(
- new FakeOAuth2TokenServiceDelegate(new net::TestURLRequestContextGetter(
- message_loop_.task_runner()))));
+ base::MakeUnique<FakeOAuth2TokenServiceDelegate>(
+ new net::TestURLRequestContextGetter(
+ message_loop_.task_runner()))));
account_id_ = "test_user@gmail.com";
}

Powered by Google App Engine
This is Rietveld 408576698