OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | |
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "base/utf_string_conversions.h" | |
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBFactory.h" | |
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebStorageNamespace
.h" | |
12 #include "webkit/glue/webclipboard_impl.h" | |
13 #include "webkit/glue/webfileutilities_impl.h" | |
14 #include "webkit/glue/webkit_glue.h" | |
15 #include "webkit/glue/webkitplatformsupport_impl.h" | |
16 #include "webkit/support/simple_database_system.h" | |
17 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" | |
18 #include "webkit/tools/test_shell/simple_appcache_system.h" | |
19 #include "webkit/tools/test_shell/simple_clipboard_impl.h" | |
20 #include "webkit/tools/test_shell/simple_dom_storage_system.h" | |
21 #include "webkit/tools/test_shell/simple_file_system.h" | |
22 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | |
23 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" | |
24 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" | |
25 #include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h" | |
26 | |
27 #if defined(OS_WIN) | |
28 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" | |
29 #endif | |
30 | |
31 class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { | |
32 public: | |
33 explicit TestShellWebKitInit(bool layout_test_mode); | |
34 virtual ~TestShellWebKitInit(); | |
35 | |
36 virtual WebKit::WebMimeRegistry* mimeRegistry() OVERRIDE; | |
37 virtual WebKit::WebClipboard* clipboard() OVERRIDE; | |
38 virtual WebKit::WebFileUtilities* fileUtilities() OVERRIDE; | |
39 virtual WebKit::WebSandboxSupport* sandboxSupport() OVERRIDE; | |
40 virtual WebKit::WebCookieJar* cookieJar() OVERRIDE; | |
41 virtual WebKit::WebBlobRegistry* blobRegistry() OVERRIDE; | |
42 virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; | |
43 virtual bool sandboxEnabled() OVERRIDE; | |
44 virtual WebKit::Platform::FileHandle databaseOpenFile( | |
45 const WebKit::WebString& vfs_file_name, int desired_flags) OVERRIDE; | |
46 virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, | |
47 bool sync_dir) OVERRIDE; | |
48 virtual long databaseGetFileAttributes( | |
49 const WebKit::WebString& vfs_file_name) OVERRIDE; | |
50 virtual long long databaseGetFileSize( | |
51 const WebKit::WebString& vfs_file_name) OVERRIDE; | |
52 virtual long long databaseGetSpaceAvailableForOrigin( | |
53 const WebKit::WebString& origin_identifier) OVERRIDE; | |
54 virtual unsigned long long visitedLinkHash(const char* canonicalURL, | |
55 size_t length) OVERRIDE; | |
56 virtual bool isLinkVisited(unsigned long long linkHash) OVERRIDE; | |
57 virtual WebKit::WebMessagePortChannel* createMessagePortChannel() OVERRIDE; | |
58 virtual void prefetchHostName(const WebKit::WebString&) OVERRIDE; | |
59 virtual WebKit::WebData loadResource(const char* name) OVERRIDE; | |
60 virtual WebKit::WebString queryLocalizedString( | |
61 WebKit::WebLocalizedString::Name name) OVERRIDE; | |
62 virtual WebKit::WebString queryLocalizedString( | |
63 WebKit::WebLocalizedString::Name name, | |
64 const WebKit::WebString& value) OVERRIDE; | |
65 virtual WebKit::WebString queryLocalizedString( | |
66 WebKit::WebLocalizedString::Name name, | |
67 const WebKit::WebString& value1, | |
68 const WebKit::WebString& value2) OVERRIDE; | |
69 | |
70 virtual WebKit::WebString defaultLocale() OVERRIDE; | |
71 | |
72 virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( | |
73 const WebKit::WebString& path, unsigned quota) OVERRIDE; | |
74 | |
75 virtual WebKit::WebIDBFactory* idbFactory(); | |
76 | |
77 #if defined(OS_WIN) | |
78 void SetThemeEngine(WebKit::WebThemeEngine* engine) { | |
79 active_theme_engine_ = engine ? | |
80 engine : WebKitPlatformSupportImpl::themeEngine(); | |
81 } | |
82 | |
83 virtual WebKit::WebThemeEngine *themeEngine() OVERRIDE { | |
84 return active_theme_engine_; | |
85 } | |
86 #endif | |
87 | |
88 virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( | |
89 const WebKit::WebGraphicsContext3D::Attributes& attributes); | |
90 | |
91 virtual base::string16 GetLocalizedString(int message_id) OVERRIDE; | |
92 virtual base::StringPiece GetDataResource( | |
93 int resource_id, | |
94 ui::ScaleFactor scale_factor) OVERRIDE; | |
95 virtual void GetPlugins(bool refresh, | |
96 std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; | |
97 virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( | |
98 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) | |
99 OVERRIDE; | |
100 virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( | |
101 WebKit::WebSocketStreamHandle* handle, | |
102 webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE; | |
103 | |
104 private: | |
105 scoped_ptr<webkit_glue::SimpleWebMimeRegistryImpl> mime_registry_; | |
106 MockWebClipboardImpl mock_clipboard_; | |
107 SimpleClipboardClient clipboard_client_; | |
108 webkit_glue::WebClipboardImpl real_clipboard_; | |
109 webkit_glue::WebFileUtilitiesImpl file_utilities_; | |
110 base::ScopedTempDir appcache_dir_; | |
111 SimpleAppCacheSystem appcache_system_; | |
112 SimpleDatabaseSystem database_system_; | |
113 SimpleDomStorageSystem dom_storage_system_; | |
114 SimpleWebCookieJarImpl cookie_jar_; | |
115 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; | |
116 SimpleFileSystem file_system_; | |
117 | |
118 #if defined(OS_WIN) | |
119 WebKit::WebThemeEngine* active_theme_engine_; | |
120 #endif | |
121 }; | |
122 | |
123 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | |
OLD | NEW |