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

Side by Side Diff: chromeos/network/client_cert_resolver_unittest.cc

Issue 23526016: Autoconnect policy for CrOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 #include "chromeos/network/client_cert_resolver.h" 4 #include "chromeos/network/client_cert_resolver.h"
5 5
6 #include <cert.h> 6 #include <cert.h>
7 #include <pk11pub.h> 7 #include <pk11pub.h>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 std::string error; 181 std::string error;
182 scoped_ptr<base::Value> policy_value(base::JSONReader::ReadAndReturnError( 182 scoped_ptr<base::Value> policy_value(base::JSONReader::ReadAndReturnError(
183 policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error)); 183 policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error));
184 ASSERT_TRUE(policy_value) << error; 184 ASSERT_TRUE(policy_value) << error;
185 185
186 base::ListValue* policy = NULL; 186 base::ListValue* policy = NULL;
187 ASSERT_TRUE(policy_value->GetAsList(&policy)); 187 ASSERT_TRUE(policy_value->GetAsList(&policy));
188 188
189 managed_config_handler_->SetPolicy( 189 managed_config_handler_->SetPolicy(
190 onc::ONC_SOURCE_USER_POLICY, kUserHash, *policy); 190 onc::ONC_SOURCE_USER_POLICY,
191 kUserHash,
192 *policy,
193 base::DictionaryValue() /* no global network config */);
bartfab (slow) 2013/10/16 12:40:31 Nit: #include "base/values.h"
pneubeck (no reviews) 2013/10/17 10:22:26 Done.
191 } 194 }
192 195
193 void GetClientCertProperties(std::string* pkcs11_id) { 196 void GetClientCertProperties(std::string* pkcs11_id) {
194 pkcs11_id->clear(); 197 pkcs11_id->clear();
195 const base::DictionaryValue* properties = 198 const base::DictionaryValue* properties =
196 service_test_->GetServiceProperties(kWifiStub); 199 service_test_->GetServiceProperties(kWifiStub);
197 if (!properties) 200 if (!properties)
198 return; 201 return;
199 properties->GetStringWithoutPathExpansion(shill::kEapCertIdProperty, 202 properties->GetStringWithoutPathExpansion(shill::kEapCertIdProperty,
200 pkcs11_id); 203 pkcs11_id);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 message_loop_.RunUntilIdle(); 275 message_loop_.RunUntilIdle();
273 276
274 // Verify that the resolver positively matched the pattern in the policy with 277 // Verify that the resolver positively matched the pattern in the policy with
275 // the test client cert and configured the network. 278 // the test client cert and configured the network.
276 std::string pkcs11_id; 279 std::string pkcs11_id;
277 GetClientCertProperties(&pkcs11_id); 280 GetClientCertProperties(&pkcs11_id);
278 EXPECT_EQ(test_pkcs11_id_, pkcs11_id); 281 EXPECT_EQ(test_pkcs11_id_, pkcs11_id);
279 } 282 }
280 283
281 } // namespace chromeos 284 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698