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

Side by Side Diff: content/browser/shared_worker/shared_worker_service_impl_unittest.cc

Issue 2601893002: SharedWorker: Remove message forwarding mechanism (Closed)
Patch Set: style fix Created 3 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/shared_worker/shared_worker_service_impl.h" 5 #include "content/browser/shared_worker/shared_worker_service_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 new MessagePortHostMsg_QueueMessages(remote_port_id_))); 291 new MessagePortHostMsg_QueueMessages(remote_port_id_)));
292 } 292 }
293 void SendPostMessage(const std::string& data) { 293 void SendPostMessage(const std::string& data) {
294 const std::vector<int> empty_ports; 294 const std::vector<int> empty_ports;
295 EXPECT_TRUE( 295 EXPECT_TRUE(
296 renderer_host_->OnMessageReceived(new MessagePortHostMsg_PostMessage( 296 renderer_host_->OnMessageReceived(new MessagePortHostMsg_PostMessage(
297 local_port_id_, base::ASCIIToUTF16(data), empty_ports))); 297 local_port_id_, base::ASCIIToUTF16(data), empty_ports)));
298 } 298 }
299 void SendConnect() { 299 void SendConnect() {
300 EXPECT_TRUE( 300 EXPECT_TRUE(
301 renderer_host_->OnMessageReceived(new ViewHostMsg_ForwardToWorker( 301 renderer_host_->OnMessageReceived(new ViewHostMsg_ConnectToWorker(
302 WorkerMsg_Connect(create_worker_reply_.route_id, remote_port_id_, 302 create_worker_reply_.route_id, remote_port_id_)));
303 MSG_ROUTING_NONE))));
304 } 303 }
305 void SendSendQueuedMessages( 304 void SendSendQueuedMessages(
306 const std::vector<QueuedMessage>& queued_messages) { 305 const std::vector<QueuedMessage>& queued_messages) {
307 EXPECT_TRUE(renderer_host_->OnMessageReceived( 306 EXPECT_TRUE(renderer_host_->OnMessageReceived(
308 new MessagePortHostMsg_SendQueuedMessages(remote_port_id_, 307 new MessagePortHostMsg_SendQueuedMessages(remote_port_id_,
309 queued_messages))); 308 queued_messages)));
310 } 309 }
311 int temporary_remote_port_route_id() { 310 int temporary_remote_port_route_id() {
312 return temporary_remote_port_route_id_; 311 return temporary_remote_port_route_id_;
313 } 312 }
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 kDocumentIDs[2], 977 kDocumentIDs[2],
979 kRenderFrameRouteIDs[2]); 978 kRenderFrameRouteIDs[2]);
980 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id()); 979 EXPECT_NE(MSG_ROUTING_NONE, connector2->route_id());
981 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount()); 980 EXPECT_EQ(0U, renderer_host2->QueuedMessageCount());
982 RunAllPendingInMessageLoop(); 981 RunAllPendingInMessageLoop();
983 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount()); 982 EXPECT_EQ(1U, renderer_host2->QueuedMessageCount());
984 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get()); 983 CheckViewMsgWorkerCreated(renderer_host2.get(), connector2.get());
985 } 984 }
986 985
987 } // namespace content 986 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/shared_worker/shared_worker_service_impl.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698