| 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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class TokenServiceTestHarness : public testing::Test { | 58 class TokenServiceTestHarness : public testing::Test { |
| 59 protected: | 59 protected: |
| 60 TokenServiceTestHarness(); | 60 TokenServiceTestHarness(); |
| 61 virtual ~TokenServiceTestHarness(); | 61 virtual ~TokenServiceTestHarness(); |
| 62 | 62 |
| 63 virtual void SetUp() OVERRIDE; | 63 virtual void SetUp() OVERRIDE; |
| 64 virtual void TearDown() OVERRIDE; | 64 virtual void TearDown() OVERRIDE; |
| 65 | 65 |
| 66 void UpdateCredentialsOnService(); | 66 void UpdateCredentialsOnService(); |
| 67 TestingProfile* profile() const { return profile_.get(); } | 67 TestingProfile* profile() const { return profile_.get(); } |
| 68 void set_profile(scoped_ptr<TestingProfile> profile) { |
| 69 profile_ = profile.Pass(); |
| 70 } |
| 68 TokenService* service() const { return service_; } | 71 TokenService* service() const { return service_; } |
| 69 const GaiaAuthConsumer::ClientLoginResult& credentials() const { | 72 const GaiaAuthConsumer::ClientLoginResult& credentials() const { |
| 70 return credentials_; | 73 return credentials_; |
| 71 } | 74 } |
| 72 TokenAvailableTracker* success_tracker() { return &success_tracker_; } | 75 TokenAvailableTracker* success_tracker() { return &success_tracker_; } |
| 73 TokenFailedTracker* failure_tracker() { return &failure_tracker_; } | 76 TokenFailedTracker* failure_tracker() { return &failure_tracker_; } |
| 74 | 77 |
| 75 private: | 78 private: |
| 76 content::TestBrowserThreadBundle thread_bundle_; | 79 content::TestBrowserThreadBundle thread_bundle_; |
| 77 | 80 |
| 78 TokenService* service_; | 81 TokenService* service_; |
| 79 TokenAvailableTracker success_tracker_; | 82 TokenAvailableTracker success_tracker_; |
| 80 TokenFailedTracker failure_tracker_; | 83 TokenFailedTracker failure_tracker_; |
| 81 GaiaAuthConsumer::ClientLoginResult credentials_; | 84 GaiaAuthConsumer::ClientLoginResult credentials_; |
| 82 std::string oauth_token_; | 85 std::string oauth_token_; |
| 83 std::string oauth_secret_; | 86 std::string oauth_secret_; |
| 84 scoped_ptr<TestingProfile> profile_; | 87 scoped_ptr<TestingProfile> profile_; |
| 85 }; | 88 }; |
| 86 | 89 |
| 87 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ | 90 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_ |
| OLD | NEW |