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

Side by Side Diff: content/child/service_worker/service_worker_dispatcher_unittest.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Address feedback from Selim 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/service_worker/service_worker_provider_context.h" 9 #include "content/child/service_worker/service_worker_provider_context.h"
10 #include "content/child/service_worker/web_service_worker_impl.h" 10 #include "content/child/service_worker/web_service_worker_impl.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle, 129 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle,
130 bool shouldNotifyControllerChange) override { 130 bool shouldNotifyControllerChange) override {
131 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. 131 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here.
132 // The destruction releases ServiceWorkerHandleReference. 132 // The destruction releases ServiceWorkerHandleReference.
133 is_set_controlled_called_ = true; 133 is_set_controlled_called_ = true;
134 } 134 }
135 135
136 void dispatchMessageEvent( 136 void dispatchMessageEvent(
137 std::unique_ptr<blink::WebServiceWorker::Handle> handle, 137 std::unique_ptr<blink::WebServiceWorker::Handle> handle,
138 const blink::WebString& message, 138 const blink::WebString& message,
139 const blink::WebMessagePortChannelArray& channels) override { 139 blink::WebMessagePortChannelArray channels) override {
140 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. 140 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here.
141 // The destruction releases ServiceWorkerHandleReference. 141 // The destruction releases ServiceWorkerHandleReference.
142 is_dispatch_message_event_called_ = true; 142 is_dispatch_message_event_called_ = true;
143 } 143 }
144 144
145 bool is_set_controlled_called() const { return is_set_controlled_called_; } 145 bool is_set_controlled_called() const { return is_set_controlled_called_; }
146 146
147 bool is_dispatch_message_event_called() const { 147 bool is_dispatch_message_event_called() const {
148 return is_dispatch_message_event_called_; 148 return is_dispatch_message_event_called_;
149 } 149 }
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 ipc_sink()->GetMessageAt(0)->type()); 515 ipc_sink()->GetMessageAt(0)->type());
516 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, 516 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID,
517 ipc_sink()->GetMessageAt(1)->type()); 517 ipc_sink()->GetMessageAt(1)->type());
518 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, 518 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID,
519 ipc_sink()->GetMessageAt(2)->type()); 519 ipc_sink()->GetMessageAt(2)->type());
520 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID, 520 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID,
521 ipc_sink()->GetMessageAt(3)->type()); 521 ipc_sink()->GetMessageAt(3)->type());
522 } 522 }
523 523
524 } // namespace content 524 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698