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