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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 version_ = new ServiceWorkerVersion( | 115 version_ = new ServiceWorkerVersion( |
116 registration_, | 116 registration_, |
117 1L, context_->AsWeakPtr()); | 117 1L, context_->AsWeakPtr()); |
118 | 118 |
119 // Simulate adding one process to the worker. | 119 // Simulate adding one process to the worker. |
120 int embedded_worker_id = version_->embedded_worker()->embedded_worker_id(); | 120 int embedded_worker_id = version_->embedded_worker()->embedded_worker_id(); |
121 helper_->SimulateAddProcessToWorker(embedded_worker_id, kRenderProcessId); | 121 helper_->SimulateAddProcessToWorker(embedded_worker_id, kRenderProcessId); |
122 } | 122 } |
123 | 123 |
124 virtual void TearDown() OVERRIDE { | 124 virtual void TearDown() OVERRIDE { |
125 version_->Shutdown(); | |
126 version_ = 0; | 125 version_ = 0; |
127 registration_->Shutdown(); | |
128 registration_ = 0; | 126 registration_ = 0; |
129 helper_.reset(); | 127 helper_.reset(); |
130 context_.reset(); | 128 context_.reset(); |
131 } | 129 } |
132 | 130 |
133 TestBrowserThreadBundle thread_bundle_; | 131 TestBrowserThreadBundle thread_bundle_; |
134 scoped_ptr<ServiceWorkerContextCore> context_; | 132 scoped_ptr<ServiceWorkerContextCore> context_; |
135 scoped_ptr<EmbeddedWorkerTestHelper> helper_; | 133 scoped_ptr<EmbeddedWorkerTestHelper> helper_; |
136 scoped_refptr<ServiceWorkerRegistration> registration_; | 134 scoped_refptr<ServiceWorkerRegistration> registration_; |
137 scoped_refptr<ServiceWorkerVersion> version_; | 135 scoped_refptr<ServiceWorkerVersion> version_; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 321 |
324 // Verify that we could successfully observe repeated status changes. | 322 // Verify that we could successfully observe repeated status changes. |
325 ASSERT_EQ(4U, statuses.size()); | 323 ASSERT_EQ(4U, statuses.size()); |
326 ASSERT_EQ(ServiceWorkerVersion::INSTALLING, statuses[0]); | 324 ASSERT_EQ(ServiceWorkerVersion::INSTALLING, statuses[0]); |
327 ASSERT_EQ(ServiceWorkerVersion::INSTALLED, statuses[1]); | 325 ASSERT_EQ(ServiceWorkerVersion::INSTALLED, statuses[1]); |
328 ASSERT_EQ(ServiceWorkerVersion::ACTIVATING, statuses[2]); | 326 ASSERT_EQ(ServiceWorkerVersion::ACTIVATING, statuses[2]); |
329 ASSERT_EQ(ServiceWorkerVersion::ACTIVE, statuses[3]); | 327 ASSERT_EQ(ServiceWorkerVersion::ACTIVE, statuses[3]); |
330 } | 328 } |
331 | 329 |
332 } // namespace content | 330 } // namespace content |
OLD | NEW |