| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <tuple> | 5 #include <tuple> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "content/browser/service_worker/embedded_worker_registry.h" | 10 #include "content/browser/service_worker/embedded_worker_registry.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { | 47 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { |
| 48 public: | 48 public: |
| 49 TestingServiceWorkerDispatcherHost( | 49 TestingServiceWorkerDispatcherHost( |
| 50 int process_id, | 50 int process_id, |
| 51 ServiceWorkerContextWrapper* context_wrapper, | 51 ServiceWorkerContextWrapper* context_wrapper, |
| 52 ResourceContext* resource_context, | 52 ResourceContext* resource_context, |
| 53 EmbeddedWorkerTestHelper* helper) | 53 EmbeddedWorkerTestHelper* helper) |
| 54 : ServiceWorkerDispatcherHost(process_id, nullptr, resource_context), | 54 : ServiceWorkerDispatcherHost(process_id, resource_context), |
| 55 bad_message_received_count_(0), | 55 bad_message_received_count_(0), |
| 56 helper_(helper) { | 56 helper_(helper) { |
| 57 Init(context_wrapper); | 57 Init(context_wrapper); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool Send(IPC::Message* message) override { return helper_->Send(message); } | 60 bool Send(IPC::Message* message) override { return helper_->Send(message); } |
| 61 | 61 |
| 62 void ShutdownForBadMessage() override { ++bad_message_received_count_; } | 62 void ShutdownForBadMessage() override { ++bad_message_received_count_; } |
| 63 | 63 |
| 64 int bad_message_received_count_; | 64 int bad_message_received_count_; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // StateChanged (state == Installed). | 178 // StateChanged (state == Installed). |
| 179 VerifyStateChangedMessage(handle->handle_id(), | 179 VerifyStateChangedMessage(handle->handle_id(), |
| 180 blink::WebServiceWorkerStateInstalled, message); | 180 blink::WebServiceWorkerStateInstalled, message); |
| 181 } | 181 } |
| 182 | 182 |
| 183 INSTANTIATE_TEST_CASE_P(ServiceWorkerHandleTest, | 183 INSTANTIATE_TEST_CASE_P(ServiceWorkerHandleTest, |
| 184 ServiceWorkerHandleTestP, | 184 ServiceWorkerHandleTestP, |
| 185 ::testing::Values(false, true)); | 185 ::testing::Values(false, true)); |
| 186 | 186 |
| 187 } // namespace content | 187 } // namespace content |
| OLD | NEW |