Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: content/child/url_loader_client_impl_unittest.cc

Issue 2900563002: Network service: Safe browsing check for sub-resources from renderer. (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(), mojo::ScopedDataPipeConsumerHandle()); 36 url_loader_factory_proxy_.get(),
37 std::vector<std::unique_ptr<URLLoaderThrottle>>(),
38 mojo::ScopedDataPipeConsumerHandle());
37 request_peer_context_.request_id = request_id_; 39 request_peer_context_.request_id = request_id_;
38 40
39 base::RunLoop().RunUntilIdle(); 41 base::RunLoop().RunUntilIdle();
40 EXPECT_TRUE(url_loader_client_); 42 EXPECT_TRUE(url_loader_client_);
41 } 43 }
42 44
43 void TearDown() override { 45 void TearDown() override {
44 url_loader_client_ = nullptr; 46 url_loader_client_ = nullptr;
45 url_loader_factory_proxy_ = nullptr; 47 url_loader_factory_proxy_ = nullptr;
46 } 48 }
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 520
519 dispatcher_->SetDefersLoading(request_id_, false); 521 dispatcher_->SetDefersLoading(request_id_, false);
520 base::RunLoop().RunUntilIdle(); 522 base::RunLoop().RunUntilIdle();
521 EXPECT_TRUE(request_peer_context_.received_response); 523 EXPECT_TRUE(request_peer_context_.received_response);
522 EXPECT_TRUE(request_peer_context_.complete); 524 EXPECT_TRUE(request_peer_context_.complete);
523 EXPECT_EQ(4, request_peer_context_.total_encoded_data_length); 525 EXPECT_EQ(4, request_peer_context_.total_encoded_data_length);
524 EXPECT_FALSE(request_peer_context_.cancelled); 526 EXPECT_FALSE(request_peer_context_.cancelled);
525 } 527 }
526 528
527 } // namespace content 529 } // namespace content
OLDNEW
« no previous file with comments | « content/child/throttling_url_loader_unittest.cc ('k') | content/child/url_response_body_consumer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698