| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 net::TestServerLauncher::kOKHTTPSPort, | 470 net::TestServerLauncher::kOKHTTPSPort, |
| 471 docroot, certpath, std::wstring())) { | 471 docroot, certpath, std::wstring())) { |
| 472 return NULL; | 472 return NULL; |
| 473 } | 473 } |
| 474 return test_server; | 474 return test_server; |
| 475 } | 475 } |
| 476 | 476 |
| 477 // Create a server with an expired certificate | 477 // Create a server with an expired certificate |
| 478 static scoped_refptr<HTTPSTestServer> CreateExpiredServer( | 478 static scoped_refptr<HTTPSTestServer> CreateExpiredServer( |
| 479 const std::wstring& document_root) { | 479 const std::wstring& document_root) { |
| 480 HTTPSTestServer* test_server = new HTTPSTestServer(); | 480 scoped_refptr<HTTPSTestServer> test_server = new HTTPSTestServer(); |
| 481 FilePath docroot = FilePath::FromWStringHack(document_root); | 481 FilePath docroot = FilePath::FromWStringHack(document_root); |
| 482 FilePath certpath = test_server->launcher_.GetExpiredCertPath(); | 482 FilePath certpath = test_server->launcher_.GetExpiredCertPath(); |
| 483 if (!test_server->Start(net::TestServerLauncher::ProtoHTTP, | 483 if (!test_server->Start(net::TestServerLauncher::ProtoHTTP, |
| 484 net::TestServerLauncher::kHostName, | 484 net::TestServerLauncher::kHostName, |
| 485 net::TestServerLauncher::kBadHTTPSPort, | 485 net::TestServerLauncher::kBadHTTPSPort, |
| 486 docroot, certpath, std::wstring())) { | 486 docroot, certpath, std::wstring())) { |
| 487 return NULL; | 487 return NULL; |
| 488 } | 488 } |
| 489 return test_server; | 489 return test_server; |
| 490 } | 490 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 MessageLoop::current()->Run(); | 550 MessageLoop::current()->Run(); |
| 551 if (request.is_pending()) | 551 if (request.is_pending()) |
| 552 return false; | 552 return false; |
| 553 | 553 |
| 554 return true; | 554 return true; |
| 555 } | 555 } |
| 556 }; | 556 }; |
| 557 | 557 |
| 558 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 558 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| OLD | NEW |