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 #undef LOG | 5 #undef LOG |
6 | 6 |
7 #include "webkit/tools/test_shell/test_shell.h" | 7 #include "webkit/tools/test_shell/test_shell.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
44 #include "ui/gfx/codec/png_codec.h" | 44 #include "ui/gfx/codec/png_codec.h" |
45 #include "ui/gfx/size.h" | 45 #include "ui/gfx/size.h" |
46 #include "webkit/glue/glue_serialize.h" | 46 #include "webkit/glue/glue_serialize.h" |
47 #include "webkit/glue/user_agent.h" | 47 #include "webkit/glue/user_agent.h" |
48 #include "webkit/glue/webkit_glue.h" | 48 #include "webkit/glue/webkit_glue.h" |
49 #include "webkit/glue/webpreferences.h" | 49 #include "webkit/glue/webpreferences.h" |
50 #include "webkit/plugins/npapi/plugin_list.h" | |
51 #include "webkit/plugins/webplugininfo.h" | |
52 #include "webkit/tools/test_shell/notification_presenter.h" | 50 #include "webkit/tools/test_shell/notification_presenter.h" |
53 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 51 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
54 #include "webkit/tools/test_shell/test_navigation_controller.h" | 52 #include "webkit/tools/test_shell/test_navigation_controller.h" |
55 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" | 53 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
56 #include "webkit/tools/test_shell/test_shell_devtools_client.h" | 54 #include "webkit/tools/test_shell/test_shell_devtools_client.h" |
57 #include "webkit/tools/test_shell/test_shell_request_context.h" | 55 #include "webkit/tools/test_shell/test_shell_request_context.h" |
58 #include "webkit/tools/test_shell/test_shell_switches.h" | 56 #include "webkit/tools/test_shell/test_shell_switches.h" |
59 #include "webkit/tools/test_shell/test_webview_delegate.h" | 57 #include "webkit/tools/test_shell/test_webview_delegate.h" |
60 | 58 |
61 using WebKit::WebCanvas; | 59 using WebKit::WebCanvas; |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 return speech_input_controller_mock_.get(); | 617 return speech_input_controller_mock_.get(); |
620 } | 618 } |
621 | 619 |
622 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { | 620 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { |
623 if (!geolocation_client_mock_.get()) { | 621 if (!geolocation_client_mock_.get()) { |
624 geolocation_client_mock_.reset( | 622 geolocation_client_mock_.reset( |
625 WebKit::WebGeolocationClientMock::create()); | 623 WebKit::WebGeolocationClientMock::create()); |
626 } | 624 } |
627 return geolocation_client_mock_.get(); | 625 return geolocation_client_mock_.get(); |
628 } | 626 } |
629 | |
630 namespace webkit_glue { | |
631 | |
632 void GetPlugins(bool refresh, | |
633 std::vector<webkit::WebPluginInfo>* plugins) { | |
634 if (refresh) | |
635 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); | |
636 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); | |
637 // Don't load the forked TestNetscapePlugIn in the chromium code, use | |
638 // the copy in webkit.org's repository instead. | |
639 const FilePath::StringType kPluginBlackList[] = { | |
640 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), | |
641 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), | |
642 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), | |
643 }; | |
644 for (int i = plugins->size() - 1; i >= 0; --i) { | |
645 webkit::WebPluginInfo plugin_info = plugins->at(i); | |
646 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { | |
647 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { | |
648 plugins->erase(plugins->begin() + i); | |
649 } | |
650 } | |
651 } | |
652 } | |
653 | |
654 } // namespace webkit_glue | |
OLD | NEW |