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

Unified 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: Moved DeviceOAuth2TokenService factory method to g_browser_process 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/oauth2_token_service_test_util.h
diff --git a/chrome/browser/signin/oauth2_token_service_test_util.h b/chrome/browser/signin/oauth2_token_service_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..968192949c69368724dded3ee7f6447b34ff63e9
--- /dev/null
+++ b/chrome/browser/signin/oauth2_token_service_test_util.h
@@ -0,0 +1,38 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_
+#define CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_
+
+#include "chrome/browser/signin/oauth2_token_service.h"
+
+#include <string>
+
+#include "base/stringprintf.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+
+extern const char kValidTokenResponse[];
+
+std::string GetValidTokenResponse(std::string token, int expiration);
+
+// A simple testing consumer.
+class TestingOAuth2TokenServiceConsumer : public OAuth2TokenService::Consumer {
+ public:
+ TestingOAuth2TokenServiceConsumer();
+ virtual ~TestingOAuth2TokenServiceConsumer();
+
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.
+ virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
+ const std::string& token,
+ const base::Time& expiration_date) OVERRIDE;
+
+ virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
+ const GoogleServiceAuthError& error) OVERRIDE;
+
+ std::string last_token_;
+ 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.
+ GoogleServiceAuthError last_error_;
+ int number_of_errors_;
+};
+
+#endif // CHROME_BROWSER_SIGNIN_OAUTH2_TOKEN_SERVICE_TEST_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698