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

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

Issue 378103002: Add NetworkingPrivateDelegate class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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/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
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 618
617 TestListener listener( 619 TestListener listener(
618 "notifyPortalDetectorObservers", 620 "notifyPortalDetectorObservers",
619 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, 621 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting,
620 base::Unretained(detector()))); 622 base::Unretained(detector())));
621 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; 623 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_;
622 } 624 }
623 #endif // defined(OS_CHROMEOS) 625 #endif // defined(OS_CHROMEOS)
624 626
625 } // namespace 627 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698