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

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

Issue 2695333002: Mojo C++ bindings: remove usage of AssociatedGroup from content/ (Closed)
Patch Set: . Created 3 years, 10 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.h » ('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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 options.capacity_num_bytes = 1024; 130 options.capacity_num_bytes = 1024;
131 return options; 131 return options;
132 } 132 }
133 133
134 // Returns the request id. 134 // Returns the request id.
135 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request, 135 int SetUpRequestPeer(std::unique_ptr<ResourceRequest> request,
136 TestRequestPeer::Context* context) { 136 TestRequestPeer::Context* context) {
137 return dispatcher_->StartAsync( 137 return dispatcher_->StartAsync(
138 std::move(request), 0, nullptr, url::Origin(), 138 std::move(request), 0, nullptr, url::Origin(),
139 base::MakeUnique<TestRequestPeer>(context, message_loop_.task_runner()), 139 base::MakeUnique<TestRequestPeer>(context, message_loop_.task_runner()),
140 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr, nullptr); 140 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr);
141 } 141 }
142 142
143 void Run(TestRequestPeer::Context* context) { 143 void Run(TestRequestPeer::Context* context) {
144 base::RunLoop run_loop; 144 base::RunLoop run_loop;
145 context->run_loop_quit_closure = run_loop.QuitClosure(); 145 context->run_loop_quit_closure = run_loop.QuitClosure();
146 run_loop.Run(); 146 run_loop.Run();
147 } 147 }
148 148
149 base::MessageLoop message_loop_; 149 base::MessageLoop message_loop_;
150 std::unique_ptr<ResourceDispatcher> dispatcher_; 150 std::unique_ptr<ResourceDispatcher> dispatcher_;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'a'), context.data); 300 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'a'), context.data);
301 context.data.clear(); 301 context.data.clear();
302 302
303 Run(&context); 303 Run(&context);
304 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'b'), context.data); 304 EXPECT_EQ(std::string(kMaxNumConsumedBytesInTask, 'b'), context.data);
305 } 305 }
306 306
307 } // namespace 307 } // namespace
308 308
309 } // namespace content 309 } // namespace content
OLDNEW
« no previous file with comments | « content/child/url_loader_client_impl_unittest.cc ('k') | content/child/web_url_loader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698