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

Side by Side Diff: net/cert/nss_cert_database_unittest.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « net/base/net_log_logger_unittest.cc ('k') | net/cert/test_root_certs.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 <cert.h> 5 #include <cert.h>
6 #include <certdb.h> 6 #include <certdb.h>
7 #include <pk11pub.h> 7 #include <pk11pub.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // NSSCertDatabase::NotifyObservers* get released. 61 // NSSCertDatabase::NotifyObservers* get released.
62 base::MessageLoop::current()->RunUntilIdle(); 62 base::MessageLoop::current()->RunUntilIdle();
63 63
64 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size()); 64 EXPECT_EQ(0U, ListCertsInSlot(slot_->os_module_handle()).size());
65 } 65 }
66 66
67 protected: 67 protected:
68 static std::string ReadTestFile(const std::string& name) { 68 static std::string ReadTestFile(const std::string& name) {
69 std::string result; 69 std::string result;
70 base::FilePath cert_path = GetTestCertsDirectory().AppendASCII(name); 70 base::FilePath cert_path = GetTestCertsDirectory().AppendASCII(name);
71 EXPECT_TRUE(file_util::ReadFileToString(cert_path, &result)); 71 EXPECT_TRUE(base::ReadFileToString(cert_path, &result));
72 return result; 72 return result;
73 } 73 }
74 74
75 static bool ReadCertIntoList(const std::string& name, 75 static bool ReadCertIntoList(const std::string& name,
76 CertificateList* certs) { 76 CertificateList* certs) {
77 scoped_refptr<X509Certificate> cert( 77 scoped_refptr<X509Certificate> cert(
78 ImportCertFromFile(GetTestCertsDirectory(), name)); 78 ImportCertFromFile(GetTestCertsDirectory(), name));
79 if (!cert.get()) 79 if (!cert.get())
80 return false; 80 return false;
81 81
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT, 1033 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT,
1034 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT)); 1034 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT));
1035 1035
1036 new_certs = ListCertsInSlot(slot_->os_module_handle()); 1036 new_certs = ListCertsInSlot(slot_->os_module_handle());
1037 ASSERT_EQ(2U, new_certs.size()); 1037 ASSERT_EQ(2U, new_certs.size());
1038 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname, 1038 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname,
1039 new_certs[1]->os_cert_handle()->nickname); 1039 new_certs[1]->os_cert_handle()->nickname);
1040 } 1040 }
1041 1041
1042 } // namespace net 1042 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log_logger_unittest.cc ('k') | net/cert/test_root_certs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698