diff options
-rw-r--r-- | webkit/support/test_webkit_platform_support.cc | 11 | ||||
-rw-r--r-- | webkit/support/test_webkit_platform_support.h | 7 | ||||
-rw-r--r-- | webkit/support/webkit_support.cc | 4 | ||||
-rw-r--r-- | webkit/support/webkit_support.h | 5 |
4 files changed, 26 insertions, 1 deletions
diff --git a/webkit/support/test_webkit_platform_support.cc b/webkit/support/test_webkit_platform_support.cc index 8db2e94..5067681 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; +} diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h index b774afb..ab6fedf 100644 --- a/webkit/support/test_webkit_platform_support.h +++ b/webkit/support/test_webkit_platform_support.h @@ -1,10 +1,11 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ #define WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ +#include "third_party/WebKit/Source/WebKit/chromium/public/WebGamepads.h" #include "webkit/glue/webfileutilities_impl.h" #include "webkit/glue/webkitplatformsupport_impl.h" #include "webkit/support/simple_database_system.h" @@ -103,6 +104,9 @@ class TestWebKitPlatformSupport : unsigned numberOfChannels, double sampleRate, WebKit::WebAudioDevice::RenderCallback*); + virtual void sampleGamepads(WebKit::WebGamepads& data); + void setGamepadData(const WebKit::WebGamepads& data); + private: TestShellWebMimeRegistryImpl mime_registry_; MockWebClipboardImpl mock_clipboard_; @@ -116,6 +120,7 @@ class TestWebKitPlatformSupport : ScopedTempDir file_system_root_; WebURLLoaderMockFactory url_loader_factory_; bool unit_test_mode_; + WebKit::WebGamepads gamepad_data_; #if defined(OS_WIN) || defined(OS_MACOSX) WebKit::WebThemeEngine* active_theme_engine_; diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index ae33a1c..e83a935 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -646,4 +646,8 @@ void EnableWebCoreLogChannels(const std::string& channels) { webkit_glue::EnableWebCoreLogChannels(channels); } +void SetGamepadData(const WebKit::WebGamepads& pads) { + test_environment->webkit_platform_support()->setGamepadData(pads); +} + } // namespace webkit_support diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index 50462f2..e9a7c59 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -18,6 +18,7 @@ class WebApplicationCacheHost; class WebApplicationCacheHostClient; class WebFileSystemCallbacks; class WebFrame; +class WebGamepads; class WebKitPlatformSupport; class WebMediaPlayer; class WebMediaPlayerClient; @@ -221,6 +222,10 @@ double GetForegroundTabTimerInterval(); void EnableWebCoreLogChannels(const std::string& channels); +// - Gamepad + +void SetGamepadData(const WebKit::WebGamepads& pads); + } // namespace webkit_support #endif // WEBKIT_SUPPORT_WEBKIT_SUPPORT_H_ |