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

Side by Side 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: include what you use 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 unified diff | Download patch
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/support/test_webkit_platform_support.h" 5 #include "webkit/support/test_webkit_platform_support.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/metrics/stats_counters.h" 8 #include "base/metrics/stats_counters.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "media/base/media.h" 13 #include "media/base/media.h"
14 #include "net/base/cookie_monster.h" 14 #include "net/base/cookie_monster.h"
15 #include "net/http/http_cache.h" 15 #include "net/http/http_cache.h"
16 #include "net/test/test_server.h" 16 #include "net/test/test_server.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioDevice.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioDevice.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGamepads.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h"
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h"
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h " 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h "
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa lue.h" 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa lue.h"
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h"
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h" 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat cher.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( 78 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess(
78 WebKit::WebString::fromUTF8("test-shell-resource")); 79 WebKit::WebString::fromUTF8("test-shell-resource"));
79 WebScriptController::enableV8SingleThreadMode(); 80 WebScriptController::enableV8SingleThreadMode();
80 WebKit::WebRuntimeFeatures::enableSockets(true); 81 WebKit::WebRuntimeFeatures::enableSockets(true);
81 WebKit::WebRuntimeFeatures::enableApplicationCache(true); 82 WebKit::WebRuntimeFeatures::enableApplicationCache(true);
82 WebKit::WebRuntimeFeatures::enableDatabase(true); 83 WebKit::WebRuntimeFeatures::enableDatabase(true);
83 WebKit::WebRuntimeFeatures::enableDataTransferItems(true); 84 WebKit::WebRuntimeFeatures::enableDataTransferItems(true);
84 WebKit::WebRuntimeFeatures::enablePushState(true); 85 WebKit::WebRuntimeFeatures::enablePushState(true);
85 WebKit::WebRuntimeFeatures::enableNotifications(true); 86 WebKit::WebRuntimeFeatures::enableNotifications(true);
86 WebKit::WebRuntimeFeatures::enableTouch(true); 87 WebKit::WebRuntimeFeatures::enableTouch(true);
88 WebKit::WebRuntimeFeatures::enableGamepad(true);
87 89
88 // Load libraries for media and enable the media player. 90 // Load libraries for media and enable the media player.
89 bool enable_media = false; 91 bool enable_media = false;
90 FilePath module_path; 92 FilePath module_path;
91 if (PathService::Get(base::DIR_MODULE, &module_path)) { 93 if (PathService::Get(base::DIR_MODULE, &module_path)) {
92 #if defined(OS_MACOSX) 94 #if defined(OS_MACOSX)
93 if (base::mac::AmIBundled()) 95 if (base::mac::AmIBundled())
94 module_path = module_path.DirName().DirName().DirName(); 96 module_path = module_path.DirName().DirName().DirName();
95 #endif 97 #endif
96 if (media::InitializeMediaLibrary(module_path)) 98 if (media::InitializeMediaLibrary(module_path))
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 391
390 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() { 392 size_t TestWebKitPlatformSupport::audioHardwareBufferSize() {
391 return 128; 393 return 128;
392 } 394 }
393 395
394 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice( 396 WebKit::WebAudioDevice* TestWebKitPlatformSupport::createAudioDevice(
395 size_t bufferSize, unsigned numberOfChannels, double sampleRate, 397 size_t bufferSize, unsigned numberOfChannels, double sampleRate,
396 WebKit::WebAudioDevice::RenderCallback*) { 398 WebKit::WebAudioDevice::RenderCallback*) {
397 return new WebAudioDeviceMock(sampleRate); 399 return new WebAudioDeviceMock(sampleRate);
398 } 400 }
401
402 void TestWebKitPlatformSupport::sampleGamepads(WebKit::WebGamepads& data) {
403 data = gamepad_data_;
404 }
405
406 void TestWebKitPlatformSupport::setGamepadData(
407 const WebKit::WebGamepads& data) {
408 gamepad_data_ = data;
409 }
OLDNEW
« no previous file with comments | « webkit/support/test_webkit_platform_support.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698