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

Side by Side Diff: net/base/ssl_test_util.cc

Issue 18499: Replace cases of Append(FILE_PATH_LITERAL()) with AppendASCII(""). (Closed)
Patch Set: Created 11 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
« no previous file with comments | « chrome/common/unzip_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 5 #include <string>
6 #include <algorithm> 6 #include <algorithm>
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return NULL; 73 return NULL;
74 } 74 }
75 75
76 LOG(INFO) << "Loaded temporary certificate " << filename.ToWStringHack(); 76 LOG(INFO) << "Loaded temporary certificate " << filename.ToWStringHack();
77 return cert; 77 return cert;
78 } 78 }
79 #endif 79 #endif
80 80
81 SSLTestUtil::SSLTestUtil() { 81 SSLTestUtil::SSLTestUtil() {
82 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_); 82 PathService::Get(base::DIR_SOURCE_ROOT, &cert_dir_);
83 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("net")); 83 cert_dir_ = cert_dir_.AppendASCII("net");
84 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("data")); 84 cert_dir_ = cert_dir_.AppendASCII("data");
85 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("ssl")); 85 cert_dir_ = cert_dir_.AppendASCII("ssl");
86 cert_dir_ = cert_dir_.Append(FILE_PATH_LITERAL("certificates")); 86 cert_dir_ = cert_dir_.AppendASCII("certificates");
87 87
88 #if defined(OS_LINUX) 88 #if defined(OS_LINUX)
89 cert_ = reinterpret_cast<PrivateCERTCertificate*>( 89 cert_ = reinterpret_cast<PrivateCERTCertificate*>(
90 LoadTemporaryCert(GetRootCertPath())); 90 LoadTemporaryCert(GetRootCertPath()));
91 DCHECK(cert_); 91 DCHECK(cert_);
92 #endif 92 #endif
93 } 93 }
94 94
95 SSLTestUtil::~SSLTestUtil() { 95 SSLTestUtil::~SSLTestUtil() {
96 #if defined(OS_LINUX) 96 #if defined(OS_LINUX)
97 if (cert_) 97 if (cert_)
98 CERT_DestroyCertificate(reinterpret_cast<CERTCertificate*>(cert_)); 98 CERT_DestroyCertificate(reinterpret_cast<CERTCertificate*>(cert_));
99 #endif 99 #endif
100 } 100 }
101 101
102 FilePath SSLTestUtil::GetRootCertPath() { 102 FilePath SSLTestUtil::GetRootCertPath() {
103 FilePath path(cert_dir_); 103 FilePath path(cert_dir_);
104 path = path.Append(FILE_PATH_LITERAL("root_ca_cert.crt")); 104 path = path.AppendASCII("root_ca_cert.crt");
105 return path; 105 return path;
106 } 106 }
107 107
108 FilePath SSLTestUtil::GetOKCertPath() { 108 FilePath SSLTestUtil::GetOKCertPath() {
109 FilePath path(cert_dir_); 109 FilePath path(cert_dir_);
110 path = path.Append(FILE_PATH_LITERAL("ok_cert.pem")); 110 path = path.AppendASCII("ok_cert.pem");
111 return path; 111 return path;
112 } 112 }
113 113
114 FilePath SSLTestUtil::GetExpiredCertPath() { 114 FilePath SSLTestUtil::GetExpiredCertPath() {
115 FilePath path(cert_dir_); 115 FilePath path(cert_dir_);
116 path = path.Append(FILE_PATH_LITERAL("expired_cert.pem")); 116 path = path.AppendASCII("expired_cert.pem");
117 return path; 117 return path;
118 } 118 }
119 119
120 bool SSLTestUtil::CheckCATrusted() { 120 bool SSLTestUtil::CheckCATrusted() {
121 // TODO(port): Port either this or LoadTemporaryCert to MacOSX. 121 // TODO(port): Port either this or LoadTemporaryCert to MacOSX.
122 #if defined(OS_WIN) 122 #if defined(OS_WIN)
123 HCERTSTORE cert_store = CertOpenSystemStore(NULL, L"ROOT"); 123 HCERTSTORE cert_store = CertOpenSystemStore(NULL, L"ROOT");
124 if (!cert_store) { 124 if (!cert_store) {
125 LOG(ERROR) << " could not open trusted root CA store"; 125 LOG(ERROR) << " could not open trusted root CA store";
126 return false; 126 return false;
(...skipping 12 matching lines...) Expand all
139 if (!cert) { 139 if (!cert) {
140 LOG(ERROR) << " TEST CONFIGURATION ERROR: you need to import the test ca " 140 LOG(ERROR) << " TEST CONFIGURATION ERROR: you need to import the test ca "
141 "certificate to your trusted roots for this test to work. " 141 "certificate to your trusted roots for this test to work. "
142 "For more info visit:\n" 142 "For more info visit:\n"
143 "http://dev.chromium.org/developers/testing\n"; 143 "http://dev.chromium.org/developers/testing\n";
144 return false; 144 return false;
145 } 145 }
146 #endif 146 #endif
147 return true; 147 return true;
148 } 148 }
OLDNEW
« no previous file with comments | « chrome/common/unzip_unittest.cc ('k') | net/disk_cache/disk_cache_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698