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

Side by Side Diff: content/browser/service_worker/service_worker_handle_unittest.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Address feedback from yusuf 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 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 <tuple> 5 #include <tuple>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/service_worker/embedded_worker_registry.h" 10 #include "content/browser/service_worker/embedded_worker_registry.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 } // namespace 45 } // namespace
46 46
47 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { 47 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost {
48 public: 48 public:
49 TestingServiceWorkerDispatcherHost( 49 TestingServiceWorkerDispatcherHost(
50 int process_id, 50 int process_id,
51 ServiceWorkerContextWrapper* context_wrapper, 51 ServiceWorkerContextWrapper* context_wrapper,
52 ResourceContext* resource_context, 52 ResourceContext* resource_context,
53 EmbeddedWorkerTestHelper* helper) 53 EmbeddedWorkerTestHelper* helper)
54 : ServiceWorkerDispatcherHost(process_id, nullptr, resource_context), 54 : ServiceWorkerDispatcherHost(process_id, resource_context),
55 bad_message_received_count_(0), 55 bad_message_received_count_(0),
56 helper_(helper) { 56 helper_(helper) {
57 Init(context_wrapper); 57 Init(context_wrapper);
58 } 58 }
59 59
60 bool Send(IPC::Message* message) override { return helper_->Send(message); } 60 bool Send(IPC::Message* message) override { return helper_->Send(message); }
61 61
62 void ShutdownForBadMessage() override { ++bad_message_received_count_; } 62 void ShutdownForBadMessage() override { ++bad_message_received_count_; }
63 63
64 int bad_message_received_count_; 64 int bad_message_received_count_;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // StartWorker shouldn't be recorded here. 164 // StartWorker shouldn't be recorded here.
165 ASSERT_EQ(1UL, ipc_sink()->message_count()); 165 ASSERT_EQ(1UL, ipc_sink()->message_count());
166 message = ipc_sink()->GetMessageAt(0); 166 message = ipc_sink()->GetMessageAt(0);
167 167
168 // StateChanged (state == Installed). 168 // StateChanged (state == Installed).
169 VerifyStateChangedMessage(handle->handle_id(), 169 VerifyStateChangedMessage(handle->handle_id(),
170 blink::WebServiceWorkerStateInstalled, message); 170 blink::WebServiceWorkerStateInstalled, message);
171 } 171 }
172 172
173 } // namespace content 173 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698