| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "google_apis/gaia/oauth2_token_service_request.h" | 5 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const std::string& account_id, | 140 const std::string& account_id, |
| 141 const std::string& client_id, | 141 const std::string& client_id, |
| 142 const ScopeSet& scopes, | 142 const ScopeSet& scopes, |
| 143 const std::string& access_token) { | 143 const std::string& access_token) { |
| 144 ++num_invalidate_token_; | 144 ++num_invalidate_token_; |
| 145 last_token_invalidated_ = access_token; | 145 last_token_invalidated_ = access_token; |
| 146 } | 146 } |
| 147 | 147 |
| 148 class OAuth2TokenServiceRequestTest : public testing::Test { | 148 class OAuth2TokenServiceRequestTest : public testing::Test { |
| 149 public: | 149 public: |
| 150 virtual void SetUp() override; | 150 void SetUp() override; |
| 151 virtual void TearDown() override; | 151 void TearDown() override; |
| 152 | 152 |
| 153 protected: | 153 protected: |
| 154 class Provider : public OAuth2TokenServiceRequest::TokenServiceProvider { | 154 class Provider : public OAuth2TokenServiceRequest::TokenServiceProvider { |
| 155 public: | 155 public: |
| 156 Provider(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 156 Provider(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 157 OAuth2TokenService* token_service); | 157 OAuth2TokenService* token_service); |
| 158 | 158 |
| 159 scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner() | 159 scoped_refptr<base::SingleThreadTaskRunner> GetTokenServiceTaskRunner() |
| 160 override; | 160 override; |
| 161 OAuth2TokenService* GetTokenService() override; | 161 OAuth2TokenService* GetTokenService() override; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 OAuth2TokenServiceRequest::InvalidateToken( | 261 OAuth2TokenServiceRequest::InvalidateToken( |
| 262 provider_.get(), kAccountId, scopes_, kAccessToken); | 262 provider_.get(), kAccountId, scopes_, kAccessToken); |
| 263 ui_loop_.RunUntilIdle(); | 263 ui_loop_.RunUntilIdle(); |
| 264 EXPECT_EQ(0, consumer_.num_get_token_success_); | 264 EXPECT_EQ(0, consumer_.num_get_token_success_); |
| 265 EXPECT_EQ(0, consumer_.num_get_token_failure_); | 265 EXPECT_EQ(0, consumer_.num_get_token_failure_); |
| 266 EXPECT_EQ(kAccessToken, oauth2_service_->last_token_invalidated()); | 266 EXPECT_EQ(kAccessToken, oauth2_service_->last_token_invalidated()); |
| 267 EXPECT_EQ(1, oauth2_service_->num_invalidate_token()); | 267 EXPECT_EQ(1, oauth2_service_->num_invalidate_token()); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace | 270 } // namespace |
| OLD | NEW |