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

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

Issue 1164563003: Extract device_sensors to /device via Mojofication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 "device_motion_event_pump.h" 5 #include "device_motion_event_pump.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/common/device_sensors/device_motion_hardware_buffer.h"
11 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
11 #include "device/device_sensors/device_motion_hardware_buffer.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h" 13 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 class MockDeviceMotionListener : public blink::WebDeviceMotionListener { 17 class MockDeviceMotionListener : public blink::WebDeviceMotionListener {
18 public: 18 public:
19 MockDeviceMotionListener() 19 MockDeviceMotionListener()
20 : did_change_device_motion_(false), number_of_events_(0) { 20 : did_change_device_motion_(false), number_of_events_(0) {
21 memset(&data_, 0, sizeof(data_)); 21 memset(&data_, 0, sizeof(data_));
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 base::MessageLoop::current()->Run(); 197 base::MessageLoop::current()->Run();
198 motion_pump()->Stop(); 198 motion_pump()->Stop();
199 199
200 // Check that the blink::WebDeviceMotionListener does not receive excess 200 // Check that the blink::WebDeviceMotionListener does not receive excess
201 // events. 201 // events.
202 EXPECT_TRUE(listener()->did_change_device_motion()); 202 EXPECT_TRUE(listener()->did_change_device_motion());
203 EXPECT_GE(6, listener()->number_of_events()); 203 EXPECT_GE(6, listener()->number_of_events());
204 } 204 }
205 205
206 } // namespace content 206 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698