| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "content/browser/service_worker/embedded_worker_instance.h" | 9 #include "content/browser/service_worker/embedded_worker_instance.h" |
| 10 #include "content/browser/service_worker/embedded_worker_registry.h" | 10 #include "content/browser/service_worker/embedded_worker_registry.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest { | 218 class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest { |
| 219 public: | 219 public: |
| 220 typedef ServiceWorkerVersionBrowserTest self; | 220 typedef ServiceWorkerVersionBrowserTest self; |
| 221 | 221 |
| 222 ServiceWorkerVersionBrowserTest() : next_registration_id_(1) {} | 222 ServiceWorkerVersionBrowserTest() : next_registration_id_(1) {} |
| 223 virtual ~ServiceWorkerVersionBrowserTest() {} | 223 virtual ~ServiceWorkerVersionBrowserTest() {} |
| 224 | 224 |
| 225 virtual void TearDownOnIOThread() OVERRIDE { | 225 virtual void TearDownOnIOThread() OVERRIDE { |
| 226 if (registration_) { | 226 registration_ = NULL; |
| 227 registration_->Shutdown(); | 227 version_ = NULL; |
| 228 registration_ = NULL; | |
| 229 } | |
| 230 if (version_) { | |
| 231 version_->Shutdown(); | |
| 232 version_ = NULL; | |
| 233 } | |
| 234 } | 228 } |
| 235 | 229 |
| 236 void InstallTestHelper(const std::string& worker_url, | 230 void InstallTestHelper(const std::string& worker_url, |
| 237 ServiceWorkerStatusCode expected_status) { | 231 ServiceWorkerStatusCode expected_status) { |
| 238 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, this, | 232 RunOnIOThread(base::Bind(&self::SetUpRegistrationOnIOThread, this, |
| 239 worker_url)); | 233 worker_url)); |
| 240 | 234 |
| 241 // Dispatch install on a worker. | 235 // Dispatch install on a worker. |
| 242 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; | 236 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; |
| 243 base::RunLoop install_run_loop; | 237 base::RunLoop install_run_loop; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 587 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
| 594 this, | 588 this, |
| 595 embedded_test_server()->GetURL("/service_worker/empty.html"), | 589 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 596 &status, | 590 &status, |
| 597 &script_url)); | 591 &script_url)); |
| 598 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 592 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
| 599 } | 593 } |
| 600 } | 594 } |
| 601 | 595 |
| 602 } // namespace content | 596 } // namespace content |
| OLD | NEW |