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

Unified Diff: content/browser/generic_sensor_browsertest.cc

Issue 2921493002: Cleanup generic sensor browsertests (Closed)
Patch Set: cleanup generic sensor browsertests Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/generic_sensor_browsertest.cc
diff --git a/content/browser/generic_sensor_browsertest.cc b/content/browser/generic_sensor_browsertest.cc
index 745cbfea7469294a45f4c1170a4ab7bc0c6f4490..364e3087535d07b01cc3138c86df5c244aa118d8 100644
--- a/content/browser/generic_sensor_browsertest.cc
+++ b/content/browser/generic_sensor_browsertest.cc
@@ -27,10 +27,11 @@ namespace {
class FakeAmbientLightSensor : public device::PlatformSensor {
public:
- FakeAmbientLightSensor(device::mojom::SensorType type,
- mojo::ScopedSharedBufferMapping mapping,
+ FakeAmbientLightSensor(mojo::ScopedSharedBufferMapping mapping,
device::PlatformSensorProvider* provider)
- : PlatformSensor(type, std::move(mapping), provider) {}
+ : PlatformSensor(device::mojom::SensorType::AMBIENT_LIGHT,
+ std::move(mapping),
+ provider) {}
device::mojom::ReportingMode GetReportingMode() override {
return device::mojom::ReportingMode::ON_CHANGE;
@@ -46,7 +47,7 @@ class FakeAmbientLightSensor : public device::PlatformSensor {
return true;
}
- void StopSensor() override{};
+ void StopSensor() override {};
protected:
~FakeAmbientLightSensor() override = default;
@@ -55,9 +56,7 @@ class FakeAmbientLightSensor : public device::PlatformSensor {
return true;
}
device::PlatformSensorConfiguration GetDefaultConfiguration() override {
- device::PlatformSensorConfiguration default_configuration;
- default_configuration.set_frequency(60);
- return default_configuration;
+ return device::PlatformSensorConfiguration(60 /* frequency */);
}
};
@@ -78,7 +77,7 @@ class FakeSensorProvider : public device::PlatformSensorProvider {
switch (type) {
case device::mojom::SensorType::AMBIENT_LIGHT: {
scoped_refptr<device::PlatformSensor> sensor =
- new FakeAmbientLightSensor(type, std::move(mapping), this);
+ new FakeAmbientLightSensor(std::move(mapping), this);
callback.Run(std::move(sensor));
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698