Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: chrome/browser/sync/test/engine/mock_gaia_authenticator.h

Issue 7828055: Move sync test code out of chrome/test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 for multiple users, and then can be used in exactly the same way 7 // return for multiple users, and then can be used in exactly the same way
8 // as the real GaiaAuthenticator. 8 // as the real GaiaAuthenticator.
9 // 9 //
10 // Sample usage: 10 // Sample usage:
11 // MockGaiaAuthenticator mock_gaia_auth("User-Agent", SYNC_SERVICE_NAME, 11 // MockGaiaAuthenticator mock_gaia_auth("User-Agent", SYNC_SERVICE_NAME,
12 // "any random string"); 12 // "any random string");
13 // mock_gaia_auth.AddMockUser("email", "password", "authtoken", "lsid", "sid", 13 // mock_gaia_auth.AddMockUser("email", "password", "authtoken", "lsid", "sid",
14 // AuthenticationError); 14 // AuthenticationError);
15 // mock_gaia_auth.AddMockUser("email2", "password2", "authtoken2", "lsid2", 15 // mock_gaia_auth.AddMockUser("email2", "password2", "authtoken2", "lsid2",
16 // "sid2", AuthenticationError, error_url, 16 // "sid2", AuthenticationError, error_url,
17 // "captcha_token", "captcha_url"); 17 // "captcha_token", "captcha_url");
18 // if (gaia_auth.Authenticate("email", "passwd")) { 18 // if (gaia_auth.Authenticate("email", "passwd")) {
19 // // Do something with: gaia_auth.auth_token(), or gaia_auth.sid(), 19 // // Do something with: gaia_auth.auth_token(), or gaia_auth.sid(),
20 // // or gaia_auth.lsid() 20 // // or gaia_auth.lsid()
21 // } 21 // }
22 22
23 #ifndef CHROME_TEST_SYNC_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_ 23 #ifndef CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_
24 #define CHROME_TEST_SYNC_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_ 24 #define CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_
25 #pragma once 25 #pragma once
26 26
27 #include <map> 27 #include <map>
28 #include <string> 28 #include <string>
29 29
30 #include "base/port.h" 30 #include "base/port.h"
31 31
32 #include "base/basictypes.h" 32 #include "base/basictypes.h"
33 #include "chrome/common/net/gaia/gaia_authenticator.h" 33 #include "chrome/common/net/gaia/gaia_authenticator.h"
34 34
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 std::string captcha_url(); 107 std::string captcha_url();
108 108
109 private: 109 private:
110 bool should_save_credentials_; 110 bool should_save_credentials_;
111 std::map<std::string, MockUser> mock_credentials_; 111 std::map<std::string, MockUser> mock_credentials_;
112 std::string current_user_; 112 std::string current_user_;
113 }; 113 };
114 114
115 } // namespace browser_sync 115 } // namespace browser_sync
116 116
117 #endif // CHROME_TEST_SYNC_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_ 117 #endif // CHROME_BROWSER_SYNC_TEST_ENGINE_MOCK_GAIA_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/engine/mock_connection_manager.cc ('k') | chrome/browser/sync/test/engine/mock_gaia_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698