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 #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" |
11 #include "base/debug_on_start.h" | 11 #include "base/debug_on_start.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #if defined(OS_MACOSX) | |
15 #include "base/mac_util.h" | |
16 #endif | |
17 #include "base/md5.h" | 14 #include "base/md5.h" |
18 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
19 #include "base/metrics/stats_table.h" | 16 #include "base/metrics/stats_table.h" |
20 #include "base/path_service.h" | 17 #include "base/path_service.h" |
21 #include "base/string_util.h" | 18 #include "base/string_util.h" |
22 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
23 #include "build/build_config.h" | 20 #include "build/build_config.h" |
24 #include "gfx/codec/png_codec.h" | 21 #include "gfx/codec/png_codec.h" |
25 #include "gfx/size.h" | 22 #include "gfx/size.h" |
26 #include "googleurl/src/url_util.h" | 23 #include "googleurl/src/url_util.h" |
27 #include "grit/webkit_strings.h" | 24 #include "grit/webkit_strings.h" |
28 #include "net/base/mime_util.h" | 25 #include "net/base/mime_util.h" |
29 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
30 #include "net/url_request/url_request_file_job.h" | 27 #include "net/url_request/url_request_file_job.h" |
31 #include "net/url_request/url_request_filter.h" | 28 #include "net/url_request/url_request_filter.h" |
32 #include "skia/ext/bitmap_platform_device.h" | 29 #include "skia/ext/bitmap_platform_device.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
34 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
35 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" | 32 #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" |
36 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMo
ck.h" | 33 #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMo
ck.h" |
37 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) | |
38 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" | |
39 #endif | |
40 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock
.h" | 34 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock
.h" |
41 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 35 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
42 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 36 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
43 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" | 37 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" |
44 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 38 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
45 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" |
46 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
47 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 41 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
48 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 42 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
49 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 43 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
50 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 44 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
51 #include "webkit/glue/glue_serialize.h" | 45 #include "webkit/glue/glue_serialize.h" |
52 #include "webkit/glue/plugins/plugin_list.h" | |
53 #include "webkit/glue/plugins/webplugininfo.h" | |
54 #include "webkit/glue/webkit_glue.h" | 46 #include "webkit/glue/webkit_glue.h" |
55 #include "webkit/glue/webpreferences.h" | 47 #include "webkit/glue/webpreferences.h" |
| 48 #include "webkit/plugins/npapi/plugin_list.h" |
| 49 #include "webkit/plugins/npapi/webplugininfo.h" |
56 #include "webkit/tools/test_shell/accessibility_controller.h" | 50 #include "webkit/tools/test_shell/accessibility_controller.h" |
57 #include "webkit/tools/test_shell/notification_presenter.h" | 51 #include "webkit/tools/test_shell/notification_presenter.h" |
58 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 52 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
59 #include "webkit/tools/test_shell/test_navigation_controller.h" | 53 #include "webkit/tools/test_shell/test_navigation_controller.h" |
60 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" | 54 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
61 #include "webkit/tools/test_shell/test_shell_devtools_client.h" | 55 #include "webkit/tools/test_shell/test_shell_devtools_client.h" |
62 #include "webkit/tools/test_shell/test_shell_request_context.h" | 56 #include "webkit/tools/test_shell/test_shell_request_context.h" |
63 #include "webkit/tools/test_shell/test_shell_switches.h" | 57 #include "webkit/tools/test_shell/test_shell_switches.h" |
64 #include "webkit/tools/test_shell/test_webview_delegate.h" | 58 #include "webkit/tools/test_shell/test_webview_delegate.h" |
65 | 59 |
| 60 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
| 61 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" |
| 62 #endif |
| 63 |
| 64 #if defined(OS_MACOSX) |
| 65 #include "base/mac_util.h" |
| 66 #endif |
| 67 |
66 using WebKit::WebCanvas; | 68 using WebKit::WebCanvas; |
67 using WebKit::WebFrame; | 69 using WebKit::WebFrame; |
68 using WebKit::WebNavigationPolicy; | 70 using WebKit::WebNavigationPolicy; |
69 using WebKit::WebRect; | 71 using WebKit::WebRect; |
70 using WebKit::WebScriptController; | 72 using WebKit::WebScriptController; |
71 using WebKit::WebSize; | 73 using WebKit::WebSize; |
72 using WebKit::WebURLRequest; | 74 using WebKit::WebURLRequest; |
73 using WebKit::WebView; | 75 using WebKit::WebView; |
74 | 76 |
75 namespace { | 77 namespace { |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 bool italic, int charset) { | 894 bool italic, int charset) { |
893 return -1; | 895 return -1; |
894 } | 896 } |
895 | 897 |
896 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 898 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
897 size_t* output_length) { | 899 size_t* output_length) { |
898 return false; | 900 return false; |
899 } | 901 } |
900 #endif | 902 #endif |
901 | 903 |
902 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { | 904 void GetPlugins(bool refresh, |
903 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); | 905 std::vector<webkit::npapi::WebPluginInfo>* plugins) { |
| 906 webkit::npapi::PluginList::Singleton()->GetPlugins(refresh, plugins); |
904 // Don't load the forked TestNetscapePlugIn in the chromium code, use | 907 // Don't load the forked TestNetscapePlugIn in the chromium code, use |
905 // the copy in webkit.org's repository instead. | 908 // the copy in webkit.org's repository instead. |
906 const FilePath::StringType kPluginBlackList[] = { | 909 const FilePath::StringType kPluginBlackList[] = { |
907 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), | 910 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), |
908 FILE_PATH_LITERAL("TestNetscapePlugIn.plugin"), | 911 FILE_PATH_LITERAL("TestNetscapePlugIn.plugin"), |
909 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), | 912 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), |
910 }; | 913 }; |
911 for (int i = plugins->size() - 1; i >= 0; --i) { | 914 for (int i = plugins->size() - 1; i >= 0; --i) { |
912 WebPluginInfo plugin_info = plugins->at(i); | 915 webkit::npapi::WebPluginInfo plugin_info = plugins->at(i); |
913 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { | 916 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { |
914 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { | 917 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { |
915 NPAPI::PluginList::Singleton()->DisablePlugin(plugin_info.path); | 918 webkit::npapi::PluginList::Singleton()->DisablePlugin(plugin_info.path); |
916 plugins->erase(plugins->begin() + i); | 919 plugins->erase(plugins->begin() + i); |
917 } | 920 } |
918 } | 921 } |
919 } | 922 } |
920 } | 923 } |
921 | 924 |
922 } // namespace webkit_glue | 925 } // namespace webkit_glue |
OLD | NEW |