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_loader_client_impl.h" | 5 #include "content/child/url_loader_client_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 URLLoaderClientImplTest() | 26 URLLoaderClientImplTest() |
27 : dispatcher_(new ResourceDispatcher(this, message_loop_.task_runner())), | 27 : dispatcher_(new ResourceDispatcher(this, message_loop_.task_runner())), |
28 mojo_binding_(this) { | 28 mojo_binding_(this) { |
29 url_loader_factory_proxy_ = mojo_binding_.CreateInterfacePtrAndBind(); | 29 url_loader_factory_proxy_ = mojo_binding_.CreateInterfacePtrAndBind(); |
30 | 30 |
31 request_id_ = dispatcher_->StartAsync( | 31 request_id_ = dispatcher_->StartAsync( |
32 base::MakeUnique<ResourceRequest>(), 0, nullptr, url::Origin(), | 32 base::MakeUnique<ResourceRequest>(), 0, nullptr, url::Origin(), |
33 base::MakeUnique<TestRequestPeer>(dispatcher_.get(), | 33 base::MakeUnique<TestRequestPeer>(dispatcher_.get(), |
34 &request_peer_context_), | 34 &request_peer_context_), |
35 blink::WebURLRequest::LoadingIPCType::kMojo, | 35 blink::WebURLRequest::LoadingIPCType::kMojo, |
36 url_loader_factory_proxy_.get()); | 36 url_loader_factory_proxy_.get(), mojo::ScopedDataPipeConsumerHandle()); |
37 request_peer_context_.request_id = request_id_; | 37 request_peer_context_.request_id = request_id_; |
38 | 38 |
39 base::RunLoop().RunUntilIdle(); | 39 base::RunLoop().RunUntilIdle(); |
40 EXPECT_TRUE(url_loader_client_); | 40 EXPECT_TRUE(url_loader_client_); |
41 } | 41 } |
42 | 42 |
43 void TearDown() override { | 43 void TearDown() override { |
44 url_loader_client_ = nullptr; | 44 url_loader_client_ = nullptr; |
45 url_loader_factory_proxy_ = nullptr; | 45 url_loader_factory_proxy_ = nullptr; |
46 } | 46 } |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 dispatcher_->SetDefersLoading(request_id_, false); | 518 dispatcher_->SetDefersLoading(request_id_, false); |
519 base::RunLoop().RunUntilIdle(); | 519 base::RunLoop().RunUntilIdle(); |
520 EXPECT_TRUE(request_peer_context_.received_response); | 520 EXPECT_TRUE(request_peer_context_.received_response); |
521 EXPECT_TRUE(request_peer_context_.complete); | 521 EXPECT_TRUE(request_peer_context_.complete); |
522 EXPECT_EQ(4, request_peer_context_.total_encoded_data_length); | 522 EXPECT_EQ(4, request_peer_context_.total_encoded_data_length); |
523 EXPECT_FALSE(request_peer_context_.cancelled); | 523 EXPECT_FALSE(request_peer_context_.cancelled); |
524 } | 524 } |
525 | 525 |
526 } // namespace content | 526 } // namespace content |
OLD | NEW |