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

Unified Diff: webkit/support/test_webkit_platform_support.cc

Issue 8561021: Support setting fake gamepad data from WebKit (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webkit/support/test_webkit_platform_support.cc
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc
index 8db2e944152181d0c007a6b2fd0d8d6433d6cd61..5067681d96f8c51a1a92c9154500faf2e9c54a98 100644
--- a/webkit/support/test_webkit_platform_support.cc
+++ b/webkit/support/test_webkit_platform_support.cc
@@ -19,6 +19,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebGamepads.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
@@ -84,6 +85,7 @@ TestWebKitPlatformSupport::TestWebKitPlatformSupport(bool unit_test_mode)
WebKit::WebRuntimeFeatures::enablePushState(true);
WebKit::WebRuntimeFeatures::enableNotifications(true);
WebKit::WebRuntimeFeatures::enableTouch(true);
+ WebKit::WebRuntimeFeatures::enableGamepad(true);
// Load libraries for media and enable the media player.
bool enable_media = false;
@@ -396,3 +398,12 @@ WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice(
WebKit::WebAudioDevice::RenderCallback*) {
return new WebAudioDeviceMock(sampleRate);
}
+
+void TestWebKitPlatformSupport::sampleGamepads(WebKit::WebGamepads& data) {
+ data = gamepad_data_;
+}
+
+void TestWebKitPlatformSupport::setGamepadData(
+ const WebKit::WebGamepads& data) {
+ gamepad_data_ = data;
+}

Powered by Google App Engine
This is Rietveld 408576698