| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { | 46 class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { |
| 47 public: | 47 public: |
| 48 TestingServiceWorkerDispatcherHost( | 48 TestingServiceWorkerDispatcherHost( |
| 49 int process_id, | 49 int process_id, |
| 50 ServiceWorkerContextWrapper* context_wrapper, | 50 ServiceWorkerContextWrapper* context_wrapper, |
| 51 ResourceContext* resource_context, | 51 ResourceContext* resource_context, |
| 52 EmbeddedWorkerTestHelper* helper) | 52 EmbeddedWorkerTestHelper* helper) |
| 53 : ServiceWorkerDispatcherHost(process_id, nullptr, resource_context), | 53 : ServiceWorkerDispatcherHost( |
| 54 process_id, |
| 55 nullptr, |
| 56 resource_context, |
| 57 ServiceWorkerDispatcherHost::URLLoaderFactoryCallback()), |
| 54 bad_message_received_count_(0), | 58 bad_message_received_count_(0), |
| 55 helper_(helper) { | 59 helper_(helper) { |
| 56 Init(context_wrapper); | 60 Init(context_wrapper); |
| 57 } | 61 } |
| 58 | 62 |
| 59 bool Send(IPC::Message* message) override { return helper_->Send(message); } | 63 bool Send(IPC::Message* message) override { return helper_->Send(message); } |
| 60 | 64 |
| 61 void ShutdownForBadMessage() override { ++bad_message_received_count_; } | 65 void ShutdownForBadMessage() override { ++bad_message_received_count_; } |
| 62 | 66 |
| 63 int bad_message_received_count_; | 67 int bad_message_received_count_; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // We should be sending 1. StartWorker, | 166 // We should be sending 1. StartWorker, |
| 163 EXPECT_EQ(EmbeddedWorkerMsg_StartWorker::ID, | 167 EXPECT_EQ(EmbeddedWorkerMsg_StartWorker::ID, |
| 164 ipc_sink()->GetMessageAt(0)->type()); | 168 ipc_sink()->GetMessageAt(0)->type()); |
| 165 // 2. StateChanged (state == Installed). | 169 // 2. StateChanged (state == Installed). |
| 166 VerifyStateChangedMessage(handle->handle_id(), | 170 VerifyStateChangedMessage(handle->handle_id(), |
| 167 blink::WebServiceWorkerStateInstalled, | 171 blink::WebServiceWorkerStateInstalled, |
| 168 ipc_sink()->GetMessageAt(1)); | 172 ipc_sink()->GetMessageAt(1)); |
| 169 } | 173 } |
| 170 | 174 |
| 171 } // namespace content | 175 } // namespace content |
| OLD | NEW |