OLD | NEW |
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 "content/browser/device_sensors/sensor_manager_chromeos.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
8 #include "chromeos/accelerometer/accelerometer_types.h" | 9 #include "chromeos/accelerometer/accelerometer_types.h" |
9 #include "content/common/device_sensors/device_motion_hardware_buffer.h" | 10 #include "content/common/device_sensors/device_motion_hardware_buffer.h" |
10 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" | 11 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 const double kMeanGravity = -9.80665; | 16 const double kMeanGravity = -9.80665; |
16 | 17 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 EXPECT_FLOAT_EQ(0.0f, motion->data.accelerationIncludingGravityY); | 220 EXPECT_FLOAT_EQ(0.0f, motion->data.accelerationIncludingGravityY); |
220 EXPECT_FLOAT_EQ(-kMeanGravity / 2.0f, | 221 EXPECT_FLOAT_EQ(-kMeanGravity / 2.0f, |
221 motion->data.accelerationIncludingGravityZ); | 222 motion->data.accelerationIncludingGravityZ); |
222 | 223 |
223 DeviceOrientationHardwareBuffer* orientation = orientation_buffer(); | 224 DeviceOrientationHardwareBuffer* orientation = orientation_buffer(); |
224 EXPECT_FLOAT_EQ(0.0f, orientation->data.beta); | 225 EXPECT_FLOAT_EQ(0.0f, orientation->data.beta); |
225 EXPECT_FLOAT_EQ(45.0f, orientation->data.gamma); | 226 EXPECT_FLOAT_EQ(45.0f, orientation->data.gamma); |
226 } | 227 } |
227 | 228 |
228 } // namespace content | 229 } // namespace content |
OLD | NEW |