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 "base/callback.h" | 5 #include "base/callback.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/chromeos/login/user.h" | 8 #include "chrome/browser/chromeos/login/user.h" |
9 #include "chrome/browser/chromeos/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
| 13 #include "extensions/common/switches.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
14 | 15 |
15 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
16 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
17 #include "chromeos/dbus/cryptohome_client.h" | 18 #include "chromeos/dbus/cryptohome_client.h" |
18 #include "chromeos/dbus/dbus_thread_manager.h" | 19 #include "chromeos/dbus/dbus_thread_manager.h" |
19 #include "chromeos/dbus/shill_device_client.h" | 20 #include "chromeos/dbus/shill_device_client.h" |
20 #include "chromeos/dbus/shill_manager_client.h" | 21 #include "chromeos/dbus/shill_manager_client.h" |
21 #include "chromeos/dbus/shill_profile_client.h" | 22 #include "chromeos/dbus/shill_profile_client.h" |
22 #include "chromeos/dbus/shill_service_client.h" | 23 #include "chromeos/dbus/shill_service_client.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 static void AssignString(std::string* out, | 111 static void AssignString(std::string* out, |
111 DBusMethodCallStatus call_status, | 112 DBusMethodCallStatus call_status, |
112 const std::string& result) { | 113 const std::string& result) { |
113 CHECK_EQ(call_status, DBUS_METHOD_CALL_SUCCESS); | 114 CHECK_EQ(call_status, DBUS_METHOD_CALL_SUCCESS); |
114 *out = result; | 115 *out = result; |
115 } | 116 } |
116 | 117 |
117 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 118 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
118 ExtensionApiTest::SetUpCommandLine(command_line); | 119 ExtensionApiTest::SetUpCommandLine(command_line); |
119 // Whitelist the extension ID of the test extension. | 120 // Whitelist the extension ID of the test extension. |
120 command_line->AppendSwitchASCII(::switches::kWhitelistedExtensionID, | 121 command_line->AppendSwitchASCII( |
121 "epcifkihnkjgphfkloaaleeakhpmgdmn"); | 122 extensions::switches::kWhitelistedExtensionID, |
| 123 "epcifkihnkjgphfkloaaleeakhpmgdmn"); |
122 | 124 |
123 // TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI | 125 // TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI |
124 // uses the ProfileHelper to obtain the userhash crbug/238623. | 126 // uses the ProfileHelper to obtain the userhash crbug/238623. |
125 std::string login_user = | 127 std::string login_user = |
126 command_line->GetSwitchValueNative(chromeos::switches::kLoginUser); | 128 command_line->GetSwitchValueNative(chromeos::switches::kLoginUser); |
127 std::string sanitized_user = CryptohomeClient::GetStubSanitizedUsername( | 129 std::string sanitized_user = CryptohomeClient::GetStubSanitizedUsername( |
128 login_user); | 130 login_user); |
129 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 131 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
130 sanitized_user); | 132 sanitized_user); |
131 if (GetParam()) | 133 if (GetParam()) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 add_to_visible, add_to_watchlist); | 255 add_to_visible, add_to_watchlist); |
254 | 256 |
255 manager_test->SortManagerServices(); | 257 manager_test->SortManagerServices(); |
256 | 258 |
257 content::RunAllPendingInMessageLoop(); | 259 content::RunAllPendingInMessageLoop(); |
258 } | 260 } |
259 #else // !defined(OS_CHROMEOS) | 261 #else // !defined(OS_CHROMEOS) |
260 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 262 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
261 ExtensionApiTest::SetUpCommandLine(command_line); | 263 ExtensionApiTest::SetUpCommandLine(command_line); |
262 // Whitelist the extension ID of the test extension. | 264 // Whitelist the extension ID of the test extension. |
263 command_line->AppendSwitchASCII(::switches::kWhitelistedExtensionID, | 265 command_line->AppendSwitchASCII( |
264 "epcifkihnkjgphfkloaaleeakhpmgdmn"); | 266 extensions::switches::kWhitelistedExtensionID, |
| 267 "epcifkihnkjgphfkloaaleeakhpmgdmn"); |
265 } | 268 } |
266 | 269 |
267 static KeyedService* CreateNetworkingPrivateServiceClient( | 270 static KeyedService* CreateNetworkingPrivateServiceClient( |
268 content::BrowserContext* profile) { | 271 content::BrowserContext* profile) { |
269 return new extensions::NetworkingPrivateServiceClient( | 272 return new extensions::NetworkingPrivateServiceClient( |
270 wifi::WiFiService::CreateForTest(), | 273 wifi::WiFiService::CreateForTest(), |
271 new CryptoVerifyStub()); | 274 new CryptoVerifyStub()); |
272 } | 275 } |
273 | 276 |
274 virtual void SetUpOnMainThread() OVERRIDE { | 277 virtual void SetUpOnMainThread() OVERRIDE { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 GetWifiTDLSStatus) { | 453 GetWifiTDLSStatus) { |
451 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; | 454 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; |
452 } | 455 } |
453 #endif | 456 #endif |
454 | 457 |
455 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, | 458 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, |
456 ExtensionNetworkingPrivateApiTest, | 459 ExtensionNetworkingPrivateApiTest, |
457 testing::Bool()); | 460 testing::Bool()); |
458 | 461 |
459 } // namespace | 462 } // namespace |
OLD | NEW |