| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 216   Run(&context); | 216   Run(&context); | 
| 217 | 217 | 
| 218   EXPECT_TRUE(context.complete); | 218   EXPECT_TRUE(context.complete); | 
| 219   EXPECT_EQ(net::ERR_FAILED, context.error_code); | 219   EXPECT_EQ(net::ERR_FAILED, context.error_code); | 
| 220   EXPECT_EQ("", context.data); | 220   EXPECT_EQ("", context.data); | 
| 221 } | 221 } | 
| 222 | 222 | 
| 223 }  // namespace | 223 }  // namespace | 
| 224 | 224 | 
| 225 }  // namespace content | 225 }  // namespace content | 
| OLD | NEW | 
|---|