| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/background_sync/background_sync_manager.h" | 5 #include "content/browser/background_sync/background_sync_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const std::string& status_message, | 59 const std::string& status_message, |
| 60 int64_t registration_id) { | 60 int64_t registration_id) { |
| 61 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 61 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
| 62 *called = true; | 62 *called = true; |
| 63 *store_registration_id = registration_id; | 63 *store_registration_id = registration_id; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void FindServiceWorkerRegistrationCallback( | 66 void FindServiceWorkerRegistrationCallback( |
| 67 scoped_refptr<ServiceWorkerRegistration>* out_registration, | 67 scoped_refptr<ServiceWorkerRegistration>* out_registration, |
| 68 ServiceWorkerStatusCode status, | 68 ServiceWorkerStatusCode status, |
| 69 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 69 scoped_refptr<ServiceWorkerRegistration> registration) { |
| 70 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 70 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
| 71 *out_registration = registration; | 71 *out_registration = std::move(registration); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void UnregisterServiceWorkerCallback(bool* called, | 74 void UnregisterServiceWorkerCallback(bool* called, |
| 75 ServiceWorkerStatusCode code) { | 75 ServiceWorkerStatusCode code) { |
| 76 EXPECT_EQ(SERVICE_WORKER_OK, code); | 76 EXPECT_EQ(SERVICE_WORKER_OK, code); |
| 77 *called = true; | 77 *called = true; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void DispatchSyncSuccessfulCallback( | 80 void DispatchSyncSuccessfulCallback( |
| 81 int* count, | 81 int* count, |
| (...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 // Run it again. | 1314 // Run it again. |
| 1315 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); | 1315 test_clock_->Advance(test_background_sync_manager_->delayed_task_delta()); |
| 1316 test_background_sync_manager_->delayed_task().Run(); | 1316 test_background_sync_manager_->delayed_task().Run(); |
| 1317 base::RunLoop().RunUntilIdle(); | 1317 base::RunLoop().RunUntilIdle(); |
| 1318 EXPECT_FALSE(GetRegistration(sync_options_1_)); | 1318 EXPECT_FALSE(GetRegistration(sync_options_1_)); |
| 1319 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE, | 1319 EXPECT_EQ(blink::mojom::BackgroundSyncEventLastChance::IS_LAST_CHANCE, |
| 1320 test_background_sync_manager_->last_chance()); | 1320 test_background_sync_manager_->last_chance()); |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 } // namespace content | 1323 } // namespace content |
| OLD | NEW |