| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/test_background_sync_manager.h" | 5 #include "content/test/test_background_sync_manager.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 9 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 base::Unretained(this), key, callback); | 70 base::Unretained(this), key, callback); |
| 71 if (delay_backend_) | 71 if (delay_backend_) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 ResumeBackendOperation(); | 74 ResumeBackendOperation(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void TestBackgroundSyncManager::DispatchSyncEvent( | 77 void TestBackgroundSyncManager::DispatchSyncEvent( |
| 78 const std::string& tag, | 78 const std::string& tag, |
| 79 const scoped_refptr<ServiceWorkerVersion>& active_version, | 79 const scoped_refptr<ServiceWorkerVersion>& active_version, |
| 80 mojom::BackgroundSyncEventLastChance last_chance, | 80 blink::mojom::BackgroundSyncEventLastChance last_chance, |
| 81 const ServiceWorkerVersion::StatusCallback& callback) { | 81 const ServiceWorkerVersion::StatusCallback& callback) { |
| 82 ASSERT_FALSE(dispatch_sync_callback_.is_null()); | 82 ASSERT_FALSE(dispatch_sync_callback_.is_null()); |
| 83 last_chance_ = last_chance; | 83 last_chance_ = last_chance; |
| 84 dispatch_sync_callback_.Run(active_version, callback); | 84 dispatch_sync_callback_.Run(active_version, callback); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void TestBackgroundSyncManager::ScheduleDelayedTask( | 87 void TestBackgroundSyncManager::ScheduleDelayedTask( |
| 88 const base::Closure& callback, | 88 const base::Closure& callback, |
| 89 base::TimeDelta delay) { | 89 base::TimeDelta delay) { |
| 90 delayed_task_ = callback; | 90 delayed_task_ = callback; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 void TestBackgroundSyncManager::GetDataFromBackendContinue( | 110 void TestBackgroundSyncManager::GetDataFromBackendContinue( |
| 111 const std::string& key, | 111 const std::string& key, |
| 112 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback& | 112 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback& |
| 113 callback) { | 113 callback) { |
| 114 BackgroundSyncManager::GetDataFromBackend(key, callback); | 114 BackgroundSyncManager::GetDataFromBackend(key, callback); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace content | 117 } // namespace content |
| OLD | NEW |