| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chromeos/network/onc/onc_utils.h" | 23 #include "chromeos/network/onc/onc_utils.h" |
| 24 #include "components/onc/onc_constants.h" | 24 #include "components/onc/onc_constants.h" |
| 25 #include "components/policy/core/browser/browser_policy_connector.h" | 25 #include "components/policy/core/browser/browser_policy_connector.h" |
| 26 #include "components/policy/core/common/external_data_fetcher.h" | 26 #include "components/policy/core/common/external_data_fetcher.h" |
| 27 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 27 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 28 #include "components/policy/core/common/policy_map.h" | 28 #include "components/policy/core/common/policy_map.h" |
| 29 #include "components/policy/core/common/policy_types.h" | 29 #include "components/policy/core/common/policy_types.h" |
| 30 #include "policy/policy_constants.h" | 30 #include "policy/policy_constants.h" |
| 31 #include "third_party/cros_system_api/dbus/service_constants.h" | 31 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 32 #else // !defined(OS_CHROMEOS) | 32 #else // !defined(OS_CHROMEOS) |
| 33 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
| 33 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" | 34 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" |
| 34 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" | 35 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client_factory.h" |
| 35 #include "components/wifi/wifi_service.h" | 36 #include "components/wifi/wifi_service.h" |
| 36 #endif // defined(OS_CHROMEOS) | 37 #endif // defined(OS_CHROMEOS) |
| 37 | 38 |
| 38 using testing::Return; | 39 using testing::Return; |
| 39 using testing::_; | 40 using testing::_; |
| 40 | 41 |
| 41 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 42 using chromeos::CryptohomeClient; | 43 using chromeos::CryptohomeClient; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 63 // and update networking_private_apitest to use and expect valid data. | 64 // and update networking_private_apitest to use and expect valid data. |
| 64 // That will eliminate the need for mock implementation. | 65 // That will eliminate the need for mock implementation. |
| 65 class CryptoVerifyStub | 66 class CryptoVerifyStub |
| 66 : public extensions::NetworkingPrivateServiceClient::CryptoVerify { | 67 : public extensions::NetworkingPrivateServiceClient::CryptoVerify { |
| 67 virtual void VerifyDestination(scoped_ptr<base::ListValue> args, | 68 virtual void VerifyDestination(scoped_ptr<base::ListValue> args, |
| 68 bool* verified, | 69 bool* verified, |
| 69 std::string* error) OVERRIDE { | 70 std::string* error) OVERRIDE { |
| 70 *verified = true; | 71 *verified = true; |
| 71 } | 72 } |
| 72 | 73 |
| 74 virtual void VerifyAndEncryptCredentials( |
| 75 scoped_ptr<base::ListValue> args, |
| 76 const extensions::NetworkingPrivateServiceClient::CryptoVerify:: |
| 77 VerifyAndEncryptCredentialsCallback& callback) OVERRIDE { |
| 78 callback.Run("encrypted_credentials", ""); |
| 79 } |
| 80 |
| 73 virtual void VerifyAndEncryptData(scoped_ptr<base::ListValue> args, | 81 virtual void VerifyAndEncryptData(scoped_ptr<base::ListValue> args, |
| 74 std::string* encoded_data, | 82 std::string* encoded_data, |
| 75 std::string* error) OVERRIDE { | 83 std::string* error) OVERRIDE { |
| 76 *encoded_data = "encrypted_data"; | 84 *encoded_data = "encrypted_data"; |
| 77 } | 85 } |
| 78 }; | 86 }; |
| 79 #endif // defined(OS_CHROMEOS) | 87 #endif // defined(OS_CHROMEOS) |
| 80 | 88 |
| 81 class ExtensionNetworkingPrivateApiTest : | 89 class ExtensionNetworkingPrivateApiTest : |
| 82 public ExtensionApiTest, | 90 public ExtensionApiTest, |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 GetWifiTDLSStatus) { | 450 GetWifiTDLSStatus) { |
| 443 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; | 451 EXPECT_TRUE(RunNetworkingSubtest("getWifiTDLSStatus")) << message_; |
| 444 } | 452 } |
| 445 #endif | 453 #endif |
| 446 | 454 |
| 447 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, | 455 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, |
| 448 ExtensionNetworkingPrivateApiTest, | 456 ExtensionNetworkingPrivateApiTest, |
| 449 testing::Bool()); | 457 testing::Bool()); |
| 450 | 458 |
| 451 } // namespace | 459 } // namespace |
| OLD | NEW |