| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/service_worker/service_worker_registration.h" | 5 #include "content/browser/service_worker/service_worker_registration.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 ServiceWorkerRegistrationTest() | 22 ServiceWorkerRegistrationTest() |
| 23 : io_thread_(BrowserThread::IO, &message_loop_) {} | 23 : io_thread_(BrowserThread::IO, &message_loop_) {} |
| 24 | 24 |
| 25 void SetUp() override { | 25 void SetUp() override { |
| 26 scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager( | 26 scoped_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager( |
| 27 new MockServiceWorkerDatabaseTaskManager( | 27 new MockServiceWorkerDatabaseTaskManager( |
| 28 base::ThreadTaskRunnerHandle::Get())); | 28 base::ThreadTaskRunnerHandle::Get())); |
| 29 context_.reset( | 29 context_.reset( |
| 30 new ServiceWorkerContextCore(base::FilePath(), | 30 new ServiceWorkerContextCore(base::FilePath(), |
| 31 base::ThreadTaskRunnerHandle::Get(), | |
| 32 database_task_manager.Pass(), | 31 database_task_manager.Pass(), |
| 33 base::ThreadTaskRunnerHandle::Get(), | 32 base::ThreadTaskRunnerHandle::Get(), |
| 34 NULL, | 33 NULL, |
| 35 NULL, | 34 NULL, |
| 36 NULL, | 35 NULL, |
| 37 NULL)); | 36 NULL)); |
| 38 context_ptr_ = context_->AsWeakPtr(); | 37 context_ptr_ = context_->AsWeakPtr(); |
| 39 } | 38 } |
| 40 | 39 |
| 41 void TearDown() override { | 40 void TearDown() override { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 scoped_ptr<ServiceWorkerRegistrationHandle> handle( | 167 scoped_ptr<ServiceWorkerRegistrationHandle> handle( |
| 169 new ServiceWorkerRegistrationHandle( | 168 new ServiceWorkerRegistrationHandle( |
| 170 context_ptr_, | 169 context_ptr_, |
| 171 base::WeakPtr<ServiceWorkerProviderHost>(), | 170 base::WeakPtr<ServiceWorkerProviderHost>(), |
| 172 registration.get())); | 171 registration.get())); |
| 173 registration->NotifyRegistrationFailed(); | 172 registration->NotifyRegistrationFailed(); |
| 174 // Don't crash when handle gets destructed. | 173 // Don't crash when handle gets destructed. |
| 175 } | 174 } |
| 176 | 175 |
| 177 } // namespace content | 176 } // namespace content |
| OLD | NEW |