| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ |
| 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ |
| 7 | 7 |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.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/stats_counters.h" | 11 #include "base/stats_counters.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "media/base/media.h" | 13 #include "media/base/media.h" |
| 14 #include "webkit/api/public/WebData.h" | 14 #include "webkit/api/public/WebData.h" |
| 15 #include "webkit/api/public/WebRuntimeFeatures.h" |
| 15 #include "webkit/api/public/WebKit.h" | 16 #include "webkit/api/public/WebKit.h" |
| 16 #include "webkit/api/public/WebScriptController.h" | 17 #include "webkit/api/public/WebScriptController.h" |
| 17 #include "webkit/api/public/WebSecurityPolicy.h" | 18 #include "webkit/api/public/WebSecurityPolicy.h" |
| 18 #include "webkit/api/public/WebStorageArea.h" | 19 #include "webkit/api/public/WebStorageArea.h" |
| 19 #include "webkit/api/public/WebStorageEventDispatcher.h" | 20 #include "webkit/api/public/WebStorageEventDispatcher.h" |
| 20 #include "webkit/api/public/WebStorageNamespace.h" | 21 #include "webkit/api/public/WebStorageNamespace.h" |
| 21 #include "webkit/api/public/WebString.h" | 22 #include "webkit/api/public/WebString.h" |
| 22 #include "webkit/api/public/WebURL.h" | 23 #include "webkit/api/public/WebURL.h" |
| 23 #include "webkit/appcache/web_application_cache_host_impl.h" | 24 #include "webkit/appcache/web_application_cache_host_impl.h" |
| 24 #include "webkit/database/vfs_backend.h" | 25 #include "webkit/database/vfs_backend.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 48 WebKit::setLayoutTestMode(layout_test_mode); | 49 WebKit::setLayoutTestMode(layout_test_mode); |
| 49 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( | 50 WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( |
| 50 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); | 51 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); |
| 51 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( | 52 WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( |
| 52 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); | 53 ASCIIToUTF16(webkit_glue::GetUIResourceProtocol())); |
| 53 WebKit::WebScriptController::enableV8SingleThreadMode(); | 54 WebKit::WebScriptController::enableV8SingleThreadMode(); |
| 54 WebKit::WebScriptController::registerExtension( | 55 WebKit::WebScriptController::registerExtension( |
| 55 extensions_v8::GearsExtension::Get()); | 56 extensions_v8::GearsExtension::Get()); |
| 56 WebKit::WebScriptController::registerExtension( | 57 WebKit::WebScriptController::registerExtension( |
| 57 extensions_v8::IntervalExtension::Get()); | 58 extensions_v8::IntervalExtension::Get()); |
| 58 WebKit::enableWebSockets(); | 59 WebKit::WebRuntimeFeatures::enableSockets(true); |
| 59 | 60 |
| 60 // Load libraries for media and enable the media player. | 61 // Load libraries for media and enable the media player. |
| 61 FilePath module_path; | 62 FilePath module_path; |
| 62 if (PathService::Get(base::DIR_MODULE, &module_path) && | 63 WebKit::WebRuntimeFeatures::enableMediaPlayer( |
| 63 media::InitializeMediaLibrary(module_path)) { | 64 PathService::Get(base::DIR_MODULE, &module_path) && |
| 64 WebKit::enableMediaPlayer(); | 65 media::InitializeMediaLibrary(module_path)); |
| 65 } | |
| 66 | 66 |
| 67 // Construct and initialize an appcache system for this scope. | 67 // Construct and initialize an appcache system for this scope. |
| 68 // A new empty temp directory is created to house any cached | 68 // A new empty temp directory is created to house any cached |
| 69 // content during the run. Upon exit that directory is deleted. | 69 // content during the run. Upon exit that directory is deleted. |
| 70 if (appcache_dir_.CreateUniqueTempDir()) | 70 if (appcache_dir_.CreateUniqueTempDir()) |
| 71 SimpleAppCacheSystem::InitializeOnUIThread(appcache_dir_.path()); | 71 SimpleAppCacheSystem::InitializeOnUIThread(appcache_dir_.path()); |
| 72 | 72 |
| 73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
| 74 // Ensure we pick up the default theme engine. | 74 // Ensure we pick up the default theme engine. |
| 75 SetThemeEngine(NULL); | 75 SetThemeEngine(NULL); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 SimpleAppCacheSystem appcache_system_; | 234 SimpleAppCacheSystem appcache_system_; |
| 235 SimpleDatabaseSystem database_system_; | 235 SimpleDatabaseSystem database_system_; |
| 236 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; | 236 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; |
| 237 | 237 |
| 238 #if defined(OS_WIN) | 238 #if defined(OS_WIN) |
| 239 WebKit::WebThemeEngine* active_theme_engine_; | 239 WebKit::WebThemeEngine* active_theme_engine_; |
| 240 #endif | 240 #endif |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | 243 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ |
| OLD | NEW |