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 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/chromeos/settings/cros_settings.h" | 28 #include "chrome/browser/chromeos/settings/cros_settings.h" |
29 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 29 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
30 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" | 30 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
31 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h" | 31 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h" |
32 #include "chrome/browser/io_thread.h" | 32 #include "chrome/browser/io_thread.h" |
33 #include "chrome/browser/net/predictor.h" | 33 #include "chrome/browser/net/predictor.h" |
34 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" | 34 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" |
35 #include "chrome/browser/profiles/profile_manager.h" | 35 #include "chrome/browser/profiles/profile_manager.h" |
36 #include "chrome/browser/rlz/rlz.h" | 36 #include "chrome/browser/rlz/rlz.h" |
37 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
38 #include "chrome/common/chrome_switches.h" | |
39 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
40 #include "chrome/test/base/scoped_testing_local_state.h" | 39 #include "chrome/test/base/scoped_testing_local_state.h" |
41 #include "chrome/test/base/testing_browser_process.h" | 40 #include "chrome/test/base/testing_browser_process.h" |
42 #include "chromeos/chromeos_switches.h" | 41 #include "chromeos/chromeos_switches.h" |
43 #include "chromeos/cryptohome/mock_async_method_caller.h" | 42 #include "chromeos/cryptohome/mock_async_method_caller.h" |
44 #include "chromeos/cryptohome/system_salt_getter.h" | 43 #include "chromeos/cryptohome/system_salt_getter.h" |
45 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 44 #include "chromeos/dbus/fake_dbus_thread_manager.h" |
46 #include "chromeos/disks/disk_mount_manager.h" | 45 #include "chromeos/disks/disk_mount_manager.h" |
47 #include "chromeos/disks/mock_disk_mount_manager.h" | 46 #include "chromeos/disks/mock_disk_mount_manager.h" |
48 #include "chromeos/login/login_state.h" | 47 #include "chromeos/login/login_state.h" |
49 #include "chromeos/network/network_handler.h" | 48 #include "chromeos/network/network_handler.h" |
50 #include "chromeos/system/mock_statistics_provider.h" | 49 #include "chromeos/system/mock_statistics_provider.h" |
51 #include "chromeos/system/statistics_provider.h" | 50 #include "chromeos/system/statistics_provider.h" |
52 #include "components/policy/core/common/cloud/device_management_service.h" | 51 #include "components/policy/core/common/cloud/device_management_service.h" |
53 #include "components/policy/core/common/policy_service.h" | 52 #include "components/policy/core/common/policy_service.h" |
| 53 #include "components/policy/core/common/policy_switches.h" |
54 #include "content/public/browser/browser_thread.h" | 54 #include "content/public/browser/browser_thread.h" |
55 #include "content/public/test/test_browser_thread.h" | 55 #include "content/public/test/test_browser_thread.h" |
56 #include "content/public/test/test_utils.h" | 56 #include "content/public/test/test_utils.h" |
57 #include "google_apis/gaia/gaia_auth_consumer.h" | 57 #include "google_apis/gaia/gaia_auth_consumer.h" |
58 #include "google_apis/gaia/gaia_urls.h" | 58 #include "google_apis/gaia/gaia_urls.h" |
59 #include "net/url_request/test_url_fetcher_factory.h" | 59 #include "net/url_request/test_url_fetcher_factory.h" |
60 #include "net/url_request/url_fetcher_delegate.h" | 60 #include "net/url_request/url_fetcher_delegate.h" |
61 #include "net/url_request/url_request.h" | 61 #include "net/url_request/url_request.h" |
62 #include "net/url_request/url_request_context_getter.h" | 62 #include "net/url_request/url_request_context_getter.h" |
63 #include "net/url_request/url_request_status.h" | 63 #include "net/url_request/url_request_status.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 base::Bind(&LoginUtilsTest::DoIOWork, base::Unretained(this)))); | 185 base::Bind(&LoginUtilsTest::DoIOWork, base::Unretained(this)))); |
186 // Map BrowserThread::IO to this loop. This allows posting to IO but nothing | 186 // Map BrowserThread::IO to this loop. This allows posting to IO but nothing |
187 // will be executed. | 187 // will be executed. |
188 io_thread_.reset( | 188 io_thread_.reset( |
189 new content::TestBrowserThread(BrowserThread::IO, fake_io_loop)); | 189 new content::TestBrowserThread(BrowserThread::IO, fake_io_loop)); |
190 | 190 |
191 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); | 191 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); |
192 | 192 |
193 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 193 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
194 command_line->AppendSwitchASCII( | 194 command_line->AppendSwitchASCII( |
195 ::switches::kDeviceManagementUrl, kDMServer); | 195 policy::switches::kDeviceManagementUrl, kDMServer); |
196 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 196 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
197 | 197 |
198 // DBusThreadManager should be initialized before io_thread_state_, as | 198 // DBusThreadManager should be initialized before io_thread_state_, as |
199 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl, | 199 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl, |
200 // which is part of io_thread_state_. | 200 // which is part of io_thread_state_. |
201 DBusThreadManager::InitializeWithStub(); | 201 DBusThreadManager::InitializeWithStub(); |
202 | 202 |
203 SystemSaltGetter::Initialize(); | 203 SystemSaltGetter::Initialize(); |
204 LoginState::Initialize(); | 204 LoginState::Initialize(); |
205 | 205 |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 668 } |
669 | 669 |
670 INSTANTIATE_TEST_CASE_P( | 670 INSTANTIATE_TEST_CASE_P( |
671 LoginUtilsBlockingLoginTestInstance, | 671 LoginUtilsBlockingLoginTestInstance, |
672 LoginUtilsBlockingLoginTest, | 672 LoginUtilsBlockingLoginTest, |
673 testing::Values(0, 1, 2, 3, 4, 5)); | 673 testing::Values(0, 1, 2, 3, 4, 5)); |
674 | 674 |
675 } // namespace | 675 } // namespace |
676 | 676 |
677 } // namespace chromeos | 677 } // namespace chromeos |
OLD | NEW |