Index: content/browser/geofencing/mock_geofencing_service.h |
diff --git a/content/browser/geofencing/mock_geofencing_service.h b/content/browser/geofencing/mock_geofencing_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aa9aa4f7ee97d3c8bafb77702d609f741ef39fe1 |
--- /dev/null |
+++ b/content/browser/geofencing/mock_geofencing_service.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |
+#define CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |
+ |
+#include <map> |
+ |
+#include "content/browser/geofencing/geofencing_service.h" |
+ |
+namespace content { |
+ |
+class MockGeofencingService : public GeofencingService { |
+ public: |
+ MockGeofencingService(bool service_available); |
+ ~MockGeofencingService() override; |
+ |
+ void SetMockPosition(double latitude, double longitude); |
+ |
+ bool IsServiceAvailable() override; |
+ int64 RegisterRegion(const blink::WebCircularGeofencingRegion& region, |
+ GeofencingRegistrationDelegate* delegate) override; |
+ void UnregisterRegion(int64 geofencing_registration_id) override; |
+ |
+ private: |
+ struct Registration; |
+ |
+ bool available_; |
+ std::map<int64, Registration> registrations_; |
+ int64 next_id_; |
+ bool has_position_; |
+ double last_latitude_; |
+ double last_longitude_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ |