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

Side by Side Diff: chrome/browser/signin/oauth2_token_service_test_util.h

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase again Created 7 years, 8 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
(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
25 // OAuth2TokenService::Consumer overrides.
26 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
27 const std::string& token,
28 const base::Time& expiration_date) OVERRIDE;
29 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
30 const GoogleServiceAuthError& error) OVERRIDE;
31
32 std::string last_token_;
33 int number_of_successful_tokens_;
34 GoogleServiceAuthError last_error_;
35 int number_of_errors_;
36 };
37
38 #endif // CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698