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

Side by Side Diff: chrome/browser/chromeos/cros/onc_network_parser_unittest.cc

Issue 10916094: Move the NSS functions out of CertDatabase into a new NSSCertDatabase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 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 | Annotate | Revision Log
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 "chrome/browser/chromeos/cros/onc_network_parser.h" 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/chromeos/cros/network_library.h" 21 #include "chrome/browser/chromeos/cros/network_library.h"
22 #include "chrome/browser/chromeos/login/mock_user_manager.h" 22 #include "chrome/browser/chromeos/login/mock_user_manager.h"
23 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" 23 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
24 #include "chrome/common/chrome_paths.h" 24 #include "chrome/common/chrome_paths.h"
25 #include "chrome/common/net/x509_certificate_model.h" 25 #include "chrome/common/net/x509_certificate_model.h"
26 #include "chrome/test/base/testing_browser_process.h" 26 #include "chrome/test/base/testing_browser_process.h"
27 #include "chrome/test/base/testing_pref_service.h" 27 #include "chrome/test/base/testing_pref_service.h"
28 #include "chromeos/dbus/dbus_thread_manager.h" 28 #include "chromeos/dbus/dbus_thread_manager.h"
29 #include "content/public/test/test_browser_thread.h" 29 #include "content/public/test/test_browser_thread.h"
30 #include "crypto/nss_util.h" 30 #include "crypto/nss_util.h"
31 #include "net/base/cert_database.h"
32 #include "net/base/cert_type.h" 31 #include "net/base/cert_type.h"
33 #include "net/base/crypto_module.h" 32 #include "net/base/crypto_module.h"
33 #include "net/base/nss_cert_database.h"
34 #include "net/base/x509_certificate.h" 34 #include "net/base/x509_certificate.h"
35 #include "net/proxy/proxy_config.h" 35 #include "net/proxy/proxy_config.h"
36 #include "testing/gtest/include/gtest/gtest.h" 36 #include "testing/gtest/include/gtest/gtest.h"
37 #include "third_party/cros_system_api/dbus/service_constants.h" 37 #include "third_party/cros_system_api/dbus/service_constants.h"
38 38
39 using ::testing::AnyNumber; 39 using ::testing::AnyNumber;
40 using ::testing::Return; 40 using ::testing::Return;
41 41
42 namespace chromeos { 42 namespace chromeos {
43 43
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 const char* expected); 101 const char* expected);
102 void CheckBooleanProperty(const Network* network, 102 void CheckBooleanProperty(const Network* network,
103 PropertyIndex index, 103 PropertyIndex index,
104 bool expected); 104 bool expected);
105 105
106 void TestProxySettings(const std::string proxy_settings_blob, 106 void TestProxySettings(const std::string proxy_settings_blob,
107 net::ProxyConfig* net_config); 107 net::ProxyConfig* net_config);
108 108
109 protected: 109 protected:
110 scoped_refptr<net::CryptoModule> slot_; 110 scoped_refptr<net::CryptoModule> slot_;
111 net::CertDatabase cert_db_; 111 net::NSSCertDatabase cert_db_;
112 112
113 private: 113 private:
114 net::CertificateList ListCertsInSlot(PK11SlotInfo* slot) { 114 net::CertificateList ListCertsInSlot(PK11SlotInfo* slot) {
115 net::CertificateList result; 115 net::CertificateList result;
116 CERTCertList* cert_list = PK11_ListCertsInSlot(slot); 116 CERTCertList* cert_list = PK11_ListCertsInSlot(slot);
117 for (CERTCertListNode* node = CERT_LIST_HEAD(cert_list); 117 for (CERTCertListNode* node = CERT_LIST_HEAD(cert_list);
118 !CERT_LIST_END(node, cert_list); 118 !CERT_LIST_END(node, cert_list);
119 node = CERT_LIST_NEXT(node)) { 119 node = CERT_LIST_NEXT(node)) {
120 result.push_back(net::X509Certificate::CreateFromHandle( 120 result.push_back(net::X509Certificate::CreateFromHandle(
121 node->cert, net::X509Certificate::OSCertHandles())); 121 node->cert, net::X509Certificate::OSCertHandles()));
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 EXPECT_EQ(1, parser.GetNetworkConfigsSize()); 948 EXPECT_EQ(1, parser.GetNetworkConfigsSize());
949 EXPECT_EQ(0, parser.GetCertificatesSize()); 949 EXPECT_EQ(0, parser.GetCertificatesSize());
950 bool marked_for_removal = false; 950 bool marked_for_removal = false;
951 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal)); 951 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal));
952 952
953 EXPECT_TRUE(marked_for_removal); 953 EXPECT_TRUE(marked_for_removal);
954 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id()); 954 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id());
955 } 955 }
956 956
957 } // namespace chromeos 957 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698