| 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_service_impl.h" | 5 #include "content/browser/background_sync/background_sync_service_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 int32_t handle_id, | 204 int32_t handle_id, |
| 205 const BackgroundSyncService::UnregisterCallback& callback) { | 205 const BackgroundSyncService::UnregisterCallback& callback) { |
| 206 service_impl_->Unregister( | 206 service_impl_->Unregister( |
| 207 handle_id, sw_registration_id_, callback); | 207 handle_id, sw_registration_id_, callback); |
| 208 base::RunLoop().RunUntilIdle(); | 208 base::RunLoop().RunUntilIdle(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void GetRegistrationOneShot( | 211 void GetRegistrationOneShot( |
| 212 const mojo::String& tag, | 212 const mojo::String& tag, |
| 213 const BackgroundSyncService::RegisterCallback& callback) { | 213 const BackgroundSyncService::RegisterCallback& callback) { |
| 214 service_impl_->GetRegistration(BackgroundSyncPeriodicity::ONE_SHOT, tag, | 214 service_impl_->GetRegistration(tag, sw_registration_id_, callback); |
| 215 sw_registration_id_, callback); | |
| 216 base::RunLoop().RunUntilIdle(); | 215 base::RunLoop().RunUntilIdle(); |
| 217 } | 216 } |
| 218 | 217 |
| 219 void GetRegistrationsOneShot( | 218 void GetRegistrationsOneShot( |
| 220 const BackgroundSyncService::GetRegistrationsCallback& callback) { | 219 const BackgroundSyncService::GetRegistrationsCallback& callback) { |
| 221 service_impl_->GetRegistrations(BackgroundSyncPeriodicity::ONE_SHOT, | 220 service_impl_->GetRegistrations(sw_registration_id_, callback); |
| 222 sw_registration_id_, callback); | |
| 223 base::RunLoop().RunUntilIdle(); | 221 base::RunLoop().RunUntilIdle(); |
| 224 } | 222 } |
| 225 | 223 |
| 226 void NotifyWhenDone( | 224 void NotifyWhenDone( |
| 227 int32_t handle_id, | 225 int32_t handle_id, |
| 228 const BackgroundSyncService::NotifyWhenFinishedCallback& callback) { | 226 const BackgroundSyncService::NotifyWhenFinishedCallback& callback) { |
| 229 service_impl_->NotifyWhenFinished(handle_id, callback); | 227 service_impl_->NotifyWhenFinished(handle_id, callback); |
| 230 base::RunLoop().RunUntilIdle(); | 228 base::RunLoop().RunUntilIdle(); |
| 231 } | 229 } |
| 232 | 230 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 372 |
| 375 NotifyWhenDone(reg->handle_id, | 373 NotifyWhenDone(reg->handle_id, |
| 376 base::Bind(&ErrorAndStateCallback, ¬ify_done_called, | 374 base::Bind(&ErrorAndStateCallback, ¬ify_done_called, |
| 377 ¬ify_done_error, ¬ify_done_sync_state)); | 375 ¬ify_done_error, ¬ify_done_sync_state)); |
| 378 EXPECT_TRUE(notify_done_called); | 376 EXPECT_TRUE(notify_done_called); |
| 379 EXPECT_EQ(BackgroundSyncError::NONE, notify_done_error); | 377 EXPECT_EQ(BackgroundSyncError::NONE, notify_done_error); |
| 380 EXPECT_EQ(BackgroundSyncState::UNREGISTERED, notify_done_sync_state); | 378 EXPECT_EQ(BackgroundSyncState::UNREGISTERED, notify_done_sync_state); |
| 381 } | 379 } |
| 382 | 380 |
| 383 } // namespace content | 381 } // namespace content |
| OLD | NEW |