| 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // message loop, as does the file thread (which never actually gets | 141 // message loop, as does the file thread (which never actually gets |
| 142 // started - so this is a way to fake multiple threads on a single | 142 // started - so this is a way to fake multiple threads on a single |
| 143 // test thread). The IO thread does not get the message loop set, | 143 // test thread). The IO thread does not get the message loop set, |
| 144 // and is never started. This is necessary so that we skip various | 144 // and is never started. This is necessary so that we skip various |
| 145 // bits of initialization that get posted to the IO thread. We do | 145 // bits of initialization that get posted to the IO thread. We do |
| 146 // however, at one point in the test, temporarily set the message | 146 // however, at one point in the test, temporarily set the message |
| 147 // loop for the IO thread. | 147 // loop for the IO thread. |
| 148 LoginUtilsTest() | 148 LoginUtilsTest() |
| 149 : fake_io_thread_completion_(false, false), | 149 : fake_io_thread_completion_(false, false), |
| 150 fake_io_thread_("fake_io_thread"), | 150 fake_io_thread_("fake_io_thread"), |
| 151 loop_(base::MessageLoop::TYPE_IO), | |
| 152 browser_process_(TestingBrowserProcess::GetGlobal()), | 151 browser_process_(TestingBrowserProcess::GetGlobal()), |
| 153 local_state_(browser_process_), | 152 local_state_(browser_process_), |
| 154 ui_thread_(BrowserThread::UI, &loop_), | 153 ui_thread_(BrowserThread::UI, &loop_), |
| 155 db_thread_(BrowserThread::DB, &loop_), | 154 db_thread_(BrowserThread::DB, &loop_), |
| 156 file_thread_(BrowserThread::FILE, &loop_), | 155 file_thread_(BrowserThread::FILE, &loop_), |
| 157 mock_input_method_manager_(NULL), | 156 mock_input_method_manager_(NULL), |
| 158 mock_async_method_caller_(NULL), | 157 mock_async_method_caller_(NULL), |
| 159 connector_(NULL), | 158 connector_(NULL), |
| 160 prepared_profile_(NULL) {} | 159 prepared_profile_(NULL) {} |
| 161 | 160 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 447 |
| 449 protected: | 448 protected: |
| 450 // Must be the first member variable as browser_process_ and local_state_ | 449 // Must be the first member variable as browser_process_ and local_state_ |
| 451 // rely on this being set up. | 450 // rely on this being set up. |
| 452 TestingBrowserProcessInitializer initializer_; | 451 TestingBrowserProcessInitializer initializer_; |
| 453 | 452 |
| 454 base::Closure fake_io_thread_work_; | 453 base::Closure fake_io_thread_work_; |
| 455 base::WaitableEvent fake_io_thread_completion_; | 454 base::WaitableEvent fake_io_thread_completion_; |
| 456 base::Thread fake_io_thread_; | 455 base::Thread fake_io_thread_; |
| 457 | 456 |
| 458 base::MessageLoop loop_; | 457 base::MessageLoopForIO loop_; |
| 459 TestingBrowserProcess* browser_process_; | 458 TestingBrowserProcess* browser_process_; |
| 460 ScopedTestingLocalState local_state_; | 459 ScopedTestingLocalState local_state_; |
| 461 | 460 |
| 462 content::TestBrowserThread ui_thread_; | 461 content::TestBrowserThread ui_thread_; |
| 463 content::TestBrowserThread db_thread_; | 462 content::TestBrowserThread db_thread_; |
| 464 content::TestBrowserThread file_thread_; | 463 content::TestBrowserThread file_thread_; |
| 465 scoped_ptr<content::TestBrowserThread> io_thread_; | 464 scoped_ptr<content::TestBrowserThread> io_thread_; |
| 466 scoped_ptr<IOThread> io_thread_state_; | 465 scoped_ptr<IOThread> io_thread_state_; |
| 467 | 466 |
| 468 input_method::MockInputMethodManager* mock_input_method_manager_; | 467 input_method::MockInputMethodManager* mock_input_method_manager_; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 } | 667 } |
| 669 | 668 |
| 670 INSTANTIATE_TEST_CASE_P( | 669 INSTANTIATE_TEST_CASE_P( |
| 671 LoginUtilsBlockingLoginTestInstance, | 670 LoginUtilsBlockingLoginTestInstance, |
| 672 LoginUtilsBlockingLoginTest, | 671 LoginUtilsBlockingLoginTest, |
| 673 testing::Values(0, 1, 2, 3, 4, 5)); | 672 testing::Values(0, 1, 2, 3, 4, 5)); |
| 674 | 673 |
| 675 } // namespace | 674 } // namespace |
| 676 | 675 |
| 677 } // namespace chromeos | 676 } // namespace chromeos |
| OLD | NEW |