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

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

Issue 11962048: This adds Cellular to the Shill to ONC translation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing broken unit test Created 7 years, 11 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/network/onc/onc_certificate_importer.cc ('k') | chromeos/network/onc/onc_constants.h » ('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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 virtual ~ONCCertificateImporterTest() {} 77 virtual ~ONCCertificateImporterTest() {}
78 78
79 protected: 79 protected:
80 void AddCertificateFromFile(std::string filename, 80 void AddCertificateFromFile(std::string filename,
81 net::CertType expected_type, 81 net::CertType expected_type,
82 std::string* guid) { 82 std::string* guid) {
83 scoped_ptr<base::DictionaryValue> onc = 83 scoped_ptr<base::DictionaryValue> onc =
84 test_utils::ReadTestDictionary(filename); 84 test_utils::ReadTestDictionary(filename);
85 base::ListValue* certificates; 85 base::ListValue* certificates;
86 onc->GetListWithoutPathExpansion(kCertificates, &certificates); 86 onc->GetListWithoutPathExpansion(toplevel_config::kCertificates,
87 &certificates);
87 88
88 base::DictionaryValue* certificate; 89 base::DictionaryValue* certificate;
89 certificates->GetDictionary(0, &certificate); 90 certificates->GetDictionary(0, &certificate);
90 certificate->GetStringWithoutPathExpansion(kGUID, guid); 91 certificate->GetStringWithoutPathExpansion(certificate::kGUID, guid);
91 92
92 CertificateImporter importer(ONC_SOURCE_USER_IMPORT, 93 CertificateImporter importer(ONC_SOURCE_USER_IMPORT,
93 false /* don't allow web trust */); 94 false /* don't allow web trust */);
94 EXPECT_EQ(CertificateImporter::IMPORT_OK, 95 EXPECT_EQ(CertificateImporter::IMPORT_OK,
95 importer.ParseAndStoreCertificates(*certificates)); 96 importer.ParseAndStoreCertificates(*certificates));
96 97
97 net::CertificateList result_list; 98 net::CertificateList result_list;
98 CertificateImporter::ListCertsWithNickname(*guid, &result_list); 99 CertificateImporter::ListCertsWithNickname(*guid, &result_list);
99 ASSERT_EQ(1ul, result_list.size()); 100 ASSERT_EQ(1ul, result_list.size());
100 EXPECT_EQ(expected_type, GetCertType(result_list[0]->os_cert_handle())); 101 EXPECT_EQ(expected_type, GetCertType(result_list[0]->os_cert_handle()));
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 std::make_pair(net::SERVER_CERT, 253 std::make_pair(net::SERVER_CERT,
253 std::make_pair("certificate-server.onc", 254 std::make_pair("certificate-server.onc",
254 "certificate-server-update.onc")), 255 "certificate-server-update.onc")),
255 std::make_pair( 256 std::make_pair(
256 net::CA_CERT, 257 net::CA_CERT,
257 std::make_pair("certificate-web-authority.onc", 258 std::make_pair("certificate-web-authority.onc",
258 "certificate-web-authority-update.onc")))); 259 "certificate-web-authority-update.onc"))));
259 260
260 } // namespace onc 261 } // namespace onc
261 } // namespace chromeos 262 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_certificate_importer.cc ('k') | chromeos/network/onc/onc_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698