OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |