| OLD | NEW |
| 1 // Copyright (c) 2010 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 <stack> | 5 #include <stack> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 writer_.reset(service_->storage()->CreateResponseWriter(GURL())); | 704 writer_.reset(service_->storage()->CreateResponseWriter(GURL())); |
| 705 written_response_id_ = writer_->response_id(); | 705 written_response_id_ = writer_->response_id(); |
| 706 WriteLargeResponse(); | 706 WriteLargeResponse(); |
| 707 | 707 |
| 708 url_request_delegate_->kill_after_amount_received_ = kBlockSize; | 708 url_request_delegate_->kill_after_amount_received_ = kBlockSize; |
| 709 url_request_delegate_->kill_with_io_pending_ = false; | 709 url_request_delegate_->kill_with_io_pending_ = false; |
| 710 // Continues async | 710 // Continues async |
| 711 } | 711 } |
| 712 | 712 |
| 713 void VerifyCancel() { | 713 void VerifyCancel() { |
| 714 EXPECT_EQ(URLRequestStatus::CANCELED, | 714 EXPECT_EQ(net::URLRequestStatus::CANCELED, |
| 715 request_->status().status()); | 715 request_->status().status()); |
| 716 TestFinished(); | 716 TestFinished(); |
| 717 } | 717 } |
| 718 | 718 |
| 719 // CancelRequestWithIOPending -------------------------------------- | 719 // CancelRequestWithIOPending -------------------------------------- |
| 720 | 720 |
| 721 void CancelRequestWithIOPending() { | 721 void CancelRequestWithIOPending() { |
| 722 // This test has several async steps. | 722 // This test has several async steps. |
| 723 // 1. Write a large response to response storage. | 723 // 1. Write a large response to response storage. |
| 724 // 2. Use net::URLRequest to retrieve it. | 724 // 2. Use net::URLRequest to retrieve it. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 813 |
| 814 TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) { | 814 TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) { |
| 815 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequestWithIOPending); | 815 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequestWithIOPending); |
| 816 } | 816 } |
| 817 | 817 |
| 818 } // namespace appcache | 818 } // namespace appcache |
| 819 | 819 |
| 820 // AppCacheURLRequestJobTest is expected to always live longer than the | 820 // AppCacheURLRequestJobTest is expected to always live longer than the |
| 821 // runnable methods. This lets us call NewRunnableMethod on its instances. | 821 // runnable methods. This lets us call NewRunnableMethod on its instances. |
| 822 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheURLRequestJobTest); | 822 DISABLE_RUNNABLE_METHOD_REFCOUNT(appcache::AppCacheURLRequestJobTest); |
| OLD | NEW |