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

Side by Side Diff: net/test/test_server_win.cc

Issue 4646001: Implement LoadTemporaryRoot for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/net/base
Patch Set: Feedback from phajdan.jr and bulach Created 10 years, 1 month 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
« net/test/test_server.cc ('K') | « net/test/test_server_posix.cc ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "net/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wincrypt.h> 8 #include <wincrypt.h>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 child_read_fd_.Close(); 165 child_read_fd_.Close();
166 child_write_fd_.Close(); 166 child_write_fd_.Close();
167 167
168 // If we hit the timeout, fail. 168 // If we hit the timeout, fail.
169 if (unblocked) 169 if (unblocked)
170 return false; 170 return false;
171 171
172 return result && bytes_read > 0; 172 return result && bytes_read > 0;
173 } 173 }
174 174
175 bool TestServer::CheckCATrusted() {
176 HCERTSTORE cert_store = CertOpenSystemStore(NULL, L"ROOT");
177 if (!cert_store) {
178 LOG(ERROR) << " could not open trusted root CA store";
179 return false;
180 }
181 PCCERT_CONTEXT cert =
182 CertFindCertificateInStore(cert_store,
183 X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
184 0,
185 CERT_FIND_ISSUER_STR,
186 L"Test CA",
187 NULL);
188 if (cert)
189 CertFreeCertificateContext(cert);
190 CertCloseStore(cert_store, 0);
191
192 if (!cert) {
193 LOG(ERROR) << " TEST CONFIGURATION ERROR: you need to import the test ca "
194 "certificate to your trusted roots for this test to work. "
195 "For more info visit:\n"
196 "http://dev.chromium.org/developers/testing\n";
197 return false;
198 }
199
200 return true;
201 }
202
203 } // namespace net 175 } // namespace net
OLDNEW
« net/test/test_server.cc ('K') | « net/test/test_server_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698