OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MockWebDeviceMotionHandler_h |
| 6 #define MockWebDeviceMotionHandler_h |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/shared_memory.h" |
| 10 #include "base/time.h" |
| 11 #include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionHand
ler.h" |
| 12 |
| 13 namespace WebKit { |
| 14 class WebDeviceMotionData; |
| 15 class WebDeviceMotionListener; |
| 16 } |
| 17 |
| 18 namespace WebTestRunner { |
| 19 |
| 20 class DeviceMotionSharedMemoryReader; |
| 21 |
| 22 class MockWebDeviceMotionHandler : public WebKit::WebDeviceMotionHandler { |
| 23 public: |
| 24 MockWebDeviceMotionHandler() { } |
| 25 virtual ~MockWebDeviceMotionHandler() { } |
| 26 |
| 27 // Sets the listener to receive updates for device motion data at |
| 28 // regular intervals. |
| 29 virtual void startListeningToDeviceMotion(WebKit::WebDeviceMotionListener*)
OVERRIDE; |
| 30 |
| 31 // Removes the current listener after which it will not receive any updates. |
| 32 virtual void stopListeningToDeviceMotion() OVERRIDE; |
| 33 |
| 34 void fireEvent(WebKit::WebDeviceMotionData&); |
| 35 |
| 36 private: |
| 37 WebKit::WebDeviceMotionListener* m_listener; |
| 38 |
| 39 }; |
| 40 |
| 41 } // namespace WebTestRunner |
| 42 |
| 43 #endif // MockWebDeviceMotionHandler_h |
OLD | NEW |