| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 static const int kRenderFrameId = 1; | 54 static const int kRenderFrameId = 1; |
| 55 | 55 |
| 56 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { | 56 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { |
| 57 public: | 57 public: |
| 58 TestingServiceWorkerDispatcherHost( | 58 TestingServiceWorkerDispatcherHost( |
| 59 int process_id, | 59 int process_id, |
| 60 ServiceWorkerContextWrapper* context_wrapper, | 60 ServiceWorkerContextWrapper* context_wrapper, |
| 61 ResourceContext* resource_context, | 61 ResourceContext* resource_context, |
| 62 EmbeddedWorkerTestHelper* helper) | 62 EmbeddedWorkerTestHelper* helper) |
| 63 : ServiceWorkerDispatcherHost(process_id, NULL, resource_context), | 63 : ServiceWorkerDispatcherHost( |
| 64 process_id, |
| 65 nullptr, |
| 66 resource_context, |
| 67 ServiceWorkerDispatcherHost::URLLoaderFactoryCallback()), |
| 64 bad_messages_received_count_(0), | 68 bad_messages_received_count_(0), |
| 65 helper_(helper) { | 69 helper_(helper) { |
| 66 Init(context_wrapper); | 70 Init(context_wrapper); |
| 67 } | 71 } |
| 68 | 72 |
| 69 bool Send(IPC::Message* message) override { return helper_->Send(message); } | 73 bool Send(IPC::Message* message) override { return helper_->Send(message); } |
| 70 | 74 |
| 71 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } | 75 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } |
| 72 | 76 |
| 73 void ShutdownForBadMessage() override { ++bad_messages_received_count_; } | 77 void ShutdownForBadMessage() override { ++bad_messages_received_count_; } |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( | 831 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( |
| 828 version_->embedded_worker()->embedded_worker_id(), kFetchEventId, | 832 version_->embedded_worker()->embedded_worker_id(), kFetchEventId, |
| 829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), | 833 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), |
| 830 base::Time::Now())); | 834 base::Time::Now())); |
| 831 | 835 |
| 832 base::RunLoop().RunUntilIdle(); | 836 base::RunLoop().RunUntilIdle(); |
| 833 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); | 837 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); |
| 834 } | 838 } |
| 835 | 839 |
| 836 } // namespace content | 840 } // namespace content |
| OLD | NEW |