| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 197 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
| 198 | 198 |
| 199 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 199 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 200 command_line->AppendSwitchASCII( | 200 command_line->AppendSwitchASCII( |
| 201 ::switches::kDeviceManagementUrl, kDMServer); | 201 ::switches::kDeviceManagementUrl, kDMServer); |
| 202 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 202 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 203 | 203 |
| 204 // DBusThreadManager should be initialized before io_thread_state_, as | 204 // DBusThreadManager should be initialized before io_thread_state_, as |
| 205 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl, | 205 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl, |
| 206 // which is part of io_thread_state_. | 206 // which is part of io_thread_state_. |
| 207 DBusThreadManager::InitializeForTesting(&fake_dbus_thread_manager_); | 207 DBusThreadManager::InitializeWithStub(); |
| 208 | 208 |
| 209 SystemSaltGetter::Initialize(); | 209 SystemSaltGetter::Initialize(); |
| 210 LoginState::Initialize(); | 210 LoginState::Initialize(); |
| 211 | 211 |
| 212 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, _)) | 212 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, _)) |
| 213 .WillRepeatedly(Return(false)); | 213 .WillRepeatedly(Return(false)); |
| 214 chromeos::system::StatisticsProvider::SetTestProvider( | 214 chromeos::system::StatisticsProvider::SetTestProvider( |
| 215 &mock_statistics_provider_); | 215 &mock_statistics_provider_); |
| 216 | 216 |
| 217 mock_input_method_manager_ = new input_method::MockInputMethodManager(); | 217 mock_input_method_manager_ = new input_method::MockInputMethodManager(); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 base::MessageLoop loop_; | 460 base::MessageLoop loop_; |
| 461 TestingBrowserProcess* browser_process_; | 461 TestingBrowserProcess* browser_process_; |
| 462 ScopedTestingLocalState local_state_; | 462 ScopedTestingLocalState local_state_; |
| 463 | 463 |
| 464 content::TestBrowserThread ui_thread_; | 464 content::TestBrowserThread ui_thread_; |
| 465 content::TestBrowserThread db_thread_; | 465 content::TestBrowserThread db_thread_; |
| 466 content::TestBrowserThread file_thread_; | 466 content::TestBrowserThread file_thread_; |
| 467 scoped_ptr<content::TestBrowserThread> io_thread_; | 467 scoped_ptr<content::TestBrowserThread> io_thread_; |
| 468 scoped_ptr<IOThread> io_thread_state_; | 468 scoped_ptr<IOThread> io_thread_state_; |
| 469 | 469 |
| 470 FakeDBusThreadManager fake_dbus_thread_manager_; | |
| 471 input_method::MockInputMethodManager* mock_input_method_manager_; | 470 input_method::MockInputMethodManager* mock_input_method_manager_; |
| 472 disks::MockDiskMountManager mock_disk_mount_manager_; | 471 disks::MockDiskMountManager mock_disk_mount_manager_; |
| 473 net::TestURLFetcherFactory test_url_fetcher_factory_; | 472 net::TestURLFetcherFactory test_url_fetcher_factory_; |
| 474 | 473 |
| 475 cryptohome::MockAsyncMethodCaller* mock_async_method_caller_; | 474 cryptohome::MockAsyncMethodCaller* mock_async_method_caller_; |
| 476 | 475 |
| 477 chromeos::system::MockStatisticsProvider mock_statistics_provider_; | 476 chromeos::system::MockStatisticsProvider mock_statistics_provider_; |
| 478 | 477 |
| 479 policy::BrowserPolicyConnector* connector_; | 478 policy::BrowserPolicyConnector* connector_; |
| 480 | 479 |
| 481 // Initialized after |fake_dbus_thread_manager_| is set up. | |
| 482 scoped_ptr<ScopedTestDeviceSettingsService> test_device_settings_service_; | 480 scoped_ptr<ScopedTestDeviceSettingsService> test_device_settings_service_; |
| 483 scoped_ptr<ScopedTestCrosSettings> test_cros_settings_; | 481 scoped_ptr<ScopedTestCrosSettings> test_cros_settings_; |
| 484 scoped_ptr<ScopedTestUserManager> test_user_manager_; | 482 scoped_ptr<ScopedTestUserManager> test_user_manager_; |
| 485 | 483 |
| 486 Profile* prepared_profile_; | 484 Profile* prepared_profile_; |
| 487 | 485 |
| 488 base::Closure rlz_initialized_cb_; | 486 base::Closure rlz_initialized_cb_; |
| 489 | 487 |
| 490 private: | 488 private: |
| 491 base::ScopedTempDir scoped_temp_dir_; | 489 base::ScopedTempDir scoped_temp_dir_; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 670 } |
| 673 | 671 |
| 674 INSTANTIATE_TEST_CASE_P( | 672 INSTANTIATE_TEST_CASE_P( |
| 675 LoginUtilsBlockingLoginTestInstance, | 673 LoginUtilsBlockingLoginTestInstance, |
| 676 LoginUtilsBlockingLoginTest, | 674 LoginUtilsBlockingLoginTest, |
| 677 testing::Values(0, 1, 2, 3, 4, 5)); | 675 testing::Values(0, 1, 2, 3, 4, 5)); |
| 678 | 676 |
| 679 } // namespace | 677 } // namespace |
| 680 | 678 |
| 681 } // namespace chromeos | 679 } // namespace chromeos |
| OLD | NEW |