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

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: Reup 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 ServiceWorkerHostMsg_ProviderCreated(kProviderId), 192 ServiceWorkerHostMsg_ProviderCreated(kProviderId),
193 &handled); 193 &handled);
194 EXPECT_TRUE(handled); 194 EXPECT_TRUE(handled);
195 EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId)); 195 EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId));
196 EXPECT_TRUE(dispatcher_host->HasOneRef()); 196 EXPECT_TRUE(dispatcher_host->HasOneRef());
197 dispatcher_host = NULL; 197 dispatcher_host = NULL;
198 EXPECT_FALSE(context()->GetProviderHost(kRenderProcessId, kProviderId)); 198 EXPECT_FALSE(context()->GetProviderHost(kRenderProcessId, kProviderId));
199 } 199 }
200 200
201 } // namespace content 201 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698