| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/child/url_response_body_consumer.h" | 5 #include "content/child/url_response_body_consumer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 options.capacity_num_bytes = 1024; | 120 options.capacity_num_bytes = 1024; |
| 121 return options; | 121 return options; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Returns the request id. | 124 // Returns the request id. |
| 125 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request, | 125 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request, |
| 126 TestRequestPeer::Context* context) { | 126 TestRequestPeer::Context* context) { |
| 127 return dispatcher_->StartAsync( | 127 return dispatcher_->StartAsync( |
| 128 std::move(request), 0, nullptr, GURL(), | 128 std::move(request), 0, nullptr, GURL(), |
| 129 base::MakeUnique<TestRequestPeer>(context), | 129 base::MakeUnique<TestRequestPeer>(context), |
| 130 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); | 130 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr, nullptr); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void Run(TestRequestPeer::Context* context) { | 133 void Run(TestRequestPeer::Context* context) { |
| 134 base::RunLoop run_loop; | 134 base::RunLoop run_loop; |
| 135 context->run_loop_quit_closure = run_loop.QuitClosure(); | 135 context->run_loop_quit_closure = run_loop.QuitClosure(); |
| 136 run_loop.Run(); | 136 run_loop.Run(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 base::MessageLoop message_loop_; | 139 base::MessageLoop message_loop_; |
| 140 std::unique_ptr<ResourceDispatcher> dispatcher_; | 140 std::unique_ptr<ResourceDispatcher> dispatcher_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 Run(&context); | 219 Run(&context); |
| 220 | 220 |
| 221 EXPECT_TRUE(context.complete); | 221 EXPECT_TRUE(context.complete); |
| 222 EXPECT_EQ(net::ERR_FAILED, context.error_code); | 222 EXPECT_EQ(net::ERR_FAILED, context.error_code); |
| 223 EXPECT_EQ("", context.data); | 223 EXPECT_EQ("", context.data); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| 227 | 227 |
| 228 } // namespace content | 228 } // namespace content |
| OLD | NEW |