OLD | NEW |
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 "base/message_loop_proxy.h" | 5 #include "base/message_loop_proxy.h" |
6 #include "base/thread.h" | 6 #include "base/thread.h" |
7 #include "base/waitable_event.h" | 7 #include "base/waitable_event.h" |
8 #include "chrome/common/chrome_plugin_lib.h" | 8 #include "chrome/common/chrome_plugin_lib.h" |
9 #include "chrome/common/net/url_fetcher.h" | 9 #include "chrome/common/net/url_fetcher.h" |
10 #include "chrome/common/net/url_fetcher_protect.h" | 10 #include "chrome/common/net/url_fetcher_protect.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 new URLFetcherProtectEntry(200, 3, 11, 100, 2.0, 0, 150000); | 533 new URLFetcherProtectEntry(200, 3, 11, 100, 2.0, 0, 150000); |
534 manager->Register(url.host(), entry); | 534 manager->Register(url.host(), entry); |
535 | 535 |
536 CreateFetcher(url); | 536 CreateFetcher(url); |
537 | 537 |
538 MessageLoop::current()->Run(); | 538 MessageLoop::current()->Run(); |
539 } | 539 } |
540 | 540 |
541 | 541 |
542 TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { | 542 TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { |
543 net::TestServer test_server(net::TestServer::TYPE_HTTPS_EXPIRED_CERTIFICATE, | 543 net::TestServer::HTTPSOptions https_options( |
544 FilePath(kDocRoot)); | 544 net::TestServer::HTTPSOptions::CERT_EXPIRED); |
| 545 net::TestServer test_server(https_options, FilePath(kDocRoot)); |
545 ASSERT_TRUE(test_server.Start()); | 546 ASSERT_TRUE(test_server.Start()); |
546 | 547 |
547 CreateFetcher(test_server.GetURL("defaultresponse")); | 548 CreateFetcher(test_server.GetURL("defaultresponse")); |
548 MessageLoop::current()->Run(); | 549 MessageLoop::current()->Run(); |
549 } | 550 } |
550 | 551 |
551 TEST_F(URLFetcherCancelTest, ReleasesContext) { | 552 TEST_F(URLFetcherCancelTest, ReleasesContext) { |
552 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); | 553 net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); |
553 ASSERT_TRUE(test_server.Start()); | 554 ASSERT_TRUE(test_server.Start()); |
554 | 555 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 // time difference from now). | 605 // time difference from now). |
605 | 606 |
606 base::Thread t("URLFetcher test thread"); | 607 base::Thread t("URLFetcher test thread"); |
607 ASSERT_TRUE(t.Start()); | 608 ASSERT_TRUE(t.Start()); |
608 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); | 609 t.message_loop()->PostTask(FROM_HERE, new FetcherWrapperTask(this, url)); |
609 | 610 |
610 MessageLoop::current()->Run(); | 611 MessageLoop::current()->Run(); |
611 } | 612 } |
612 | 613 |
613 } // namespace. | 614 } // namespace. |
OLD | NEW |