OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 : expected_username_(expected_username), | 105 : expected_username_(expected_username), |
106 expected_password_(expected_password) { | 106 expected_password_(expected_password) { |
107 } | 107 } |
108 | 108 |
109 virtual bool ShouldWaitForWifi() { | 109 virtual bool ShouldWaitForWifi() { |
110 return false; | 110 return false; |
111 } | 111 } |
112 | 112 |
113 virtual void CompleteLogin(const std::string& username, | 113 virtual void CompleteLogin(const std::string& username, |
114 const std::string& password, | 114 const std::string& password, |
115 const GaiaAuthConsumer::ClientLoginResult& res) { | 115 const GaiaAuthConsumer::ClientLoginResult& res, |
| 116 bool pending_requests) { |
116 EXPECT_EQ(expected_username_, username); | 117 EXPECT_EQ(expected_username_, username); |
117 EXPECT_EQ(expected_password_, password); | 118 EXPECT_EQ(expected_password_, password); |
118 } | 119 } |
119 | 120 |
120 virtual void CompleteOffTheRecordLogin(const GURL& start_url) { | 121 virtual void CompleteOffTheRecordLogin(const GURL& start_url) { |
121 } | 122 } |
122 | 123 |
123 virtual void SetFirstLoginPrefs(PrefService* prefs) { | 124 virtual void SetFirstLoginPrefs(PrefService* prefs) { |
124 } | 125 } |
125 | 126 |
126 virtual Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer) { | 127 virtual Authenticator* CreateAuthenticator(LoginStatusConsumer* consumer) { |
127 return new MockAuthenticator( | 128 return new MockAuthenticator( |
128 consumer, expected_username_, expected_password_); | 129 consumer, expected_username_, expected_password_); |
129 } | 130 } |
130 | 131 |
131 virtual void EnableBrowserLaunch(bool enable) { | 132 virtual void EnableBrowserLaunch(bool enable) { |
132 } | 133 } |
133 | 134 |
134 virtual bool IsBrowserLaunchEnabled() const { | 135 virtual bool IsBrowserLaunchEnabled() const { |
135 return true; | 136 return true; |
136 } | 137 } |
137 | 138 |
138 virtual const std::string& GetAuthToken() const { | |
139 return auth_token_; | |
140 } | |
141 | |
142 virtual void PrewarmAuthentication() { | 139 virtual void PrewarmAuthentication() { |
143 } | 140 } |
144 | 141 |
| 142 virtual void FetchCookies( |
| 143 Profile* profile, |
| 144 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
| 145 } |
| 146 |
| 147 virtual void FetchTokens( |
| 148 Profile* profile, |
| 149 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
| 150 } |
| 151 |
145 private: | 152 private: |
146 std::string expected_username_; | 153 std::string expected_username_; |
147 std::string expected_password_; | 154 std::string expected_password_; |
148 std::string auth_token_; | 155 std::string auth_token_; |
149 | 156 |
150 DISALLOW_COPY_AND_ASSIGN(MockLoginUtils); | 157 DISALLOW_COPY_AND_ASSIGN(MockLoginUtils); |
151 }; | 158 }; |
152 | 159 |
153 } // namespace chromeos | 160 } // namespace chromeos |
154 | 161 |
155 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ | 162 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_AUTHENTICATOR_H_ |
OLD | NEW |