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_MOCK_PLATFORM_SENSOR_H_ | |
6 #define DEVICE_GENERIC_SENSOR_MOCK_PLATFORM_SENSOR_H_ | |
7 | |
8 #include "device/generic_sensor/platform_sensor.h" | |
9 | |
10 namespace device { | |
11 | |
12 class MockPlatformSensor : public PlatformSensor { | |
timvolodine
2016/09/13 19:38:53
FakePlatformSensor?
maksims (do not use this acc)
2016/09/16 09:22:19
We better go with Mock names.
| |
13 public: | |
14 MockPlatformSensor(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() { return started_; } | |
Mikhail
2016/09/13 10:31:16
nit: const method
maksims (do not use this acc)
2016/09/16 09:22:19
Done.
| |
23 | |
24 void NotifySensorReadingChanged(); | |
25 void NotifySensorError(); | |
26 | |
27 const ConfigMap& config_map() const { return config_map_; } | |
28 | |
29 protected: | |
30 ~MockPlatformSensor() override; | |
31 bool StartSensor(const PlatformSensorConfiguration& configuration) override; | |
32 void StopSensor() override; | |
33 bool CheckSensorConfiguration( | |
34 const PlatformSensorConfiguration& configuration) override; | |
35 | |
36 private: | |
37 static constexpr double kMaxFrequencyValueForTests = 50.0; | |
38 | |
39 PlatformSensorConfiguration config_; | |
40 | |
41 bool started_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(MockPlatformSensor); | |
44 }; | |
45 | |
46 } // namespace device | |
47 | |
48 #endif /* DEVICE_GENERIC_SENSOR_MOCK_PLATFORM_SENSOR_H_ */ | |
timvolodine
2016/09/13 19:38:52
#endif // DEVICE_GENERIC_SENSOR_MOCK_PLATFORM_SEN
maksims (do not use this acc)
2016/09/16 09:22:19
Done.
| |
OLD | NEW |