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

Unified Diff: device/geolocation/mock_location_provider.h

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: In response to Wez's #73-75 comments. 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
Index: device/geolocation/mock_location_provider.h
diff --git a/device/geolocation/mock_location_provider.h b/device/geolocation/mock_location_provider.h
index c3357103f03ebc35c7c8430d2c259af9f23594c6..a8a3ccfd64d43c17f22e1caab95b89fca2ade115 100644
--- a/device/geolocation/mock_location_provider.h
+++ b/device/geolocation/mock_location_provider.h
@@ -23,41 +23,27 @@ class MockLocationProvider : public LocationProviderBase {
MockLocationProvider();
~MockLocationProvider() override;
+ bool is_started() const { return state_ != STOPPED; }
+ bool is_permission_granted() { return is_permission_granted_; }
Wez 2016/08/24 04:13:17 nit: This should also be a const getter
CJ 2016/08/24 21:32:05 Done.
+ const Geoposition& position() { return position_; }
Wez 2016/08/24 04:13:17 As should this.
CJ 2016/08/24 21:32:05 Done.
+
// Updates listeners with the new position.
void HandlePositionChanged(const Geoposition& position);
// LocationProvider implementation.
bool StartProvider(bool high_accuracy) override;
void StopProvider() override;
- void GetPosition(Geoposition* position) override;
+ const Geoposition& GetPosition() override;
void OnPermissionGranted() override;
+ private:
bool is_permission_granted_;
Geoposition position_;
scoped_refptr<base::SingleThreadTaskRunner> provider_task_runner_;
- private:
DISALLOW_COPY_AND_ASSIGN(MockLocationProvider);
};
-// Factory functions for the various sorts of mock location providers,
-// for use with LocationArbitrator::SetProviderFactoryForTest (i.e.
-// not intended for test code to use to get access to the mock, you can use
-// MockLocationProvider::instance_ for this, or make a custom factory method).
-
-// Creates a mock location provider with no default behavior.
-LocationProvider* NewMockLocationProvider();
-// Creates a mock location provider that automatically notifies its
-// listeners with a valid location when StartProvider is called.
-LocationProvider* NewAutoSuccessMockLocationProvider();
-// Creates a mock location provider that automatically notifies its
-// listeners with an error when StartProvider is called.
-LocationProvider* NewAutoFailMockLocationProvider();
-// Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of
-// the Network Location provider, in deferring making location updates until
-// a permission request has been confirmed.
-LocationProvider* NewAutoSuccessMockNetworkLocationProvider();
-
} // namespace device
#endif // DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698