| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/browser/frame_host/navigation_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, | 109 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, |
| 110 scoped_ptr<StreamHandle> body) override { | 110 scoped_ptr<StreamHandle> body) override { |
| 111 response_ = response; | 111 response_ = response; |
| 112 body_ = body.Pass(); | 112 body_ = body.Pass(); |
| 113 ASSERT_TRUE(response_started_); | 113 ASSERT_TRUE(response_started_); |
| 114 response_started_->Quit(); | 114 response_started_->Quit(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void OnRequestFailed(int net_error) override { | 117 void OnRequestFailed(bool in_cache, int net_error) override { |
| 118 net_error_ = net_error; | 118 net_error_ = net_error; |
| 119 ASSERT_TRUE(request_failed_); | 119 ASSERT_TRUE(request_failed_); |
| 120 request_failed_->Quit(); | 120 request_failed_->Quit(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void OnRequestStarted(base::TimeTicks timestamp) override { | 123 void OnRequestStarted(base::TimeTicks timestamp) override { |
| 124 ASSERT_FALSE(timestamp.is_null()); | 124 ASSERT_FALSE(timestamp.is_null()); |
| 125 ++on_request_handled_counter_; | 125 ++on_request_handled_counter_; |
| 126 } | 126 } |
| 127 | 127 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 // Release the body. | 394 // Release the body. |
| 395 delegate.ReleaseBody(); | 395 delegate.ReleaseBody(); |
| 396 base::RunLoop().RunUntilIdle(); | 396 base::RunLoop().RunUntilIdle(); |
| 397 | 397 |
| 398 // Verify that URLRequestTestJob no longer has anything paused. | 398 // Verify that URLRequestTestJob no longer has anything paused. |
| 399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); | 399 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace content | 402 } // namespace content |
| OLD | NEW |