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, | 54 : ServiceWorkerDispatcherHost(process_id, nullptr, resource_context), |
55 nullptr, | |
56 resource_context, | |
57 MojoURLLoaderFactoryGetter()), | |
58 bad_message_received_count_(0), | 55 bad_message_received_count_(0), |
59 helper_(helper) { | 56 helper_(helper) { |
60 Init(context_wrapper); | 57 Init(context_wrapper); |
61 } | 58 } |
62 | 59 |
63 bool Send(IPC::Message* message) override { return helper_->Send(message); } | 60 bool Send(IPC::Message* message) override { return helper_->Send(message); } |
64 | 61 |
65 void ShutdownForBadMessage() override { ++bad_message_received_count_; } | 62 void ShutdownForBadMessage() override { ++bad_message_received_count_; } |
66 | 63 |
67 int bad_message_received_count_; | 64 int bad_message_received_count_; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // StateChanged (state == Installed). | 177 // StateChanged (state == Installed). |
181 VerifyStateChangedMessage(handle->handle_id(), | 178 VerifyStateChangedMessage(handle->handle_id(), |
182 blink::WebServiceWorkerStateInstalled, message); | 179 blink::WebServiceWorkerStateInstalled, message); |
183 } | 180 } |
184 | 181 |
185 INSTANTIATE_TEST_CASE_P(ServiceWorkerHandleTest, | 182 INSTANTIATE_TEST_CASE_P(ServiceWorkerHandleTest, |
186 ServiceWorkerHandleTestP, | 183 ServiceWorkerHandleTestP, |
187 ::testing::Values(false, true)); | 184 ::testing::Values(false, true)); |
188 | 185 |
189 } // namespace content | 186 } // namespace content |
OLD | NEW |