| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 static const int kRenderFrameId = 1; | 56 static const int kRenderFrameId = 1; |
| 57 | 57 |
| 58 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { | 58 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { |
| 59 public: | 59 public: |
| 60 TestingServiceWorkerDispatcherHost( | 60 TestingServiceWorkerDispatcherHost( |
| 61 int process_id, | 61 int process_id, |
| 62 ServiceWorkerContextWrapper* context_wrapper, | 62 ServiceWorkerContextWrapper* context_wrapper, |
| 63 ResourceContext* resource_context, | 63 ResourceContext* resource_context, |
| 64 EmbeddedWorkerTestHelper* helper) | 64 EmbeddedWorkerTestHelper* helper) |
| 65 : ServiceWorkerDispatcherHost(process_id, | 65 : ServiceWorkerDispatcherHost(process_id, nullptr, resource_context), |
| 66 nullptr, | |
| 67 resource_context, | |
| 68 MojoURLLoaderFactoryGetter()), | |
| 69 bad_messages_received_count_(0), | 66 bad_messages_received_count_(0), |
| 70 helper_(helper) { | 67 helper_(helper) { |
| 71 Init(context_wrapper); | 68 Init(context_wrapper); |
| 72 } | 69 } |
| 73 | 70 |
| 74 bool Send(IPC::Message* message) override { return helper_->Send(message); } | 71 bool Send(IPC::Message* message) override { return helper_->Send(message); } |
| 75 | 72 |
| 76 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } | 73 IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } |
| 77 | 74 |
| 78 void ShutdownForBadMessage() override { ++bad_messages_received_count_; } | 75 void ShutdownForBadMessage() override { ++bad_messages_received_count_; } |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 838 |
| 842 base::RunLoop().RunUntilIdle(); | 839 base::RunLoop().RunUntilIdle(); |
| 843 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); | 840 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); |
| 844 } | 841 } |
| 845 | 842 |
| 846 INSTANTIATE_TEST_CASE_P(ServiceWorkerDispatcherHostTest, | 843 INSTANTIATE_TEST_CASE_P(ServiceWorkerDispatcherHostTest, |
| 847 ServiceWorkerDispatcherHostTestP, | 844 ServiceWorkerDispatcherHostTestP, |
| 848 testing::Bool()); | 845 testing::Bool()); |
| 849 | 846 |
| 850 } // namespace content | 847 } // namespace content |
| OLD | NEW |