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

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

Issue 16998003: Update CrOS to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | « chromeos/dbus/shill_service_client_unittest.cc ('k') | chromeos/process_proxy/process_proxy.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chromeos/network/onc/onc_certificate_importer.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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 // Sort the result so that test comparisons can be deterministic. 134 // Sort the result so that test comparisons can be deterministic.
135 std::sort(result.begin(), result.end(), net::X509Certificate::LessThan()); 135 std::sort(result.begin(), result.end(), net::X509Certificate::LessThan());
136 return result; 136 return result;
137 } 137 }
138 138
139 bool CleanupSlotContents() { 139 bool CleanupSlotContents() {
140 bool ok = true; 140 bool ok = true;
141 net::CertificateList certs = ListCertsInSlot(); 141 net::CertificateList certs = ListCertsInSlot();
142 for (size_t i = 0; i < certs.size(); ++i) { 142 for (size_t i = 0; i < certs.size(); ++i) {
143 if (!net::NSSCertDatabase::GetInstance()->DeleteCertAndKey(certs[i])) 143 if (!net::NSSCertDatabase::GetInstance()->DeleteCertAndKey(certs[i]
144 .get()))
144 ok = false; 145 ok = false;
145 } 146 }
146 return ok; 147 return ok;
147 } 148 }
148 149
149 crypto::ScopedTestNSSDB test_nssdb_; 150 crypto::ScopedTestNSSDB test_nssdb_;
150 }; 151 };
151 152
152 TEST_F(ONCCertificateImporterTest, MultipleCertificates) { 153 TEST_F(ONCCertificateImporterTest, MultipleCertificates) {
153 AddCertificatesFromFile("managed_toplevel2.onc", 154 AddCertificatesFromFile("managed_toplevel2.onc",
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 "certificate-client-update.onc"), 307 "certificate-client-update.onc"),
307 CertParam(net::SERVER_CERT, 308 CertParam(net::SERVER_CERT,
308 "certificate-server.onc", 309 "certificate-server.onc",
309 "certificate-server-update.onc"), 310 "certificate-server-update.onc"),
310 CertParam(net::CA_CERT, 311 CertParam(net::CA_CERT,
311 "certificate-web-authority.onc", 312 "certificate-web-authority.onc",
312 "certificate-web-authority-update.onc"))); 313 "certificate-web-authority-update.onc")));
313 314
314 } // namespace onc 315 } // namespace onc
315 } // namespace chromeos 316 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_service_client_unittest.cc ('k') | chromeos/process_proxy/process_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698