OLD | NEW |
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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 class HTTPSTestServer : public HTTPTestServer { | 413 class HTTPSTestServer : public HTTPTestServer { |
414 protected: | 414 protected: |
415 explicit HTTPSTestServer() { | 415 explicit HTTPSTestServer() { |
416 } | 416 } |
417 | 417 |
418 public: | 418 public: |
419 // Create a server with a valid certificate | 419 // Create a server with a valid certificate |
420 // TODO(dkegel): HTTPSTestServer should not require an instance to specify | 420 // TODO(dkegel): HTTPSTestServer should not require an instance to specify |
421 // stock test certificates | 421 // stock test certificates |
422 static scoped_refptr<HTTPSTestServer> CreateGoodServer(const std::wstring& doc
ument_root) { | 422 static scoped_refptr<HTTPSTestServer> CreateGoodServer( |
| 423 const std::wstring& document_root) { |
423 scoped_refptr<HTTPSTestServer> test_server = new HTTPSTestServer(); | 424 scoped_refptr<HTTPSTestServer> test_server = new HTTPSTestServer(); |
424 FilePath docroot = FilePath::FromWStringHack(document_root); | 425 FilePath docroot = FilePath::FromWStringHack(document_root); |
425 FilePath certpath = test_server->launcher_.GetOKCertPath(); | 426 FilePath certpath = test_server->launcher_.GetOKCertPath(); |
426 if (!test_server->Start(net::TestServerLauncher::ProtoHTTP, | 427 if (!test_server->Start(net::TestServerLauncher::ProtoHTTP, |
427 net::TestServerLauncher::kHostName, | 428 net::TestServerLauncher::kHostName, |
428 net::TestServerLauncher::kOKHTTPSPort, | 429 net::TestServerLauncher::kOKHTTPSPort, |
429 docroot, certpath)) { | 430 docroot, certpath)) { |
430 return NULL; | 431 return NULL; |
431 } | 432 } |
432 return test_server; | 433 return test_server; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 MessageLoop::current()->Run(); | 525 MessageLoop::current()->Run(); |
525 if (request.is_pending()) | 526 if (request.is_pending()) |
526 return false; | 527 return false; |
527 | 528 |
528 return true; | 529 return true; |
529 } | 530 } |
530 | 531 |
531 }; | 532 }; |
532 | 533 |
533 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 534 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
OLD | NEW |