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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // and is never started. This is necessary so that we skip various | 101 // and is never started. This is necessary so that we skip various |
102 // bits of initialization that get posted to the IO thread. We do | 102 // bits of initialization that get posted to the IO thread. We do |
103 // however, at one point in the test, temporarily set the message | 103 // however, at one point in the test, temporarily set the message |
104 // loop for the IO thread. | 104 // loop for the IO thread. |
105 LoginUtilsTest() | 105 LoginUtilsTest() |
106 : loop_(MessageLoop::TYPE_IO), | 106 : loop_(MessageLoop::TYPE_IO), |
107 browser_process_( | 107 browser_process_( |
108 static_cast<TestingBrowserProcess*>(g_browser_process)), | 108 static_cast<TestingBrowserProcess*>(g_browser_process)), |
109 local_state_(browser_process_), | 109 local_state_(browser_process_), |
110 ui_thread_(content::BrowserThread::UI, &loop_), | 110 ui_thread_(content::BrowserThread::UI, &loop_), |
| 111 db_thread_(content::BrowserThread::DB), |
111 file_thread_(content::BrowserThread::FILE, &loop_), | 112 file_thread_(content::BrowserThread::FILE, &loop_), |
112 io_thread_(content::BrowserThread::IO), | 113 io_thread_(content::BrowserThread::IO), |
113 db_thread_(content::BrowserThread::DB), | |
114 mock_async_method_caller_(NULL), | 114 mock_async_method_caller_(NULL), |
115 connector_(NULL), | 115 connector_(NULL), |
116 cryptohome_(NULL), | 116 cryptohome_(NULL), |
117 prepared_profile_(NULL) {} | 117 prepared_profile_(NULL) {} |
118 | 118 |
119 virtual void SetUp() OVERRIDE { | 119 virtual void SetUp() OVERRIDE { |
120 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 120 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
121 | 121 |
122 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 122 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
123 command_line->AppendSwitch(switches::kEnableDevicePolicy); | 123 command_line->AppendSwitch(switches::kEnableDevicePolicy); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } | 362 } |
363 | 363 |
364 protected: | 364 protected: |
365 ScopedStubCrosEnabler stub_cros_enabler_; | 365 ScopedStubCrosEnabler stub_cros_enabler_; |
366 | 366 |
367 MessageLoop loop_; | 367 MessageLoop loop_; |
368 TestingBrowserProcess* browser_process_; | 368 TestingBrowserProcess* browser_process_; |
369 ScopedTestingLocalState local_state_; | 369 ScopedTestingLocalState local_state_; |
370 | 370 |
371 content::TestBrowserThread ui_thread_; | 371 content::TestBrowserThread ui_thread_; |
| 372 content::TestBrowserThread db_thread_; |
372 content::TestBrowserThread file_thread_; | 373 content::TestBrowserThread file_thread_; |
373 content::TestBrowserThread io_thread_; | 374 content::TestBrowserThread io_thread_; |
374 content::TestBrowserThread db_thread_; | |
375 scoped_ptr<IOThread> io_thread_state_; | 375 scoped_ptr<IOThread> io_thread_state_; |
376 | 376 |
377 MockDBusThreadManager mock_dbus_thread_manager_; | 377 MockDBusThreadManager mock_dbus_thread_manager_; |
378 input_method::MockInputMethodManager mock_input_method_manager_; | 378 input_method::MockInputMethodManager mock_input_method_manager_; |
379 TestURLFetcherFactory test_url_fetcher_factory_; | 379 TestURLFetcherFactory test_url_fetcher_factory_; |
380 | 380 |
381 cryptohome::MockAsyncMethodCaller* mock_async_method_caller_; | 381 cryptohome::MockAsyncMethodCaller* mock_async_method_caller_; |
382 | 382 |
383 policy::BrowserPolicyConnector* connector_; | 383 policy::BrowserPolicyConnector* connector_; |
384 MockCryptohomeLibrary* cryptohome_; | 384 MockCryptohomeLibrary* cryptohome_; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 527 } |
528 | 528 |
529 INSTANTIATE_TEST_CASE_P( | 529 INSTANTIATE_TEST_CASE_P( |
530 LoginUtilsBlockingLoginTestInstance, | 530 LoginUtilsBlockingLoginTestInstance, |
531 LoginUtilsBlockingLoginTest, | 531 LoginUtilsBlockingLoginTest, |
532 testing::Values(0, 1, 2, 3, 4, 5)); | 532 testing::Values(0, 1, 2, 3, 4, 5)); |
533 | 533 |
534 } // namespace | 534 } // namespace |
535 | 535 |
536 } | 536 } |
OLD | NEW |