summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authortimvolodine@chromium.org <timvolodine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 17:46:08 +0000
committertimvolodine@chromium.org <timvolodine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-17 17:46:08 +0000
commit70bf1a6bbd3086acb2384dd38b08172f750c135e (patch)
treef8ed5e0c45f024807510775e13185ef12012e2de /content/shell
parent901946125cad78972907668536ccf439838dab01 (diff)
downloadchromium_src-70bf1a6bbd3086acb2384dd38b08172f750c135e.zip
chromium_src-70bf1a6bbd3086acb2384dd38b08172f750c135e.tar.gz
chromium_src-70bf1a6bbd3086acb2384dd38b08172f750c135e.tar.bz2
Add plumbing for platform based Device Motion testing.
This CL implements injection of a mock WebDeviceMotionData into the Platform for testing purposes. Once the mock WebDeviceMotionData is set it will be returned as a one-shot event once Blink registers its DeviceMotionListener through the platform using setDeviceMotionListener method. BUG=135804 Review URL: https://chromiumcodereview.appspot.com/5222955109842944 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/renderer/webkit_test_runner.cc5
-rw-r--r--content/shell/renderer/webkit_test_runner.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc
index d3d77eb..99ffb61 100644
--- a/content/shell/renderer/webkit_test_runner.cc
+++ b/content/shell/renderer/webkit_test_runner.cc
@@ -64,6 +64,7 @@ using WebKit::Platform;
using WebKit::WebArrayBufferView;
using WebKit::WebContextMenuData;
using WebKit::WebDevToolsAgent;
+using WebKit::WebDeviceMotionData;
using WebKit::WebDeviceOrientation;
using WebKit::WebElement;
using WebKit::WebFrame;
@@ -211,6 +212,10 @@ void WebKitTestRunner::setGamepadData(const WebGamepads& gamepads) {
SetMockGamepads(gamepads);
}
+void WebKitTestRunner::setDeviceMotionData(const WebDeviceMotionData& data) {
+ SetMockDeviceMotionData(data);
+}
+
void WebKitTestRunner::printMessage(const std::string& message) {
Send(new ShellViewHostMsg_PrintMessage(routing_id(), message));
}
diff --git a/content/shell/renderer/webkit_test_runner.h b/content/shell/renderer/webkit_test_runner.h
index f5f40d3..0d63e76 100644
--- a/content/shell/renderer/webkit_test_runner.h
+++ b/content/shell/renderer/webkit_test_runner.h
@@ -20,6 +20,7 @@
class SkCanvas;
namespace WebKit {
+class WebDeviceMotionData;
struct WebRect;
}
@@ -51,6 +52,7 @@ class WebKitTestRunner : public RenderViewObserver,
virtual void setEditCommand(const std::string& name,
const std::string& value);
virtual void setGamepadData(const WebKit::WebGamepads& gamepads);
+ virtual void setDeviceMotionData(const WebKit::WebDeviceMotionData& data);
virtual void printMessage(const std::string& message);
virtual void postTask(::WebTestRunner::WebTask* task);
virtual void postDelayedTask(::WebTestRunner::WebTask* task,