OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_client.h" | 5 #include "webkit/support/test_webkit_client.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 extensions_v8::GearsExtension::Get()); | 77 extensions_v8::GearsExtension::Get()); |
78 WebKit::WebRuntimeFeatures::enableSockets(true); | 78 WebKit::WebRuntimeFeatures::enableSockets(true); |
79 WebKit::WebRuntimeFeatures::enableApplicationCache(true); | 79 WebKit::WebRuntimeFeatures::enableApplicationCache(true); |
80 WebKit::WebRuntimeFeatures::enableDatabase(true); | 80 WebKit::WebRuntimeFeatures::enableDatabase(true); |
81 WebKit::WebRuntimeFeatures::enableWebGL(true); | 81 WebKit::WebRuntimeFeatures::enableWebGL(true); |
82 WebKit::WebRuntimeFeatures::enablePushState(true); | 82 WebKit::WebRuntimeFeatures::enablePushState(true); |
83 WebKit::WebRuntimeFeatures::enableNotifications(true); | 83 WebKit::WebRuntimeFeatures::enableNotifications(true); |
84 WebKit::WebRuntimeFeatures::enableTouch(true); | 84 WebKit::WebRuntimeFeatures::enableTouch(true); |
85 | 85 |
86 // Load libraries for media and enable the media player. | 86 // Load libraries for media and enable the media player. |
87 bool enable_media = false; | |
88 FilePath module_path; | 87 FilePath module_path; |
89 if (PathService::Get(base::DIR_MODULE, &module_path)) { | 88 if (PathService::Get(base::DIR_MODULE, &module_path)) { |
90 #if defined(OS_MACOSX) | 89 #if defined(OS_MACOSX) |
91 if (base::mac::AmIBundled()) | 90 if (base::mac::AmIBundled()) |
92 module_path = module_path.DirName().DirName().DirName(); | 91 module_path = module_path.DirName().DirName().DirName(); |
93 #endif | 92 #endif |
94 if (media::InitializeMediaLibrary(module_path)) | 93 media::InitializeMediaLibrary(module_path); |
95 enable_media = true; | |
96 } | 94 } |
97 WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media); | 95 WebKit::WebRuntimeFeatures::enableMediaPlayer( |
98 LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; | 96 media::IsMediaLibraryInitialized()); |
| 97 LOG_IF(WARNING, !media::IsMediaLibraryInitialized()) |
| 98 << "Failed to initialize the media library.\n"; |
99 | 99 |
100 // TODO(joth): Make a dummy geolocation service implemenation for | 100 // TODO(joth): Make a dummy geolocation service implemenation for |
101 // test_shell, and set this to true. http://crbug.com/36451 | 101 // test_shell, and set this to true. http://crbug.com/36451 |
102 WebKit::WebRuntimeFeatures::enableGeolocation(false); | 102 WebKit::WebRuntimeFeatures::enableGeolocation(false); |
103 | 103 |
104 // Construct and initialize an appcache system for this scope. | 104 // Construct and initialize an appcache system for this scope. |
105 // A new empty temp directory is created to house any cached | 105 // A new empty temp directory is created to house any cached |
106 // content during the run. Upon exit that directory is deleted. | 106 // content during the run. Upon exit that directory is deleted. |
107 // If we can't create a tempdir, we'll use in-memory storage. | 107 // If we can't create a tempdir, we'll use in-memory storage. |
108 if (!appcache_dir_.CreateUniqueTempDir()) { | 108 if (!appcache_dir_.CreateUniqueTempDir()) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 349 } |
350 #endif | 350 #endif |
351 | 351 |
352 WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() { | 352 WebKit::WebSharedWorkerRepository* TestWebKitClient::sharedWorkerRepository() { |
353 return NULL; | 353 return NULL; |
354 } | 354 } |
355 | 355 |
356 WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { | 356 WebKit::WebGraphicsContext3D* TestWebKitClient::createGraphicsContext3D() { |
357 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(); | 357 return new webkit::gpu::WebGraphicsContext3DInProcessImpl(); |
358 } | 358 } |
OLD | NEW |