Index: Tools/DumpRenderTree/chromium/TestRunner/src/MockWebDeviceMotionHandler.h |
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebDeviceMotionHandler.h b/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebDeviceMotionHandler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..26e49496dd7306c5d4e8d62c585813a12992a744 |
--- /dev/null |
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebDeviceMotionHandler.h |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MockWebDeviceMotionHandler_h |
+#define MockWebDeviceMotionHandler_h |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/shared_memory.h" |
+#include "base/time.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionHandler.h" |
+ |
+namespace WebKit { |
+class WebDeviceMotionData; |
+class WebDeviceMotionListener; |
+} |
+ |
+namespace WebTestRunner { |
+ |
+class DeviceMotionSharedMemoryReader; |
+ |
+class MockWebDeviceMotionHandler : public WebKit::WebDeviceMotionHandler { |
+public: |
+ MockWebDeviceMotionHandler() { } |
+ virtual ~MockWebDeviceMotionHandler() { } |
+ |
+ // Sets the listener to receive updates for device motion data at |
+ // regular intervals. |
+ virtual void startListeningToDeviceMotion(WebKit::WebDeviceMotionListener*) OVERRIDE; |
+ |
+ // Removes the current listener after which it will not receive any updates. |
+ virtual void stopListeningToDeviceMotion() OVERRIDE; |
+ |
+ void fireEvent(WebKit::WebDeviceMotionData&); |
+ |
+private: |
+ WebKit::WebDeviceMotionListener* m_listener; |
+ |
+}; |
+ |
+} // namespace WebTestRunner |
+ |
+#endif // MockWebDeviceMotionHandler_h |