| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Use MockGaiaAuthenticator to test your application by faking a login session. | 5 // Use MockGaiaAuthenticator to test your application by faking a login session. |
| 6 // This mock object should be initialized with the response you expect it to | 6 // This mock object should be initialized with the response you expect it to |
| 7 // return, and then can be used in exactly the same way as the real | 7 // return, and then can be used in exactly the same way as the real |
| 8 // GaiaAuthenticator. | 8 // GaiaAuthenticator. |
| 9 | 9 |
| 10 #include "chrome/test/sync/engine/mock_gaia_authenticator.h" | 10 #include "chrome/browser/sync/test/engine/mock_gaia_authenticator.h" |
| 11 | 11 |
| 12 using std::string; | 12 using std::string; |
| 13 | 13 |
| 14 namespace browser_sync { | 14 namespace browser_sync { |
| 15 | 15 |
| 16 MockGaiaAuthenticator::MockGaiaAuthenticator(const char* user_agent, | 16 MockGaiaAuthenticator::MockGaiaAuthenticator(const char* user_agent, |
| 17 const char* service_id, | 17 const char* service_id, |
| 18 const char* gaia_url) : | 18 const char* gaia_url) : |
| 19 should_save_credentials_(false), current_user_("") { | 19 should_save_credentials_(false), current_user_("") { |
| 20 // This discards user_agent, service_id, gaia_url since the mock object | 20 // This discards user_agent, service_id, gaia_url since the mock object |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return (current_user_.empty()) ? "" : | 143 return (current_user_.empty()) ? "" : |
| 144 mock_credentials_[current_user_].captcha_token; | 144 mock_credentials_[current_user_].captcha_token; |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::string MockGaiaAuthenticator::captcha_url() { | 147 std::string MockGaiaAuthenticator::captcha_url() { |
| 148 return (current_user_.empty()) ? "" : | 148 return (current_user_.empty()) ? "" : |
| 149 mock_credentials_[current_user_].captcha_url; | 149 mock_credentials_[current_user_].captcha_url; |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace browser_sync | 152 } // namespace browser_sync |
| OLD | NEW |