| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file defines a unit test harness for the profile's token service. | 5 // This file defines a unit test harness for the profile's token service. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ | 7 #ifndef CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ |
| 8 #define CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ | 8 #define CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "chrome/browser/signin/token_service.h" |
| 12 #include "chrome/browser/webdata/web_data_service.h" | 13 #include "chrome/browser/webdata/web_data_service.h" |
| 13 #include "chrome/browser/signin/token_service.h" | |
| 14 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | |
| 15 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 16 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/test/test_browser_thread.h" | 17 #include "content/public/test/test_browser_thread.h" |
| 19 #include "content/public/test/test_notification_tracker.h" | 18 #include "content/public/test/test_notification_tracker.h" |
| 19 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 // TestNotificationTracker doesn't do a deep copy on the notification details. | 22 // TestNotificationTracker doesn't do a deep copy on the notification details. |
| 23 // We have to in order to read it out, or we have a bad ptr, since the details | 23 // We have to in order to read it out, or we have a bad ptr, since the details |
| 24 // are a reference on the stack. | 24 // are a reference on the stack. |
| 25 class TokenAvailableTracker : public content::TestNotificationTracker { | 25 class TokenAvailableTracker : public content::TestNotificationTracker { |
| 26 public: | 26 public: |
| 27 TokenAvailableTracker(); | 27 TokenAvailableTracker(); |
| 28 virtual ~TokenAvailableTracker(); | 28 virtual ~TokenAvailableTracker(); |
| 29 | 29 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 TokenService* service_; | 74 TokenService* service_; |
| 75 TokenAvailableTracker success_tracker_; | 75 TokenAvailableTracker success_tracker_; |
| 76 TokenFailedTracker failure_tracker_; | 76 TokenFailedTracker failure_tracker_; |
| 77 GaiaAuthConsumer::ClientLoginResult credentials_; | 77 GaiaAuthConsumer::ClientLoginResult credentials_; |
| 78 std::string oauth_token_; | 78 std::string oauth_token_; |
| 79 std::string oauth_secret_; | 79 std::string oauth_secret_; |
| 80 scoped_ptr<TestingProfile> profile_; | 80 scoped_ptr<TestingProfile> profile_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ | 83 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ |
| OLD | NEW |