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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 public: | 50 public: |
51 TestOnlineAttempt(AuthAttemptState* state, | 51 TestOnlineAttempt(AuthAttemptState* state, |
52 AuthAttemptStateResolver* resolver) | 52 AuthAttemptStateResolver* resolver) |
53 : OnlineAttempt(state, resolver) { | 53 : OnlineAttempt(state, resolver) { |
54 } | 54 } |
55 }; | 55 }; |
56 | 56 |
57 class ParallelAuthenticatorTest : public testing::Test { | 57 class ParallelAuthenticatorTest : public testing::Test { |
58 public: | 58 public: |
59 ParallelAuthenticatorTest() | 59 ParallelAuthenticatorTest() |
60 : message_loop_(MessageLoop::TYPE_UI), | 60 : message_loop_(base::MessageLoop::TYPE_UI), |
61 ui_thread_(BrowserThread::UI, &message_loop_), | 61 ui_thread_(BrowserThread::UI, &message_loop_), |
62 file_thread_(BrowserThread::FILE, &message_loop_), | 62 file_thread_(BrowserThread::FILE, &message_loop_), |
63 io_thread_(BrowserThread::IO), | 63 io_thread_(BrowserThread::IO), |
64 username_("me@nowhere.org"), | 64 username_("me@nowhere.org"), |
65 password_("fakepass"), | 65 password_("fakepass"), |
66 user_manager_enabler_(new MockUserManager) { | 66 user_manager_enabler_(new MockUserManager) { |
67 hash_ascii_.assign("0a010000000000a0"); | 67 hash_ascii_.assign("0a010000000000a0"); |
68 hash_ascii_.append(std::string(16, '0')); | 68 hash_ascii_.append(std::string(16, '0')); |
69 } | 69 } |
70 | 70 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 void SetOwnerState(bool owner_check_finished, bool check_result) { | 194 void SetOwnerState(bool owner_check_finished, bool check_result) { |
195 auth_->SetOwnerState(owner_check_finished, check_result); | 195 auth_->SetOwnerState(owner_check_finished, check_result); |
196 } | 196 } |
197 | 197 |
198 void FakeOnlineAttempt() { | 198 void FakeOnlineAttempt() { |
199 auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get())); | 199 auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get())); |
200 } | 200 } |
201 | 201 |
202 MessageLoop message_loop_; | 202 base::MessageLoop message_loop_; |
203 content::TestBrowserThread ui_thread_; | 203 content::TestBrowserThread ui_thread_; |
204 content::TestBrowserThread file_thread_; | 204 content::TestBrowserThread file_thread_; |
205 content::TestBrowserThread io_thread_; | 205 content::TestBrowserThread io_thread_; |
206 | 206 |
207 std::string username_; | 207 std::string username_; |
208 std::string password_; | 208 std::string password_; |
209 std::string username_hash_; | 209 std::string username_hash_; |
210 std::string hash_ascii_; | 210 std::string hash_ascii_; |
211 | 211 |
212 ScopedStubCrosEnabler stub_cros_enabler_; | 212 ScopedStubCrosEnabler stub_cros_enabler_; |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 .WillOnce(Return(std::string())) | 786 .WillOnce(Return(std::string())) |
787 .RetiresOnSaturation(); | 787 .RetiresOnSaturation(); |
788 | 788 |
789 auth_->AuthenticateToUnlock(UserContext(username_, | 789 auth_->AuthenticateToUnlock(UserContext(username_, |
790 std::string(), | 790 std::string(), |
791 std::string())); | 791 std::string())); |
792 message_loop_.Run(); | 792 message_loop_.Run(); |
793 } | 793 } |
794 | 794 |
795 } // namespace chromeos | 795 } // namespace chromeos |
OLD | NEW |