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

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

Issue 1328233002: Ramove use of JSONReader::DeprecatedRead from chromeos/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ignore_result's Created 5 years, 3 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
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/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 " \"ClientCertPattern\": {" 189 " \"ClientCertPattern\": {"
190 " \"IssuerCAPEMs\": [ \"%s\" ]" 190 " \"IssuerCAPEMs\": [ \"%s\" ]"
191 " }" 191 " }"
192 " }" 192 " }"
193 " }" 193 " }"
194 "} ]"; 194 "} ]";
195 std::string policy_json = 195 std::string policy_json =
196 base::StringPrintf(kTestPolicyTemplate, test_ca_cert_pem_.c_str()); 196 base::StringPrintf(kTestPolicyTemplate, test_ca_cert_pem_.c_str());
197 197
198 std::string error; 198 std::string error;
199 scoped_ptr<base::Value> policy_value( 199 scoped_ptr<base::Value> policy_value = base::JSONReader::ReadAndReturnError(
200 base::JSONReader::DeprecatedReadAndReturnError( 200 policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error);
201 policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error));
202 ASSERT_TRUE(policy_value) << error; 201 ASSERT_TRUE(policy_value) << error;
203 202
204 base::ListValue* policy = NULL; 203 base::ListValue* policy = NULL;
205 ASSERT_TRUE(policy_value->GetAsList(&policy)); 204 ASSERT_TRUE(policy_value->GetAsList(&policy));
206 205
207 managed_config_handler_->SetPolicy( 206 managed_config_handler_->SetPolicy(
208 onc::ONC_SOURCE_USER_POLICY, 207 onc::ONC_SOURCE_USER_POLICY,
209 kUserHash, 208 kUserHash,
210 *policy, 209 *policy,
211 base::DictionaryValue() /* no global network config */); 210 base::DictionaryValue() /* no global network config */);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 300
302 // Verify that the resolver positively matched the pattern in the policy with 301 // Verify that the resolver positively matched the pattern in the policy with
303 // the test client cert and configured the network. 302 // the test client cert and configured the network.
304 std::string pkcs11_id; 303 std::string pkcs11_id;
305 GetClientCertProperties(&pkcs11_id); 304 GetClientCertProperties(&pkcs11_id);
306 EXPECT_EQ(test_cert_id_, pkcs11_id); 305 EXPECT_EQ(test_cert_id_, pkcs11_id);
307 EXPECT_EQ(1, network_properties_changed_count_); 306 EXPECT_EQ(1, network_properties_changed_count_);
308 } 307 }
309 308
310 } // namespace chromeos 309 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/auto_connect_handler_unittest.cc ('k') | chromeos/network/network_connection_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698