Index: device/geolocation/fake_location_provider.h |
diff --git a/device/geolocation/mock_location_provider.h b/device/geolocation/fake_location_provider.h |
similarity index 62% |
copy from device/geolocation/mock_location_provider.h |
copy to device/geolocation/fake_location_provider.h |
index b83ed8a407c4645b0ab79dd965ec6e3ff00706a9..ba27e2226f4c2565da25f3c0c1e51f23e23ba6a9 100644 |
--- a/device/geolocation/mock_location_provider.h |
+++ b/device/geolocation/fake_location_provider.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
-#define DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
+#ifndef DEVICE_GEOLOCATION_FAKE_LOCATION_PROVIDER_H_ |
+#define DEVICE_GEOLOCATION_FAKE_LOCATION_PROVIDER_H_ |
#include "base/compiler_specific.h" |
#include "base/macros.h" |
@@ -15,35 +15,35 @@ |
namespace device { |
-// Mock implementation of a location provider for testing. |
-class MockLocationProvider : public LocationProviderBase { |
+// Fake implementation of a location provider for testing. |
+class FakeLocationProvider : public LocationProviderBase { |
public: |
- enum State { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_; |
+ enum State { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_ = STOPPED; |
- MockLocationProvider(); |
- ~MockLocationProvider() override; |
- |
- bool is_started() const { return state_ != STOPPED; } |
- bool is_permission_granted() const { return is_permission_granted_; } |
- const Geoposition& position() const { return position_; } |
+ FakeLocationProvider(); |
+ ~FakeLocationProvider() override; |
// Updates listeners with the new position. |
void HandlePositionChanged(const Geoposition& position); |
+ State state() const { return state_; } |
+ bool is_permission_granted() const { return is_permission_granted_; } |
+ |
// LocationProvider implementation. |
bool StartProvider(bool high_accuracy) override; |
void StopProvider() override; |
const Geoposition& GetPosition() override; |
void OnPermissionGranted() override; |
+ scoped_refptr<base::SingleThreadTaskRunner> provider_task_runner_; |
+ |
private: |
- bool is_permission_granted_; |
+ bool is_permission_granted_ = false; |
Geoposition position_; |
- scoped_refptr<base::SingleThreadTaskRunner> provider_task_runner_; |
- DISALLOW_COPY_AND_ASSIGN(MockLocationProvider); |
+ DISALLOW_COPY_AND_ASSIGN(FakeLocationProvider); |
}; |
} // namespace device |
-#endif // DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
+#endif // DEVICE_GEOLOCATION_FAKE_LOCATION_PROVIDER_H_ |