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

Side by Side Diff: device/device_sensors/sensor_manager_chromeos_unittest.cc

Issue 1164563003: Extract device_sensors to /device via Mojofication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/device_sensors/sensor_manager_chromeos.h" 5 #include "device/device_sensors/sensor_manager_chromeos.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chromeos/accelerometer/accelerometer_types.h" 8 #include "chromeos/accelerometer/accelerometer_types.h"
9 #include "content/common/device_sensors/device_motion_hardware_buffer.h" 9 #include "device/device_sensors/device_motion_hardware_buffer.h"
10 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" 10 #include "device/device_sensors/device_orientation_hardware_buffer.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace { 13 namespace {
14 14
15 const double kMeanGravity = 9.80665; 15 const double kMeanGravity = 9.80665;
16 16
17 // Isolated content::SensorManagerChromeOS from the active 17 // Isolated content::SensorManagerChromeOS from the active
18 // chromeos::AccelerometerReader. This allows for direct control over which 18 // chromeos::AccelerometerReader. This allows for direct control over which
19 // accelerometer events are provided to the sensor manager. 19 // accelerometer events are provided to the sensor manager.
20 class TestSensorManagerChromeOS : public content::SensorManagerChromeOS { 20 class TestSensorManagerChromeOS : public content::SensorManagerChromeOS {
21 public: 21 public:
22 TestSensorManagerChromeOS() {} 22 TestSensorManagerChromeOS() {}
23 ~TestSensorManagerChromeOS() override {}; 23 ~TestSensorManagerChromeOS() override{};
24 24
25 protected: 25 protected:
26 void StartObservingAccelerometer() override {} 26 void StartObservingAccelerometer() override {}
27 void StopObservingAccelerometer() override {} 27 void StopObservingAccelerometer() override {}
28 28
29 private: 29 private:
30 DISALLOW_COPY_AND_ASSIGN(TestSensorManagerChromeOS); 30 DISALLOW_COPY_AND_ASSIGN(TestSensorManagerChromeOS);
31 }; 31 };
32 32
33 } // namespace 33 } // namespace
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 EXPECT_FLOAT_EQ(0.0f, motion->data.accelerationIncludingGravityY); 219 EXPECT_FLOAT_EQ(0.0f, motion->data.accelerationIncludingGravityY);
220 EXPECT_FLOAT_EQ(-kMeanGravity / 2.0f, 220 EXPECT_FLOAT_EQ(-kMeanGravity / 2.0f,
221 motion->data.accelerationIncludingGravityZ); 221 motion->data.accelerationIncludingGravityZ);
222 222
223 DeviceOrientationHardwareBuffer* orientation = orientation_buffer(); 223 DeviceOrientationHardwareBuffer* orientation = orientation_buffer();
224 EXPECT_FLOAT_EQ(0.0f, orientation->data.beta); 224 EXPECT_FLOAT_EQ(0.0f, orientation->data.beta);
225 EXPECT_FLOAT_EQ(45.0f, orientation->data.gamma); 225 EXPECT_FLOAT_EQ(45.0f, orientation->data.gamma);
226 } 226 }
227 227
228 } // namespace content 228 } // namespace content
OLDNEW
« no previous file with comments | « device/device_sensors/sensor_manager_chromeos.cc ('k') | device/device_sensors/type_converters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698