| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/common/url_fetcher.h" | 9 #include "content/common/url_fetcher.h" |
| 10 #include "crypto/nss_util.h" | 10 #include "crypto/nss_util.h" |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 void URLFetcherBadHTTPSTest::OnURLFetchComplete( | 552 void URLFetcherBadHTTPSTest::OnURLFetchComplete( |
| 553 const URLFetcher* source, | 553 const URLFetcher* source, |
| 554 const GURL& url, | 554 const GURL& url, |
| 555 const net::URLRequestStatus& status, | 555 const net::URLRequestStatus& status, |
| 556 int response_code, | 556 int response_code, |
| 557 const net::ResponseCookies& cookies, | 557 const net::ResponseCookies& cookies, |
| 558 const std::string& data) { | 558 const std::string& data) { |
| 559 // This part is different from URLFetcherTest::OnURLFetchComplete | 559 // This part is different from URLFetcherTest::OnURLFetchComplete |
| 560 // because this test expects the request to be cancelled. | 560 // because this test expects the request to be cancelled. |
| 561 EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); | 561 EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); |
| 562 EXPECT_EQ(net::ERR_ABORTED, status.os_error()); | 562 EXPECT_EQ(net::ERR_ABORTED, status.error()); |
| 563 EXPECT_EQ(-1, response_code); | 563 EXPECT_EQ(-1, response_code); |
| 564 EXPECT_TRUE(cookies.empty()); | 564 EXPECT_TRUE(cookies.empty()); |
| 565 EXPECT_TRUE(data.empty()); | 565 EXPECT_TRUE(data.empty()); |
| 566 | 566 |
| 567 // The rest is the same as URLFetcherTest::OnURLFetchComplete. | 567 // The rest is the same as URLFetcherTest::OnURLFetchComplete. |
| 568 delete fetcher_; | 568 delete fetcher_; |
| 569 io_message_loop_proxy()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 569 io_message_loop_proxy()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void URLFetcherCancelTest::CreateFetcher(const GURL& url) { | 572 void URLFetcherCancelTest::CreateFetcher(const GURL& url) { |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 FROM_HERE, | 897 FROM_HERE, |
| 898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); | 898 new CurriedTask(new MessageLoop::QuitTask(), MessageLoop::current())); |
| 899 MessageLoop::current()->Run(); | 899 MessageLoop::current()->Run(); |
| 900 EXPECT_EQ(1, GetNumFetcherCores()); | 900 EXPECT_EQ(1, GetNumFetcherCores()); |
| 901 URLFetcher::CancelAll(); | 901 URLFetcher::CancelAll(); |
| 902 EXPECT_EQ(0, GetNumFetcherCores()); | 902 EXPECT_EQ(0, GetNumFetcherCores()); |
| 903 delete fetcher_; | 903 delete fetcher_; |
| 904 } | 904 } |
| 905 | 905 |
| 906 } // namespace. | 906 } // namespace. |
| OLD | NEW |