OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_GENERIC_SENSOR_FAKE_PLATFORM_SENSOR_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_FAKE_PLATFORM_SENSOR_H_ |
| 7 |
| 8 #include "device/generic_sensor/platform_sensor.h" |
| 9 |
| 10 namespace device { |
| 11 |
| 12 class FakePlatformSensor : public PlatformSensor { |
| 13 public: |
| 14 FakePlatformSensor(mojom::SensorType type, |
| 15 mojo::ScopedSharedBufferMapping mapping, |
| 16 uint64_t buffer_size, |
| 17 PlatformSensorProvider* provider); |
| 18 |
| 19 mojom::ReportingMode GetReportingMode() override; |
| 20 PlatformSensorConfiguration GetDefaultConfiguration() override; |
| 21 |
| 22 bool started() const { return started_; } |
| 23 |
| 24 using PlatformSensor::NotifySensorReadingChanged; |
| 25 using PlatformSensor::NotifySensorError; |
| 26 using PlatformSensor::config_map; |
| 27 |
| 28 protected: |
| 29 ~FakePlatformSensor() override; |
| 30 bool StartSensor(const PlatformSensorConfiguration& configuration) override; |
| 31 void StopSensor() override; |
| 32 bool CheckSensorConfiguration( |
| 33 const PlatformSensorConfiguration& configuration) override; |
| 34 |
| 35 private: |
| 36 static constexpr double kMaxFrequencyValueForTests = 50.0; |
| 37 |
| 38 PlatformSensorConfiguration config_; |
| 39 |
| 40 bool started_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(FakePlatformSensor); |
| 43 }; |
| 44 |
| 45 } // namespace device |
| 46 |
| 47 #endif // DEVICE_GENERIC_SENSOR_FAKE_PLATFORM_SENSOR_H |
OLD | NEW |