| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h" | 5 #include "chrome/browser/extensions/api/identity/gaia_web_auth_flow.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class TestGaiaWebAuthFlow : public GaiaWebAuthFlow { | 28 class TestGaiaWebAuthFlow : public GaiaWebAuthFlow { |
| 29 public: | 29 public: |
| 30 TestGaiaWebAuthFlow(GaiaWebAuthFlow::Delegate* delegate, | 30 TestGaiaWebAuthFlow(GaiaWebAuthFlow::Delegate* delegate, |
| 31 const std::string& extension_id, | 31 const std::string& extension_id, |
| 32 const OAuth2Info& oauth2_info, | 32 const OAuth2Info& oauth2_info, |
| 33 GoogleServiceAuthError::State ubertoken_error_state) | 33 GoogleServiceAuthError::State ubertoken_error_state) |
| 34 : GaiaWebAuthFlow(delegate, | 34 : GaiaWebAuthFlow(delegate, |
| 35 NULL, | 35 NULL, |
| 36 "account_id", |
| 36 "extension_id", | 37 "extension_id", |
| 37 oauth2_info, | 38 oauth2_info, |
| 38 "en-us"), | 39 "en-us"), |
| 39 ubertoken_error_(ubertoken_error_state) {} | 40 ubertoken_error_(ubertoken_error_state) {} |
| 40 | 41 |
| 41 virtual void Start() OVERRIDE { | 42 virtual void Start() OVERRIDE { |
| 42 if (ubertoken_error_.state() == GoogleServiceAuthError::NONE) | 43 if (ubertoken_error_.state() == GoogleServiceAuthError::NONE) |
| 43 OnUbertokenSuccess("fake_ubertoken"); | 44 OnUbertokenSuccess("fake_ubertoken"); |
| 44 else | 45 else |
| 45 OnUbertokenFailure(ubertoken_error_); | 46 OnUbertokenFailure(ubertoken_error_); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 EXPECT_CALL( | 236 EXPECT_CALL( |
| 236 delegate_, | 237 delegate_, |
| 237 OnGaiaFlowFailure( | 238 OnGaiaFlowFailure( |
| 238 GaiaWebAuthFlow::WINDOW_CLOSED, | 239 GaiaWebAuthFlow::WINDOW_CLOSED, |
| 239 GoogleServiceAuthError(GoogleServiceAuthError::NONE), | 240 GoogleServiceAuthError(GoogleServiceAuthError::NONE), |
| 240 "")); | 241 "")); |
| 241 flow->OnAuthFlowFailure(WebAuthFlow::WINDOW_CLOSED); | 242 flow->OnAuthFlowFailure(WebAuthFlow::WINDOW_CLOSED); |
| 242 } | 243 } |
| 243 | 244 |
| 244 } // namespace extensions | 245 } // namespace extensions |
| OLD | NEW |