OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chromeos/login/helper.h" | 13 #include "chrome/browser/chromeos/login/helper.h" |
14 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 14 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
15 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" | 15 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
16 #include "chrome/browser/extensions/api/networking_private/networking_private_ui
_delegate_chromeos.h" | 16 #include "chrome/browser/extensions/api/networking_private/networking_private_ui
_delegate_chromeos.h" |
17 #include "chrome/browser/extensions/extension_apitest.h" | 17 #include "chrome/browser/extensions/extension_apitest.h" |
18 #include "chromeos/chromeos_switches.h" | 18 #include "chromeos/chromeos_switches.h" |
19 #include "chromeos/cryptohome/cryptohome_parameters.h" | 19 #include "chromeos/cryptohome/cryptohome_parameters.h" |
20 #include "chromeos/dbus/cryptohome_client.h" | 20 #include "chromeos/dbus/cryptohome_client.h" |
21 #include "chromeos/dbus/dbus_thread_manager.h" | 21 #include "chromeos/dbus/dbus_thread_manager.h" |
22 #include "chromeos/dbus/shill_device_client.h" | 22 #include "chromeos/dbus/shill_device_client.h" |
23 #include "chromeos/dbus/shill_ipconfig_client.h" | 23 #include "chromeos/dbus/shill_ipconfig_client.h" |
24 #include "chromeos/dbus/shill_manager_client.h" | 24 #include "chromeos/dbus/shill_manager_client.h" |
25 #include "chromeos/dbus/shill_profile_client.h" | 25 #include "chromeos/dbus/shill_profile_client.h" |
26 #include "chromeos/dbus/shill_service_client.h" | 26 #include "chromeos/dbus/shill_service_client.h" |
27 #include "chromeos/login/user_names.h" | |
28 #include "chromeos/network/network_handler.h" | 27 #include "chromeos/network/network_handler.h" |
29 #include "chromeos/network/network_state_handler.h" | 28 #include "chromeos/network/network_state_handler.h" |
30 #include "chromeos/network/onc/onc_utils.h" | 29 #include "chromeos/network/onc/onc_utils.h" |
31 #include "chromeos/network/portal_detector/network_portal_detector.h" | 30 #include "chromeos/network/portal_detector/network_portal_detector.h" |
32 #include "components/onc/onc_constants.h" | 31 #include "components/onc/onc_constants.h" |
33 #include "components/policy/core/browser/browser_policy_connector.h" | 32 #include "components/policy/core/browser/browser_policy_connector.h" |
34 #include "components/policy/core/common/external_data_fetcher.h" | 33 #include "components/policy/core/common/external_data_fetcher.h" |
35 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 34 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
36 #include "components/policy/core/common/policy_map.h" | 35 #include "components/policy/core/common/policy_map.h" |
37 #include "components/policy/core/common/policy_types.h" | 36 #include "components/policy/core/common/policy_types.h" |
38 #include "components/policy/policy_constants.h" | 37 #include "components/policy/policy_constants.h" |
39 #include "components/user_manager/user.h" | 38 #include "components/user_manager/user.h" |
40 #include "components/user_manager/user_manager.h" | 39 #include "components/user_manager/user_manager.h" |
| 40 #include "components/user_manager/user_names.h" |
41 #include "content/public/browser/notification_observer.h" | 41 #include "content/public/browser/notification_observer.h" |
42 #include "content/public/browser/notification_registrar.h" | 42 #include "content/public/browser/notification_registrar.h" |
43 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/notification_source.h" | 44 #include "content/public/browser/notification_source.h" |
45 #include "content/public/test/test_utils.h" | 45 #include "content/public/test/test_utils.h" |
46 #include "extensions/browser/api/networking_private/networking_private_chromeos.
h" | 46 #include "extensions/browser/api/networking_private/networking_private_chromeos.
h" |
47 #include "extensions/browser/api/networking_private/networking_private_delegate_
factory.h" | 47 #include "extensions/browser/api/networking_private/networking_private_delegate_
factory.h" |
48 #include "extensions/browser/notification_types.h" | 48 #include "extensions/browser/notification_types.h" |
49 #include "extensions/common/switches.h" | 49 #include "extensions/common/switches.h" |
50 #include "testing/gmock/include/gmock/gmock.h" | 50 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 ExtensionApiTest::SetUpCommandLine(command_line); | 192 ExtensionApiTest::SetUpCommandLine(command_line); |
193 // Whitelist the extension ID of the test extension. | 193 // Whitelist the extension ID of the test extension. |
194 command_line->AppendSwitchASCII( | 194 command_line->AppendSwitchASCII( |
195 extensions::switches::kWhitelistedExtensionID, | 195 extensions::switches::kWhitelistedExtensionID, |
196 "epcifkihnkjgphfkloaaleeakhpmgdmn"); | 196 "epcifkihnkjgphfkloaaleeakhpmgdmn"); |
197 | 197 |
198 // TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI | 198 // TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI |
199 // uses the ProfileHelper to obtain the userhash crbug/238623. | 199 // uses the ProfileHelper to obtain the userhash crbug/238623. |
200 const cryptohome::Identification login_user = | 200 const cryptohome::Identification login_user = |
201 cryptohome::Identification::FromString( | 201 cryptohome::Identification::FromString( |
202 chromeos::login::CanonicalizeUserID( | 202 user_manager::CanonicalizeUserID(command_line->GetSwitchValueNative( |
203 command_line->GetSwitchValueNative( | 203 chromeos::switches::kLoginUser))); |
204 chromeos::switches::kLoginUser))); | |
205 const std::string sanitized_user = | 204 const std::string sanitized_user = |
206 CryptohomeClient::GetStubSanitizedUsername(login_user); | 205 CryptohomeClient::GetStubSanitizedUsername(login_user); |
207 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 206 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
208 sanitized_user); | 207 sanitized_user); |
209 } | 208 } |
210 | 209 |
211 void InitializeSanitizedUsername() { | 210 void InitializeSanitizedUsername() { |
212 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 211 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
213 user_manager::User* user = user_manager->GetActiveUser(); | 212 user_manager::User* user = user_manager->GetActiveUser(); |
214 CHECK(user); | 213 CHECK(user); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 707 } |
709 | 708 |
710 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CellularSimPuk) { | 709 IN_PROC_BROWSER_TEST_F(NetworkingPrivateChromeOSApiTest, CellularSimPuk) { |
711 SetupCellular(); | 710 SetupCellular(); |
712 // Lock the SIM | 711 // Lock the SIM |
713 device_test_->SetSimLocked(kCellularDevicePath, true); | 712 device_test_->SetSimLocked(kCellularDevicePath, true); |
714 EXPECT_TRUE(RunNetworkingSubtest("cellularSimPuk")) << message_; | 713 EXPECT_TRUE(RunNetworkingSubtest("cellularSimPuk")) << message_; |
715 } | 714 } |
716 | 715 |
717 } // namespace | 716 } // namespace |
OLD | NEW |