Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2521)

Unified Diff: device/geolocation/fake_location_provider.h

Issue 2161223003: Adds GeolocationFeature for Blimp Geolocation project. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@engine_feature_prep
Patch Set: More merging. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/geolocation/BUILD.gn ('k') | device/geolocation/fake_location_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « device/geolocation/BUILD.gn ('k') | device/geolocation/fake_location_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698