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

Side by Side Diff: content/child/url_response_body_consumer_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
« no previous file with comments | « content/child/url_loader_client_impl_unittest.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return options; 134 return options;
135 } 135 }
136 136
137 // Returns the request id. 137 // Returns the request id.
138 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request, 138 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request,
139 TestRequestPeer::Context* context) { 139 TestRequestPeer::Context* context) {
140 return dispatcher_->StartAsync( 140 return dispatcher_->StartAsync(
141 std::move(request), 0, nullptr, url::Origin(), 141 std::move(request), 0, nullptr, url::Origin(),
142 base::MakeUnique<TestRequestPeer>(context, message_loop_.task_runner()), 142 base::MakeUnique<TestRequestPeer>(context, message_loop_.task_runner()),
143 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr, 143 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr,
144 std::vector<std::unique_ptr<URLLoaderThrottle>>(),
144 mojo::ScopedDataPipeConsumerHandle()); 145 mojo::ScopedDataPipeConsumerHandle());
145 } 146 }
146 147
147 void Run(TestRequestPeer::Context* context) { 148 void Run(TestRequestPeer::Context* context) {
148 base::RunLoop run_loop; 149 base::RunLoop run_loop;
149 context->run_loop_quit_closure = run_loop.QuitClosure(); 150 context->run_loop_quit_closure = run_loop.QuitClosure();
150 run_loop.Run(); 151 run_loop.Run();
151 } 152 }
152 153
153 base::MessageLoop message_loop_; 154 base::MessageLoop message_loop_;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'a'), context.data); 305 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'a'), context.data);
305 context.data.clear(); 306 context.data.clear();
306 307
307 Run(&context); 308 Run(&context);
308 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'b'), context.data); 309 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'b'), context.data);
309 } 310 }
310 311
311 } // namespace 312 } // namespace
312 313
313 } // namespace content 314 } // namespace content
OLDNEW
« no previous file with comments | « content/child/url_loader_client_impl_unittest.cc ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698