OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 public: | 51 public: |
52 TestOnlineAttempt(AuthAttemptState* state, | 52 TestOnlineAttempt(AuthAttemptState* state, |
53 AuthAttemptStateResolver* resolver) | 53 AuthAttemptStateResolver* resolver) |
54 : OnlineAttempt(state, resolver) { | 54 : OnlineAttempt(state, resolver) { |
55 } | 55 } |
56 }; | 56 }; |
57 | 57 |
58 class ParallelAuthenticatorTest : public testing::Test { | 58 class ParallelAuthenticatorTest : public testing::Test { |
59 public: | 59 public: |
60 ParallelAuthenticatorTest() | 60 ParallelAuthenticatorTest() |
61 : message_loop_(MessageLoop::TYPE_UI), | 61 : message_loop_(base::MessageLoop::TYPE_UI), |
62 ui_thread_(BrowserThread::UI, &message_loop_), | 62 ui_thread_(BrowserThread::UI, &message_loop_), |
63 file_thread_(BrowserThread::FILE, &message_loop_), | 63 file_thread_(BrowserThread::FILE, &message_loop_), |
64 io_thread_(BrowserThread::IO), | 64 io_thread_(BrowserThread::IO), |
65 username_("me@nowhere.org"), | 65 username_("me@nowhere.org"), |
66 password_("fakepass"), | 66 password_("fakepass"), |
67 user_manager_enabler_(new MockUserManager) { | 67 user_manager_enabler_(new MockUserManager) { |
68 hash_ascii_.assign("0a010000000000a0"); | 68 hash_ascii_.assign("0a010000000000a0"); |
69 hash_ascii_.append(std::string(16, '0')); | 69 hash_ascii_.append(std::string(16, '0')); |
70 } | 70 } |
71 | 71 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 } | 200 } |
201 | 201 |
202 void SetOwnerState(bool owner_check_finished, bool check_result) { | 202 void SetOwnerState(bool owner_check_finished, bool check_result) { |
203 auth_->SetOwnerState(owner_check_finished, check_result); | 203 auth_->SetOwnerState(owner_check_finished, check_result); |
204 } | 204 } |
205 | 205 |
206 void FakeOnlineAttempt() { | 206 void FakeOnlineAttempt() { |
207 auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get())); | 207 auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get())); |
208 } | 208 } |
209 | 209 |
210 MessageLoop message_loop_; | 210 base::MessageLoop message_loop_; |
211 content::TestBrowserThread ui_thread_; | 211 content::TestBrowserThread ui_thread_; |
212 content::TestBrowserThread file_thread_; | 212 content::TestBrowserThread file_thread_; |
213 content::TestBrowserThread io_thread_; | 213 content::TestBrowserThread io_thread_; |
214 | 214 |
215 std::string username_; | 215 std::string username_; |
216 std::string password_; | 216 std::string password_; |
217 std::string username_hash_; | 217 std::string username_hash_; |
218 std::string hash_ascii_; | 218 std::string hash_ascii_; |
219 | 219 |
220 ScopedStubCrosEnabler stub_cros_enabler_; | 220 ScopedStubCrosEnabler stub_cros_enabler_; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 .WillOnce(Return(std::string())) | 795 .WillOnce(Return(std::string())) |
796 .RetiresOnSaturation(); | 796 .RetiresOnSaturation(); |
797 | 797 |
798 auth_->AuthenticateToUnlock(UserContext(username_, | 798 auth_->AuthenticateToUnlock(UserContext(username_, |
799 std::string(), | 799 std::string(), |
800 std::string())); | 800 std::string())); |
801 message_loop_.Run(); | 801 message_loop_.Run(); |
802 } | 802 } |
803 | 803 |
804 } // namespace chromeos | 804 } // namespace chromeos |
OLD | NEW |