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" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
16 #include "ui/gfx/gl/gl_bindings_skia_in_process.h" | 16 #include "ui/gfx/gl/gl_bindings_skia_in_process.h" |
17 #include "v8/include/v8.h" | 17 #include "v8/include/v8.h" |
| 18 #include "webkit/plugins/npapi/plugin_list.h" |
| 19 #include "webkit/plugins/webplugininfo.h" |
| 20 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" |
18 #include "webkit/tools/test_shell/test_shell.h" | 21 #include "webkit/tools/test_shell/test_shell.h" |
19 | 22 |
20 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
21 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" | 24 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" |
22 #endif | 25 #endif |
23 | 26 |
24 TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode) | 27 TestShellWebKitInit::TestShellWebKitInit(bool layout_test_mode) |
25 : real_clipboard_(&clipboard_client_) { | 28 : real_clipboard_(&clipboard_client_) { |
26 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); | 29 v8::V8::SetCounterFunction(base::StatsTable::FindLocation); |
27 | 30 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 297 |
295 WebKit::WebSharedWorkerRepository* | 298 WebKit::WebSharedWorkerRepository* |
296 TestShellWebKitInit::sharedWorkerRepository() { | 299 TestShellWebKitInit::sharedWorkerRepository() { |
297 return NULL; | 300 return NULL; |
298 } | 301 } |
299 | 302 |
300 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { | 303 WebKit::WebGraphicsContext3D* TestShellWebKitInit::createGraphicsContext3D() { |
301 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 304 return new webkit::gpu::WebGraphicsContext3DInProcessImpl( |
302 gfx::kNullPluginWindow, NULL); | 305 gfx::kNullPluginWindow, NULL); |
303 } | 306 } |
| 307 |
| 308 void TestShellWebKitInit::GetPlugins( |
| 309 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { |
| 310 if (refresh) |
| 311 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
| 312 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); |
| 313 // Don't load the forked TestNetscapePlugIn in the chromium code, use |
| 314 // the copy in webkit.org's repository instead. |
| 315 const FilePath::StringType kPluginBlackList[] = { |
| 316 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), |
| 317 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), |
| 318 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), |
| 319 }; |
| 320 for (int i = plugins->size() - 1; i >= 0; --i) { |
| 321 webkit::WebPluginInfo plugin_info = plugins->at(i); |
| 322 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { |
| 323 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { |
| 324 plugins->erase(plugins->begin() + i); |
| 325 } |
| 326 } |
| 327 } |
| 328 } |
| 329 |
| 330 webkit_glue::ResourceLoaderBridge* |
| 331 TestShellWebKitInit::CreateResourceLoader( |
| 332 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { |
| 333 return SimpleResourceLoaderBridge::Create(request_info); |
| 334 } |
| 335 |
| 336 webkit_glue::WebSocketStreamHandleBridge* |
| 337 TestShellWebKitInit::CreateWebSocketBridge( |
| 338 WebKit::WebSocketStreamHandle* handle, |
| 339 webkit_glue::WebSocketStreamHandleDelegate* delegate) { |
| 340 return SimpleSocketStreamBridge::Create(handle, delegate); |
| 341 } |
OLD | NEW |