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

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

Issue 189253002: Implement ServiceWorker::postMessage() [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename message handler per review feedback Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/service_worker/service_worker_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 scoped_ptr<EmbeddedWorkerTestHelper> helper_; 49 scoped_ptr<EmbeddedWorkerTestHelper> helper_;
50 }; 50 };
51 51
52 52
53 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { 53 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost {
54 public: 54 public:
55 TestingServiceWorkerDispatcherHost( 55 TestingServiceWorkerDispatcherHost(
56 int process_id, 56 int process_id,
57 ServiceWorkerContextWrapper* context_wrapper, 57 ServiceWorkerContextWrapper* context_wrapper,
58 EmbeddedWorkerTestHelper* helper) 58 EmbeddedWorkerTestHelper* helper)
59 : ServiceWorkerDispatcherHost(process_id), 59 : ServiceWorkerDispatcherHost(process_id, NULL),
60 bad_messages_received_count_(0), 60 bad_messages_received_count_(0),
61 helper_(helper) { 61 helper_(helper) {
62 Init(context_wrapper); 62 Init(context_wrapper);
63 } 63 }
64 64
65 virtual bool Send(IPC::Message* message) OVERRIDE { 65 virtual bool Send(IPC::Message* message) OVERRIDE {
66 return helper_->Send(message); 66 return helper_->Send(message);
67 } 67 }
68 68
69 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } 69 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ServiceWorkerHostMsg_ProviderCreated(kProviderId), 197 ServiceWorkerHostMsg_ProviderCreated(kProviderId),
198 &handled); 198 &handled);
199 EXPECT_TRUE(handled); 199 EXPECT_TRUE(handled);
200 EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId)); 200 EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId));
201 EXPECT_TRUE(dispatcher_host->HasOneRef()); 201 EXPECT_TRUE(dispatcher_host->HasOneRef());
202 dispatcher_host = NULL; 202 dispatcher_host = NULL;
203 EXPECT_FALSE(context()->GetProviderHost(kRenderProcessId, kProviderId)); 203 EXPECT_FALSE(context()->GetProviderHost(kRenderProcessId, kProviderId));
204 } 204 }
205 205
206 } // namespace content 206 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698