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

Side by Side Diff: device/generic_sensor/fake_platform_sensor.h

Issue 2306333002: [sensors] Add Generic Sensor platform unit tests. (Closed)
Patch Set: mock->fake naming Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(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
27 const ConfigMap& config_map() const { return config_map_; }
28
29 protected:
30 ~FakePlatformSensor() 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(FakePlatformSensor);
44 };
45
46 } // namespace device
47
48 #endif // DEVICE_GENERIC_SENSOR_FAKE_PLATFORM_SENSOR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698