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

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

Issue 1970693002: Use mojo for Chrome Loading, Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/resource_dispatcher.h" 5 #include "content/child/resource_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 return request_info; 311 return request_info;
312 } 312 }
313 313
314 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } 314 ResourceDispatcher* dispatcher() { return dispatcher_.get(); }
315 315
316 int StartAsync(const RequestInfo& request_info, 316 int StartAsync(const RequestInfo& request_info,
317 ResourceRequestBody* request_body, 317 ResourceRequestBody* request_body,
318 TestRequestPeer::Context* peer_context) { 318 TestRequestPeer::Context* peer_context) {
319 std::unique_ptr<TestRequestPeer> peer( 319 std::unique_ptr<TestRequestPeer> peer(
320 new TestRequestPeer(dispatcher(), peer_context)); 320 new TestRequestPeer(dispatcher(), peer_context));
321 int request_id = 321 int request_id = dispatcher()->StartAsync(request_info, request_body,
322 dispatcher()->StartAsync(request_info, request_body, std::move(peer)); 322 std::move(peer), nullptr);
323 peer_context->request_id = request_id; 323 peer_context->request_id = request_id;
324 return request_id; 324 return request_id;
325 } 325 }
326 326
327 private: 327 private:
328 // Map of request IDs to shared memory. 328 // Map of request IDs to shared memory.
329 std::map<int, base::SharedMemory*> shared_memory_map_; 329 std::map<int, base::SharedMemory*> shared_memory_map_;
330 330
331 std::vector<IPC::Message> message_queue_; 331 std::vector<IPC::Message> message_queue_;
332 base::MessageLoop message_loop_; 332 base::MessageLoop message_loop_;
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 ResourceResponseHead response_head; 893 ResourceResponseHead response_head;
894 894
895 PerformTest(response_head); 895 PerformTest(response_head);
896 896
897 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); 897 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start);
898 EXPECT_EQ(base::TimeTicks(), 898 EXPECT_EQ(base::TimeTicks(),
899 response_info().load_timing.connect_timing.dns_start); 899 response_info().load_timing.connect_timing.dns_start);
900 } 900 }
901 901
902 } // namespace content 902 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698