| 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/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "content/browser/geofencing/geofencing_manager.h" | 7 #include "content/browser/geofencing/geofencing_manager.h" |
| 8 #include "content/browser/geofencing/geofencing_service.h" | 8 #include "content/browser/geofencing/geofencing_service.h" |
| 9 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 9 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 bool was_called_; | 86 bool was_called_; |
| 87 GeofencingStatus result_; | 87 GeofencingStatus result_; |
| 88 scoped_refptr<MessageLoopRunner> runner_; | 88 scoped_refptr<MessageLoopRunner> runner_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 void SaveResponseCallback(bool* called, | 91 void SaveResponseCallback(bool* called, |
| 92 int64* store_registration_id, | 92 int64* store_registration_id, |
| 93 ServiceWorkerStatusCode status, | 93 ServiceWorkerStatusCode status, |
| 94 const std::string& status_message, |
| 94 int64 registration_id) { | 95 int64 registration_id) { |
| 95 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); | 96 EXPECT_EQ(SERVICE_WORKER_OK, status) << ServiceWorkerStatusToString(status); |
| 96 *called = true; | 97 *called = true; |
| 97 *store_registration_id = registration_id; | 98 *store_registration_id = registration_id; |
| 98 } | 99 } |
| 99 | 100 |
| 100 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( | 101 ServiceWorkerContextCore::RegistrationCallback MakeRegisteredCallback( |
| 101 bool* called, | 102 bool* called, |
| 102 int64* store_registration_id) { | 103 int64* store_registration_id) { |
| 103 return base::Bind(&SaveResponseCallback, called, store_registration_id); | 104 return base::Bind(&SaveResponseCallback, called, store_registration_id); |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 GEOFENCING_STATUS_OK, kTestGeofencingRegistrationId)); | 504 GEOFENCING_STATUS_OK, kTestGeofencingRegistrationId)); |
| 504 VerifyRegions(worker1_->id(), expected_regions_); | 505 VerifyRegions(worker1_->id(), expected_regions_); |
| 505 | 506 |
| 506 EXPECT_CALL(*service_, UnregisterRegion(kTestGeofencingRegistrationId)); | 507 EXPECT_CALL(*service_, UnregisterRegion(kTestGeofencingRegistrationId)); |
| 507 | 508 |
| 508 manager_->SetMockProvider(GeofencingMockState::SERVICE_AVAILABLE); | 509 manager_->SetMockProvider(GeofencingMockState::SERVICE_AVAILABLE); |
| 509 VerifyRegions(worker1_->id(), RegionMap()); | 510 VerifyRegions(worker1_->id(), RegionMap()); |
| 510 } | 511 } |
| 511 | 512 |
| 512 } // namespace content | 513 } // namespace content |
| OLD | NEW |