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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "content/browser/service_worker/embedded_worker_registry.h" | 7 #include "content/browser/service_worker/embedded_worker_registry.h" |
8 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 8 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
10 #include "content/browser/service_worker/service_worker_registration.h" | 10 #include "content/browser/service_worker/service_worker_registration.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 private: | 173 private: |
174 DISALLOW_COPY_AND_ASSIGN(MessageReceiverDisallowStart); | 174 DISALLOW_COPY_AND_ASSIGN(MessageReceiverDisallowStart); |
175 }; | 175 }; |
176 | 176 |
177 class ServiceWorkerFailToStartTest : public ServiceWorkerVersionTest { | 177 class ServiceWorkerFailToStartTest : public ServiceWorkerVersionTest { |
178 protected: | 178 protected: |
179 ServiceWorkerFailToStartTest() | 179 ServiceWorkerFailToStartTest() |
180 : ServiceWorkerVersionTest() {} | 180 : ServiceWorkerVersionTest() {} |
181 | 181 |
182 virtual scoped_ptr<MessageReceiver> GetMessageReceiver() override { | 182 scoped_ptr<MessageReceiver> GetMessageReceiver() override { |
183 return make_scoped_ptr(new MessageReceiverDisallowStart()); | 183 return make_scoped_ptr(new MessageReceiverDisallowStart()); |
184 } | 184 } |
185 | 185 |
186 private: | 186 private: |
187 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerFailToStartTest); | 187 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerFailToStartTest); |
188 }; | 188 }; |
189 | 189 |
190 TEST_F(ServiceWorkerVersionTest, ConcurrentStartAndStop) { | 190 TEST_F(ServiceWorkerVersionTest, ConcurrentStartAndStop) { |
191 // Call StartWorker() multiple times. | 191 // Call StartWorker() multiple times. |
192 ServiceWorkerStatusCode status1 = SERVICE_WORKER_ERROR_FAILED; | 192 ServiceWorkerStatusCode status1 = SERVICE_WORKER_ERROR_FAILED; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 helper_->context()->embedded_worker_registry()->RemoveChildProcessSender( | 436 helper_->context()->embedded_worker_registry()->RemoveChildProcessSender( |
437 process_id); | 437 process_id); |
438 base::RunLoop().RunUntilIdle(); | 438 base::RunLoop().RunUntilIdle(); |
439 | 439 |
440 // Callback completed. | 440 // Callback completed. |
441 EXPECT_EQ(SERVICE_WORKER_ERROR_START_WORKER_FAILED, status); | 441 EXPECT_EQ(SERVICE_WORKER_ERROR_START_WORKER_FAILED, status); |
442 EXPECT_EQ(ServiceWorkerVersion::STOPPED, version_->running_status()); | 442 EXPECT_EQ(ServiceWorkerVersion::STOPPED, version_->running_status()); |
443 } | 443 } |
444 | 444 |
445 } // namespace content | 445 } // namespace content |
OLD | NEW |