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 "device_orientation_event_pump.h" | 5 #include "device_orientation_event_pump.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" |
9 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 11 #include "base/thread_task_runner_handle.h" |
11 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" | 12 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" |
12 #include "content/public/test/test_utils.h" | 13 #include "content/public/test/test_utils.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" | 15 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 class MockDeviceOrientationListener | 19 class MockDeviceOrientationListener |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 FROM_HERE, base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent, | 209 FROM_HERE, base::Bind(&DeviceOrientationEventPumpForTesting::FireEvent, |
209 base::Unretained(orientation_pump()))); | 210 base::Unretained(orientation_pump()))); |
210 base::MessageLoop::current()->Run(); | 211 base::MessageLoop::current()->Run(); |
211 | 212 |
212 EXPECT_TRUE(listener()->did_change_device_orientation()); | 213 EXPECT_TRUE(listener()->did_change_device_orientation()); |
213 EXPECT_EQ(1 + DeviceOrientationEventPump::kOrientationThreshold, | 214 EXPECT_EQ(1 + DeviceOrientationEventPump::kOrientationThreshold, |
214 static_cast<double>(received_data.alpha)); | 215 static_cast<double>(received_data.alpha)); |
215 } | 216 } |
216 | 217 |
217 } // namespace content | 218 } // namespace content |
OLD | NEW |