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

Side by Side Diff: content/renderer/device_sensors/device_motion_event_pump_unittest.cc

Issue 2389963003: Move device_sensors cross-process headers out of //content (Closed)
Patch Set: Rebase Created 4 years, 2 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 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/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/threading/thread_task_runner_handle.h" 16 #include "base/threading/thread_task_runner_handle.h"
17 #include "content/common/device_sensors/device_motion_hardware_buffer.h"
18 #include "content/public/test/test_utils.h" 17 #include "content/public/test/test_utils.h"
18 #include "device/sensors/public/cpp/device_motion_hardware_buffer.h"
19 #include "mojo/public/cpp/system/buffer.h" 19 #include "mojo/public/cpp/system/buffer.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h" 21 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h"
22 22
23 namespace content { 23 namespace content {
24 24
25 class MockDeviceMotionListener : public blink::WebDeviceMotionListener { 25 class MockDeviceMotionListener : public blink::WebDeviceMotionListener {
26 public: 26 public:
27 MockDeviceMotionListener() 27 MockDeviceMotionListener()
28 : did_change_device_motion_(false), number_of_events_(0) { 28 : did_change_device_motion_(false), number_of_events_(0) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 base::RunLoop().Run(); 200 base::RunLoop().Run();
201 motion_pump()->Stop(); 201 motion_pump()->Stop();
202 202
203 // Check that the blink::WebDeviceMotionListener does not receive excess 203 // Check that the blink::WebDeviceMotionListener does not receive excess
204 // events. 204 // events.
205 EXPECT_TRUE(listener()->did_change_device_motion()); 205 EXPECT_TRUE(listener()->did_change_device_motion());
206 EXPECT_GE(6, listener()->number_of_events()); 206 EXPECT_GE(6, listener()->number_of_events());
207 } 207 }
208 208
209 } // namespace content 209 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698