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 #ifndef CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_ | |
| 6 #define CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_ | |
| 7 | |
| 8 #include "chrome/browser/signin/oauth2_token_service.h" | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 #include "base/stringprintf.h" | |
| 13 #include "google_apis/gaia/google_service_auth_error.h" | |
| 14 | |
| 15 extern const char kValidTokenResponse[]; | |
| 16 | |
| 17 std::string GetValidTokenResponse(std::string token, int expiration); | |
| 18 | |
| 19 // A simple testing consumer. | |
| 20 class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer { | |
| 21 public: | |
| 22 TestingOAuth2TokenServiceConsumer(); | |
| 23 virtual ~TestingOAuth2TokenServiceConsumer(); | |
| 24 | |
|
Mattias Nissler (ping if slow)
2013/03/26 12:04:32
nit: It is comment convention to place a comment b
David Roche
2013/03/27 05:09:51
Done.
| |
| 25 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, | |
| 26 const std::string& token, | |
| 27 const base::Time& expiration_date) OVERRIDE; | |
| 28 | |
| 29 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, | |
| 30 const GoogleServiceAuthError& error) OVERRIDE; | |
| 31 | |
| 32 std::string last_token_; | |
| 33 int number_of_correct_tokens_; | |
|
Mattias Nissler (ping if slow)
2013/03/26 12:04:32
nit: maybe |number_of_successful_tokens_| would be
David Roche
2013/03/27 05:09:51
Done.
| |
| 34 GoogleServiceAuthError last_error_; | |
| 35 int number_of_errors_; | |
| 36 }; | |
| 37 | |
| 38 #endif // CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_ | |
| OLD | NEW |