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

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

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move function to minimize diff Created 7 years, 9 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 #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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698