OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
6 #define DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
7 | 7 |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "device/geolocation/geoposition.h" | 14 #include "content/browser/geolocation/location_provider_base.h" |
15 #include "device/geolocation/location_provider_base.h" | 15 #include "content/public/common/geoposition.h" |
16 | 16 |
17 namespace device { | 17 namespace content { |
18 | 18 |
19 // Mock implementation of a location provider for testing. | 19 // Mock implementation of a location provider for testing. |
20 class MockLocationProvider : public LocationProviderBase { | 20 class MockLocationProvider : public LocationProviderBase { |
21 public: | 21 public: |
22 enum State { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_; | 22 enum State { STOPPED, LOW_ACCURACY, HIGH_ACCURACY } state_; |
23 | 23 |
24 MockLocationProvider(); | 24 MockLocationProvider(); |
25 ~MockLocationProvider() override; | 25 ~MockLocationProvider() override; |
26 | 26 |
27 // Updates listeners with the new position. | 27 // Updates listeners with the new position. |
(...skipping 24 matching lines...) Expand all Loading... |
52 // listeners with a valid location when StartProvider is called. | 52 // listeners with a valid location when StartProvider is called. |
53 LocationProvider* NewAutoSuccessMockLocationProvider(); | 53 LocationProvider* NewAutoSuccessMockLocationProvider(); |
54 // Creates a mock location provider that automatically notifies its | 54 // Creates a mock location provider that automatically notifies its |
55 // listeners with an error when StartProvider is called. | 55 // listeners with an error when StartProvider is called. |
56 LocationProvider* NewAutoFailMockLocationProvider(); | 56 LocationProvider* NewAutoFailMockLocationProvider(); |
57 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of | 57 // Similar to NewAutoSuccessMockLocationProvider but mimicks the behavior of |
58 // the Network Location provider, in deferring making location updates until | 58 // the Network Location provider, in deferring making location updates until |
59 // a permission request has been confirmed. | 59 // a permission request has been confirmed. |
60 LocationProvider* NewAutoSuccessMockNetworkLocationProvider(); | 60 LocationProvider* NewAutoSuccessMockNetworkLocationProvider(); |
61 | 61 |
62 } // namespace device | 62 } // namespace content |
63 | 63 |
64 #endif // DEVICE_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ | 64 #endif // CONTENT_BROWSER_GEOLOCATION_MOCK_LOCATION_PROVIDER_H_ |
OLD | NEW |