| 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/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/browser/service_worker/embedded_worker_registry.h" | 9 #include "content/browser/service_worker/embedded_worker_registry.h" |
| 10 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 10 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace | 97 } // namespace |
| 98 | 98 |
| 99 class ServiceWorkerJobTest : public testing::Test { | 99 class ServiceWorkerJobTest : public testing::Test { |
| 100 public: | 100 public: |
| 101 ServiceWorkerJobTest() | 101 ServiceWorkerJobTest() |
| 102 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), | 102 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), |
| 103 render_process_id_(kMockRenderProcessId) {} | 103 render_process_id_(kMockRenderProcessId) {} |
| 104 | 104 |
| 105 virtual void SetUp() override { | 105 void SetUp() override { |
| 106 helper_.reset(new EmbeddedWorkerTestHelper(render_process_id_)); | 106 helper_.reset(new EmbeddedWorkerTestHelper(render_process_id_)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 virtual void TearDown() override { | 109 void TearDown() override { helper_.reset(); } |
| 110 helper_.reset(); | |
| 111 } | |
| 112 | 110 |
| 113 ServiceWorkerContextCore* context() const { return helper_->context(); } | 111 ServiceWorkerContextCore* context() const { return helper_->context(); } |
| 114 | 112 |
| 115 ServiceWorkerJobCoordinator* job_coordinator() const { | 113 ServiceWorkerJobCoordinator* job_coordinator() const { |
| 116 return context()->job_coordinator(); | 114 return context()->job_coordinator(); |
| 117 } | 115 } |
| 118 ServiceWorkerStorage* storage() const { return context()->storage(); } | 116 ServiceWorkerStorage* storage() const { return context()->storage(); } |
| 119 | 117 |
| 120 protected: | 118 protected: |
| 121 TestBrowserThreadBundle browser_thread_bundle_; | 119 TestBrowserThreadBundle browser_thread_bundle_; |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 EXPECT_TRUE(called); | 1187 EXPECT_TRUE(called); |
| 1190 | 1188 |
| 1191 // Verify the registration was not modified by the Update. | 1189 // Verify the registration was not modified by the Update. |
| 1192 EXPECT_TRUE(registration->is_uninstalling()); | 1190 EXPECT_TRUE(registration->is_uninstalling()); |
| 1193 EXPECT_EQ(active_version, registration->active_version()); | 1191 EXPECT_EQ(active_version, registration->active_version()); |
| 1194 EXPECT_EQ(NULL, registration->waiting_version()); | 1192 EXPECT_EQ(NULL, registration->waiting_version()); |
| 1195 EXPECT_EQ(NULL, registration->installing_version()); | 1193 EXPECT_EQ(NULL, registration->installing_version()); |
| 1196 } | 1194 } |
| 1197 | 1195 |
| 1198 } // namespace content | 1196 } // namespace content |
| OLD | NEW |