| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 EXPECT_TRUE(dispatcher_host_->ipc_sink()->GetUniqueMessageMatching( | 125 EXPECT_TRUE(dispatcher_host_->ipc_sink()->GetUniqueMessageMatching( |
| 126 expected_message)); | 126 expected_message)); |
| 127 dispatcher_host_->ipc_sink()->ClearMessages(); | 127 dispatcher_host_->ipc_sink()->ClearMessages(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 ServiceWorkerProviderHost* CreateServiceWorkerProviderHost(int provider_id) { | 130 ServiceWorkerProviderHost* CreateServiceWorkerProviderHost(int provider_id) { |
| 131 return new ServiceWorkerProviderHost(kRenderProcessId, | 131 return new ServiceWorkerProviderHost(kRenderProcessId, |
| 132 MSG_ROUTING_NONE, | 132 MSG_ROUTING_NONE, |
| 133 provider_id, | 133 provider_id, |
| 134 context()->AsWeakPtr(), | 134 context()->AsWeakPtr(), |
| 135 nullptr); | 135 dispatcher_host_.get()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 | 138 |
| 139 TestBrowserThreadBundle browser_thread_bundle_; | 139 TestBrowserThreadBundle browser_thread_bundle_; |
| 140 content::MockResourceContext resource_context_; | 140 content::MockResourceContext resource_context_; |
| 141 scoped_ptr<EmbeddedWorkerTestHelper> helper_; | 141 scoped_ptr<EmbeddedWorkerTestHelper> helper_; |
| 142 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; | 142 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { | 145 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 491 |
| 492 // To show the new dispatcher can operate, simulate provider creation. Since | 492 // To show the new dispatcher can operate, simulate provider creation. Since |
| 493 // the old dispatcher cleaned up the old provider host, the new one won't | 493 // the old dispatcher cleaned up the old provider host, the new one won't |
| 494 // complain. | 494 // complain. |
| 495 new_dispatcher_host->OnMessageReceived( | 495 new_dispatcher_host->OnMessageReceived( |
| 496 ServiceWorkerHostMsg_ProviderCreated(kProviderId, MSG_ROUTING_NONE)); | 496 ServiceWorkerHostMsg_ProviderCreated(kProviderId, MSG_ROUTING_NONE)); |
| 497 EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_); | 497 EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_); |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace content | 500 } // namespace content |
| OLD | NEW |