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

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: Fix stupid mac complaints 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(const Credentials& verification_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 const Credentials& credentials,
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(const Credentials& verification_properties,
128 std::string* encoded_data, 128 const std::string& data,
129 std::string* base64_encoded_ciphertext,
129 std::string* error) OVERRIDE { 130 std::string* error) OVERRIDE {
130 *encoded_data = "encrypted_data"; 131 *base64_encoded_ciphertext = "encrypted_data";
131 } 132 }
132 }; 133 };
133 #endif // defined(OS_CHROMEOS) 134 #endif // defined(OS_CHROMEOS)
134 135
135 class ExtensionNetworkingPrivateApiTest 136 class ExtensionNetworkingPrivateApiTest
136 : public ExtensionApiTest { 137 : public ExtensionApiTest {
137 public: 138 public:
138 ExtensionNetworkingPrivateApiTest() 139 ExtensionNetworkingPrivateApiTest()
139 #if defined(OS_CHROMEOS) 140 #if defined(OS_CHROMEOS)
140 : detector_(NULL), 141 : detector_(NULL),
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 611
611 TestListener listener( 612 TestListener listener(
612 "notifyPortalDetectorObservers", 613 "notifyPortalDetectorObservers",
613 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting, 614 base::Bind(&NetworkPortalDetectorTestImpl::NotifyObserversForTesting,
614 base::Unretained(detector()))); 615 base::Unretained(detector())));
615 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_; 616 EXPECT_TRUE(RunNetworkingSubtest("captivePortalNotification")) << message_;
616 } 617 }
617 #endif // defined(OS_CHROMEOS) 618 #endif // defined(OS_CHROMEOS)
618 619
619 } // namespace 620 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698