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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE; | 105 options.flags = MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE; |
106 options.element_num_bytes = 1; | 106 options.element_num_bytes = 1; |
107 options.capacity_num_bytes = 1024; | 107 options.capacity_num_bytes = 1024; |
108 return options; | 108 return options; |
109 } | 109 } |
110 | 110 |
111 // Returns the request id. | 111 // Returns the request id. |
112 int SetUpRequestPeer(const RequestInfo& request_info, | 112 int SetUpRequestPeer(const RequestInfo& request_info, |
113 TestRequestPeer::Context* context) { | 113 TestRequestPeer::Context* context) { |
114 return dispatcher_->StartAsync( | 114 return dispatcher_->StartAsync( |
115 request_info, nullptr, base::WrapUnique(new TestRequestPeer(context)), | 115 request_info, nullptr, base::MakeUnique<TestRequestPeer>(context), |
116 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); | 116 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); |
117 } | 117 } |
118 | 118 |
119 void Run(TestRequestPeer::Context* context) { | 119 void Run(TestRequestPeer::Context* context) { |
120 base::RunLoop run_loop; | 120 base::RunLoop run_loop; |
121 context->run_loop_quit_closure = run_loop.QuitClosure(); | 121 context->run_loop_quit_closure = run_loop.QuitClosure(); |
122 run_loop.Run(); | 122 run_loop.Run(); |
123 } | 123 } |
124 | 124 |
125 base::MessageLoop message_loop_; | 125 base::MessageLoop message_loop_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 Run(&context); | 202 Run(&context); |
203 | 203 |
204 EXPECT_TRUE(context.complete); | 204 EXPECT_TRUE(context.complete); |
205 EXPECT_EQ(net::ERR_FAILED, context.error_code); | 205 EXPECT_EQ(net::ERR_FAILED, context.error_code); |
206 EXPECT_EQ("", context.data); | 206 EXPECT_EQ("", context.data); |
207 } | 207 } |
208 | 208 |
209 } // namespace | 209 } // namespace |
210 | 210 |
211 } // namespace content | 211 } // namespace content |
OLD | NEW |