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/renderer/device_sensors/device_motion_event_pump.h" | 5 #include "content/renderer/device_sensors/device_motion_event_pump.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
16 #include "content/common/device_sensors/device_motion_hardware_buffer.h" | 16 #include "content/common/device_sensors/device_motion_hardware_buffer.h" |
17 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" | 19 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class MockDeviceMotionListener : public blink::WebDeviceMotionListener { | 23 class MockDeviceMotionListener : public blink::WebDeviceMotionListener { |
24 public: | 24 public: |
25 MockDeviceMotionListener() | 25 MockDeviceMotionListener() |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 base::MessageLoop::current()->Run(); | 202 base::MessageLoop::current()->Run(); |
203 motion_pump()->Stop(); | 203 motion_pump()->Stop(); |
204 | 204 |
205 // Check that the blink::WebDeviceMotionListener does not receive excess | 205 // Check that the blink::WebDeviceMotionListener does not receive excess |
206 // events. | 206 // events. |
207 EXPECT_TRUE(listener()->did_change_device_motion()); | 207 EXPECT_TRUE(listener()->did_change_device_motion()); |
208 EXPECT_GE(6, listener()->number_of_events()); | 208 EXPECT_GE(6, listener()->number_of_events()); |
209 } | 209 } |
210 | 210 |
211 } // namespace content | 211 } // namespace content |
OLD | NEW |