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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/login/user.h" | 10 #include "chrome/browser/chromeos/login/user.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "content/public/browser/notification_observer.h" | 36 #include "content/public/browser/notification_observer.h" |
37 #include "content/public/browser/notification_registrar.h" | 37 #include "content/public/browser/notification_registrar.h" |
38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/notification_source.h" | 39 #include "content/public/browser/notification_source.h" |
40 #include "policy/policy_constants.h" | 40 #include "policy/policy_constants.h" |
41 #include "third_party/cros_system_api/dbus/service_constants.h" | 41 #include "third_party/cros_system_api/dbus/service_constants.h" |
42 #else // !defined(OS_CHROMEOS) | 42 #else // !defined(OS_CHROMEOS) |
43 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" | 43 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
44 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" | 44 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" |
45 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" | 45 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" |
46 #include "components/wifi/wifi_service.h" | 46 #include "components/wifi/fake_wifi_service.h" |
47 #endif // defined(OS_CHROMEOS) | 47 #endif // defined(OS_CHROMEOS) |
48 | 48 |
49 using testing::Return; | 49 using testing::Return; |
50 using testing::_; | 50 using testing::_; |
51 | 51 |
52 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
53 using chromeos::CryptohomeClient; | 53 using chromeos::CryptohomeClient; |
54 using chromeos::DBUS_METHOD_CALL_SUCCESS; | 54 using chromeos::DBUS_METHOD_CALL_SUCCESS; |
55 using chromeos::DBusMethodCallStatus; | 55 using chromeos::DBusMethodCallStatus; |
56 using chromeos::DBusThreadManager; | 56 using chromeos::DBusThreadManager; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 ExtensionApiTest::SetUpCommandLine(command_line); | 310 ExtensionApiTest::SetUpCommandLine(command_line); |
311 // Whitelist the extension ID of the test extension. | 311 // Whitelist the extension ID of the test extension. |
312 command_line->AppendSwitchASCII( | 312 command_line->AppendSwitchASCII( |
313 extensions::switches::kWhitelistedExtensionID, | 313 extensions::switches::kWhitelistedExtensionID, |
314 "epcifkihnkjgphfkloaaleeakhpmgdmn"); | 314 "epcifkihnkjgphfkloaaleeakhpmgdmn"); |
315 } | 315 } |
316 | 316 |
317 static KeyedService* CreateNetworkingPrivateServiceClient( | 317 static KeyedService* CreateNetworkingPrivateServiceClient( |
318 content::BrowserContext* profile) { | 318 content::BrowserContext* profile) { |
319 return new extensions::NetworkingPrivateServiceClient( | 319 return new extensions::NetworkingPrivateServiceClient( |
320 wifi::WiFiService::CreateForTest(), | 320 new wifi::FakeWiFiService(), new CryptoVerifyStub()); |
321 new CryptoVerifyStub()); | |
322 } | 321 } |
323 | 322 |
324 virtual void SetUpOnMainThread() OVERRIDE { | 323 virtual void SetUpOnMainThread() OVERRIDE { |
325 ExtensionApiTest::SetUpOnMainThread(); | 324 ExtensionApiTest::SetUpOnMainThread(); |
326 content::RunAllPendingInMessageLoop(); | 325 content::RunAllPendingInMessageLoop(); |
327 NetworkingPrivateServiceClientFactory::GetInstance()->SetTestingFactory( | 326 NetworkingPrivateServiceClientFactory::GetInstance()->SetTestingFactory( |
328 profile(), | 327 profile(), |
329 &CreateNetworkingPrivateServiceClient); | 328 &CreateNetworkingPrivateServiceClient); |
330 } | 329 } |
331 | 330 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 base::Unretained(detector()))); | 538 base::Unretained(detector()))); |
540 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; | 539 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; |
541 } | 540 } |
542 #endif // defined(OS_CHROMEOS) | 541 #endif // defined(OS_CHROMEOS) |
543 | 542 |
544 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, | 543 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, |
545 ExtensionNetworkingPrivateApiTest, | 544 ExtensionNetworkingPrivateApiTest, |
546 testing::Bool()); | 545 testing::Bool()); |
547 | 546 |
548 } // namespace | 547 } // namespace |
OLD | NEW |