Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_apitest.cc

Issue 102993002: Implement Networking Private API VerifyAndEncryptCredentials method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented NetworkingPrivateCredentialsGetterMac. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 extensions::NetworkingPrivateCredentialsGetter* credentials_getter)
78 OVERRIDE {
79 credentials_getter->ReportResult("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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 VerifyAndEncryptData) { 439 VerifyAndEncryptData) {
432 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_; 440 EXPECT_TRUE(RunNetworkingSubtest("verifyAndEncryptData")) << message_;
433 } 441 }
434 442
435 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation, 443 INSTANTIATE_TEST_CASE_P(ExtensionNetworkingPrivateApiTestInstantiation,
436 ExtensionNetworkingPrivateApiTest, 444 ExtensionNetworkingPrivateApiTest,
437 testing::Bool()); 445 testing::Bool());
438 446
439 } // namespace 447 } // namespace
440 448
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698