Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/signin/oauth2_token_service_test_util.h" | |
| 6 | |
| 7 std::string GetValidTokenResponse(std::string token, int expiration) { | |
| 8 return base::StringPrintf(kValidTokenResponse, token.c_str(), expiration); | |
| 9 } | |
| 10 | |
| 11 TestingOAuth2TokenServiceConsumer::TestingOAuth2TokenServiceConsumer() | |
| 12 : number_of_correct_tokens_(0), | |
| 13 last_error_(GoogleServiceAuthError::AuthErrorNone()), | |
| 14 number_of_errors_(0) { | |
| 15 } | |
| 16 | |
| 17 TestingOAuth2TokenServiceConsumer::~TestingOAuth2TokenServiceConsumer() { | |
| 18 } | |
| 19 | |
| 20 void TestingOAuth2TokenServiceConsumer::OnGetTokenSuccess( | |
| 21 const OAuth2TokenService::Request* request, | |
| 22 const std::string& token, | |
| 23 const base::Time& expiration_date) { | |
| 24 last_token_ = token; | |
|
Andrew T Wilson (Slow)
2013/03/19 19:58:44
consider just tracking tokens in a vector, that wa
| |
| 25 ++number_of_correct_tokens_; | |
| 26 } | |
| 27 | |
| 28 void TestingOAuth2TokenServiceConsumer::OnGetTokenFailure( | |
| 29 const OAuth2TokenService::Request* request, | |
| 30 const GoogleServiceAuthError& error) { | |
| 31 last_error_ = error; | |
|
Andrew T Wilson (Slow)
2013/03/19 19:58:44
consider tracking errors in a vector rather than c
| |
| 32 ++number_of_errors_; | |
| 33 } | |
| OLD | NEW |