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/users/user.h" | 10 #include "chrome/browser/chromeos/login/users/user.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 }; | 104 }; |
105 #else // !defined(OS_CHROMEOS) | 105 #else // !defined(OS_CHROMEOS) |
106 | 106 |
107 // Stub Verify* methods implementation to satisfy expectations of | 107 // Stub Verify* methods implementation to satisfy expectations of |
108 // networking_private_apitest. | 108 // networking_private_apitest. |
109 // TODO(mef): Fix ChromeOS implementation to use NetworkingPrivateCrypto, | 109 // TODO(mef): Fix ChromeOS implementation to use NetworkingPrivateCrypto, |
110 // and update networking_private_apitest to use and expect valid data. | 110 // and update networking_private_apitest to use and expect valid data. |
111 // That will eliminate the need for mock implementation. | 111 // That will eliminate the need for mock implementation. |
112 class CryptoVerifyStub | 112 class CryptoVerifyStub |
113 : public extensions::NetworkingPrivateServiceClient::CryptoVerify { | 113 : public extensions::NetworkingPrivateServiceClient::CryptoVerify { |
114 virtual void VerifyDestination(scoped_ptr<base::ListValue> args, | 114 virtual void VerifyDestination(scoped_ptr<base::DictionaryValue> properties, |
115 bool* verified, | 115 bool* verified, |
116 std::string* error) OVERRIDE { | 116 std::string* error) OVERRIDE { |
117 *verified = true; | 117 *verified = true; |
118 } | 118 } |
119 | 119 |
120 virtual void VerifyAndEncryptCredentials( | 120 virtual void VerifyAndEncryptCredentials( |
121 scoped_ptr<base::ListValue> args, | 121 const std::string& network_guid, |
122 const extensions::NetworkingPrivateServiceClient::CryptoVerify:: | 122 scoped_ptr<base::DictionaryValue> properties, |
123 VerifyAndEncryptCredentialsCallback& callback) OVERRIDE { | 123 const VerifyAndEncryptCredentialsCallback& callback) OVERRIDE { |
124 callback.Run("encrypted_credentials", ""); | 124 callback.Run("encrypted_credentials", ""); |
125 } | 125 } |
126 | 126 |
127 virtual void VerifyAndEncryptData(scoped_ptr<base::ListValue> args, | 127 virtual void VerifyAndEncryptData( |
128 std::string* encoded_data, | 128 scoped_ptr<base::DictionaryValue> properties, |
129 std::string* error) OVERRIDE { | 129 const std::string& data, |
130 *encoded_data = "encrypted_data"; | 130 std::string* base64_encoded_ciphertext, |
| 131 std::string* error) OVERRIDE { |
| 132 *base64_encoded_ciphertext = "encrypted_data"; |
131 } | 133 } |
132 }; | 134 }; |
133 #endif // defined(OS_CHROMEOS) | 135 #endif // defined(OS_CHROMEOS) |
134 | 136 |
135 class ExtensionNetworkingPrivateApiTest | 137 class ExtensionNetworkingPrivateApiTest |
136 : public ExtensionApiTest { | 138 : public ExtensionApiTest { |
137 public: | 139 public: |
138 ExtensionNetworkingPrivateApiTest() | 140 ExtensionNetworkingPrivateApiTest() |
139 #if defined(OS_CHROMEOS) | 141 #if defined(OS_CHROMEOS) |
140 : detector_(NULL), | 142 : detector_(NULL), |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 | 612 |
611 TestListener listener( | 613 TestListener listener( |
612 "notifyPortalDetectorObservers", | 614 "notifyPortalDetectorObservers", |
613 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, | 615 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, |
614 base::Unretained(detector()))); | 616 base::Unretained(detector()))); |
615 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; | 617 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; |
616 } | 618 } |
617 #endif // defined(OS_CHROMEOS) | 619 #endif // defined(OS_CHROMEOS) |
618 | 620 |
619 } // namespace | 621 } // namespace |
OLD | NEW |