OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_android.h" | 5 #include "device/sensors/sensor_manager_android.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "content/browser/device_sensors/device_sensors_consts.h" | 12 #include "device/sensors/device_sensors_consts.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace content { | 15 namespace device { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 class FakeSensorManagerAndroid : public SensorManagerAndroid { | 19 class FakeSensorManagerAndroid : public SensorManagerAndroid { |
20 public: | 20 public: |
21 FakeSensorManagerAndroid() {} | 21 FakeSensorManagerAndroid() {} |
22 ~FakeSensorManagerAndroid() override {} | 22 ~FakeSensorManagerAndroid() override {} |
23 | 23 |
24 OrientationSensorType GetOrientationSensorTypeUsed() override { | 24 OrientationSensorType GetOrientationSensorTypeUsed() override { |
25 return SensorManagerAndroid::ROTATION_VECTOR; | 25 return SensorManagerAndroid::ROTATION_VECTOR; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 sensorManager.GotLight(nullptr, nullptr, 100); | 183 sensorManager.GotLight(nullptr, nullptr, 100); |
184 ASSERT_EQ(100, light_buffer_->data.value); | 184 ASSERT_EQ(100, light_buffer_->data.value); |
185 | 185 |
186 sensorManager.StopFetchingDeviceLightData(); | 186 sensorManager.StopFetchingDeviceLightData(); |
187 ASSERT_EQ(-1, light_buffer_->data.value); | 187 ASSERT_EQ(-1, light_buffer_->data.value); |
188 } | 188 } |
189 | 189 |
190 } // namespace | 190 } // namespace |
191 | 191 |
192 } // namespace content | 192 } // namespace device |
OLD | NEW |