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

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

Issue 2306333002: [sensors] Add Generic Sensor platform unit tests. (Closed)
Patch Set: Generic Sensor Unittest 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_MOCK_PLATFORM_SENSOR_H_
6 #define DEVICE_GENERIC_SENSOR_MOCK_PLATFORM_SENSOR_H_
7
8 #include "device/generic_sensor/platform_sensor.h"
9
10 #include "base/memory/singleton.h"
shalamov 2016/09/07 09:53:01 Is this needed?
maksims (do not use this acc) 2016/09/09 10:39:05 Put it in wrong header.
11
12 namespace device {
13
14 class MockPlatformSensor : public PlatformSensor {
15 public:
16 MockPlatformSensor(mojom::SensorType type,
17 mojo::ScopedSharedBufferMapping mapping,
18 uint64_t buffer_size,
19 PlatformSensorProvider* provider);
20
21 mojom::ReportingMode GetReportingMode() override;
22 PlatformSensorConfiguration GetDefaultConfiguration() override;
23
24 bool IsStarted() { return started_; }
Mikhail 2016/09/07 10:46:19 bool started() const {}
maksims (do not use this acc) 2016/09/09 10:39:05 Done.
25
26 void NotifySensorReadingChanged();
27 void NotifySensorError();
28
29 const ConfigMap& GetConfigMap() { return config_map_; }
Mikhail 2016/09/07 10:46:19 const ConfigMap& config_map() const {}
maksims (do not use this acc) 2016/09/09 10:39:06 Done.
30
31 protected:
32 ~MockPlatformSensor() override;
33 bool StartSensor(const PlatformSensorConfiguration& configuration) override;
34 void StopSensor() override;
35 bool CheckSensorConfiguration(
36 const PlatformSensorConfiguration& configuration) override;
37
38 private:
39 static constexpr double kMaxFrequencyValue = 50.0;
Mikhail 2016/09/07 10:46:19 why not use PlatformSensorConfiguration::kMaxAllow
maksims (do not use this acc) 2016/09/09 10:39:05 I though a bit different way. PlatformSensorConfig
40
41 PlatformSensorConfiguration config_;
42
43 bool started_;
44
45 DISALLOW_COPY_AND_ASSIGN(MockPlatformSensor);
46 };
47
48 } // namespace device
49
50 #endif /* DEVICE_GENERIC_SENSOR_MOCK_PLATFORM_SENSOR_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698