| OLD | NEW |
| 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/tools/test_shell/test_shell_webkit_init.h" | 5 #include "webkit/tools/test_shell/test_shell_webkit_init.h" |
| 6 | 6 |
| 7 #include "base/metrics/stats_counters.h" | 7 #include "base/metrics/stats_counters.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "media/base/media.h" | 9 #include "media/base/media.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // TODO(hwennborg): Enable this once the implementation supports it. | 46 // TODO(hwennborg): Enable this once the implementation supports it. |
| 47 WebKit::WebRuntimeFeatures::enableDeviceMotion(false); | 47 WebKit::WebRuntimeFeatures::enableDeviceMotion(false); |
| 48 WebKit::WebRuntimeFeatures::enableDeviceOrientation(true); | 48 WebKit::WebRuntimeFeatures::enableDeviceOrientation(true); |
| 49 | 49 |
| 50 // Enable experimental I18N API for testing. | 50 // Enable experimental I18N API for testing. |
| 51 WebKit::WebRuntimeFeatures::enableJavaScriptI18NAPI(true); | 51 WebKit::WebRuntimeFeatures::enableJavaScriptI18NAPI(true); |
| 52 | 52 |
| 53 // Load libraries for media and enable the media player. | 53 // Load libraries for media and enable the media player. |
| 54 FilePath module_path; | 54 FilePath module_path; |
| 55 if (PathService::Get(base::DIR_MODULE, &module_path)) |
| 56 media::InitializeMediaLibrary(module_path); |
| 55 WebKit::WebRuntimeFeatures::enableMediaPlayer( | 57 WebKit::WebRuntimeFeatures::enableMediaPlayer( |
| 56 PathService::Get(base::DIR_MODULE, &module_path) && | 58 media::IsMediaLibraryInitialized()); |
| 57 media::InitializeMediaLibrary(module_path)); | |
| 58 | 59 |
| 59 WebKit::WebRuntimeFeatures::enableGeolocation(true); | 60 WebKit::WebRuntimeFeatures::enableGeolocation(true); |
| 60 | 61 |
| 61 // Construct and initialize an appcache system for this scope. | 62 // Construct and initialize an appcache system for this scope. |
| 62 // A new empty temp directory is created to house any cached | 63 // A new empty temp directory is created to house any cached |
| 63 // content during the run. Upon exit that directory is deleted. | 64 // content during the run. Upon exit that directory is deleted. |
| 64 // If we can't create a tempdir, we'll use in-memory storage. | 65 // If we can't create a tempdir, we'll use in-memory storage. |
| 65 if (!appcache_dir_.CreateUniqueTempDir()) { | 66 if (!appcache_dir_.CreateUniqueTempDir()) { |
| 66 LOG(WARNING) << "Failed to create a temp dir for the appcache, " | 67 LOG(WARNING) << "Failed to create a temp dir for the appcache, " |
| 67 "using in-memory storage."; | 68 "using in-memory storage."; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 288 } |
| 288 | 289 |
| 289 WebKit::WebSharedWorkerRepository* | 290 WebKit::WebSharedWorkerRepository* |
| 290 TestShellWebKitInit::sharedWorkerRepository() { | 291 TestShellWebKitInit::sharedWorkerRepository() { |
| 291 return NULL; | 292 return NULL; |
| 292 } | 293 } |
| 293 | 294 |
| 294 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { | 295 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { |
| 295 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(); | 296 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(); |
| 296 } | 297 } |
| OLD | NEW |