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

Side by Side Diff: chromeos/network/onc/onc_certificate_importer_impl_unittest.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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
« no previous file with comments | « chrome/test/webdriver/webdriver_session.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chromeos/network/onc/onc_certificate_importer_impl.h" 5 #include "chromeos/network/onc/onc_certificate_importer_impl.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 EXPECT_TRUE(CleanupSlotContents()); 73 EXPECT_TRUE(CleanupSlotContents());
74 EXPECT_EQ(0ul, ListCertsInSlot().size()); 74 EXPECT_EQ(0ul, ListCertsInSlot().size());
75 } 75 }
76 76
77 virtual ~ONCCertificateImporterImplTest() {} 77 virtual ~ONCCertificateImporterImplTest() {}
78 78
79 protected: 79 protected:
80 void AddCertificatesFromFile(std::string filename, bool expected_success) { 80 void AddCertificatesFromFile(std::string filename, bool expected_success) {
81 scoped_ptr<base::DictionaryValue> onc = 81 scoped_ptr<base::DictionaryValue> onc =
82 test_utils::ReadTestDictionary(filename); 82 test_utils::ReadTestDictionary(filename);
83 base::Value* certificates_value = NULL; 83 scoped_ptr<base::Value> certificates_value;
84 base::ListValue* certificates = NULL; 84 base::ListValue* certificates = NULL;
85 onc->RemoveWithoutPathExpansion(toplevel_config::kCertificates, 85 onc->RemoveWithoutPathExpansion(toplevel_config::kCertificates,
86 &certificates_value); 86 &certificates_value);
87 certificates_value->GetAsList(&certificates); 87 certificates_value.release()->GetAsList(&certificates);
88 onc_certificates_.reset(certificates); 88 onc_certificates_.reset(certificates);
89 89
90 web_trust_certificates_.clear(); 90 web_trust_certificates_.clear();
91 imported_server_and_ca_certs_.clear(); 91 imported_server_and_ca_certs_.clear();
92 CertificateImporterImpl importer; 92 CertificateImporterImpl importer;
93 EXPECT_EQ( 93 EXPECT_EQ(
94 expected_success, 94 expected_success,
95 importer.ParseAndStoreCertificates(true, // allow web trust 95 importer.ParseAndStoreCertificates(true, // allow web trust
96 *certificates, 96 *certificates,
97 &web_trust_certificates_, 97 &web_trust_certificates_,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 "certificate-client-update.onc"), 312 "certificate-client-update.onc"),
313 CertParam(net::SERVER_CERT, 313 CertParam(net::SERVER_CERT,
314 "certificate-server.onc", 314 "certificate-server.onc",
315 "certificate-server-update.onc"), 315 "certificate-server-update.onc"),
316 CertParam(net::CA_CERT, 316 CertParam(net::CA_CERT,
317 "certificate-web-authority.onc", 317 "certificate-web-authority.onc",
318 "certificate-web-authority-update.onc"))); 318 "certificate-web-authority-update.onc")));
319 319
320 } // namespace onc 320 } // namespace onc
321 } // namespace chromeos 321 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/test/webdriver/webdriver_session.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698