| 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 #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/compiler_specific.h" |
| 8 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h
" |
| 14 #include "webkit/glue/webclipboard_impl.h" | 15 #include "webkit/glue/webclipboard_impl.h" |
| 15 #include "webkit/glue/webfileutilities_impl.h" | 16 #include "webkit/glue/webfileutilities_impl.h" |
| 16 #include "webkit/glue/webkit_glue.h" | 17 #include "webkit/glue/webkit_glue.h" |
| 17 #include "webkit/glue/webkitplatformsupport_impl.h" | 18 #include "webkit/glue/webkitplatformsupport_impl.h" |
| 18 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 19 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
| 19 #include "webkit/support/simple_database_system.h" | 20 #include "webkit/support/simple_database_system.h" |
| 20 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" | 21 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" |
| 21 #include "webkit/tools/test_shell/simple_appcache_system.h" | 22 #include "webkit/tools/test_shell/simple_appcache_system.h" |
| 22 #include "webkit/tools/test_shell/simple_file_system.h" | 23 #include "webkit/tools/test_shell/simple_file_system.h" |
| 23 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 24 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
| 24 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" | 25 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" |
| 25 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" | 26 #include "webkit/tools/test_shell/test_shell_webblobregistry_impl.h" |
| 26 #include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h" | 27 #include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h" |
| 27 | 28 |
| 28 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
| 29 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" | 30 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { | 33 class TestShellWebKitInit : public webkit_glue::WebKitPlatformSupportImpl { |
| 33 public: | 34 public: |
| 34 explicit TestShellWebKitInit(bool layout_test_mode); | 35 explicit TestShellWebKitInit(bool layout_test_mode); |
| 35 virtual ~TestShellWebKitInit(); | 36 virtual ~TestShellWebKitInit(); |
| 36 | 37 |
| 37 virtual WebKit::WebMimeRegistry* mimeRegistry(); | 38 virtual WebKit::WebMimeRegistry* mimeRegistry() OVERRIDE; |
| 38 virtual WebKit::WebClipboard* clipboard(); | 39 virtual WebKit::WebClipboard* clipboard() OVERRIDE; |
| 39 virtual WebKit::WebFileUtilities* fileUtilities(); | 40 virtual WebKit::WebFileUtilities* fileUtilities() OVERRIDE; |
| 40 virtual WebKit::WebSandboxSupport* sandboxSupport(); | 41 virtual WebKit::WebSandboxSupport* sandboxSupport() OVERRIDE; |
| 41 virtual WebKit::WebCookieJar* cookieJar(); | 42 virtual WebKit::WebCookieJar* cookieJar() OVERRIDE; |
| 42 virtual WebKit::WebBlobRegistry* blobRegistry(); | 43 virtual WebKit::WebBlobRegistry* blobRegistry() OVERRIDE; |
| 43 virtual WebKit::WebFileSystem* fileSystem(); | 44 virtual WebKit::WebFileSystem* fileSystem() OVERRIDE; |
| 44 virtual bool sandboxEnabled(); | 45 virtual bool sandboxEnabled() OVERRIDE; |
| 45 virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( | 46 virtual WebKit::WebKitPlatformSupport::FileHandle databaseOpenFile( |
| 46 const WebKit::WebString& vfs_file_name, int desired_flags); | 47 const WebKit::WebString& vfs_file_name, int desired_flags) OVERRIDE; |
| 47 virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, | 48 virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, |
| 48 bool sync_dir); | 49 bool sync_dir) OVERRIDE; |
| 49 virtual long databaseGetFileAttributes( | 50 virtual long databaseGetFileAttributes( |
| 50 const WebKit::WebString& vfs_file_name); | 51 const WebKit::WebString& vfs_file_name) OVERRIDE; |
| 51 virtual long long databaseGetFileSize( | 52 virtual long long databaseGetFileSize( |
| 52 const WebKit::WebString& vfs_file_name); | 53 const WebKit::WebString& vfs_file_name) OVERRIDE; |
| 53 virtual long long databaseGetSpaceAvailableForOrigin( | 54 virtual long long databaseGetSpaceAvailableForOrigin( |
| 54 const WebKit::WebString& origin_identifier); | 55 const WebKit::WebString& origin_identifier) OVERRIDE; |
| 55 virtual unsigned long long visitedLinkHash(const char* canonicalURL, | 56 virtual unsigned long long visitedLinkHash(const char* canonicalURL, |
| 56 size_t length); | 57 size_t length) OVERRIDE; |
| 57 virtual bool isLinkVisited(unsigned long long linkHash); | 58 virtual bool isLinkVisited(unsigned long long linkHash) OVERRIDE; |
| 58 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); | 59 virtual WebKit::WebMessagePortChannel* createMessagePortChannel() OVERRIDE; |
| 59 virtual void prefetchHostName(const WebKit::WebString&); | 60 virtual void prefetchHostName(const WebKit::WebString&) OVERRIDE; |
| 60 virtual WebKit::WebData loadResource(const char* name); | 61 virtual WebKit::WebData loadResource(const char* name) OVERRIDE; |
| 61 virtual WebKit::WebString queryLocalizedString( | 62 virtual WebKit::WebString queryLocalizedString( |
| 62 WebKit::WebLocalizedString::Name name); | 63 WebKit::WebLocalizedString::Name name) OVERRIDE; |
| 63 virtual WebKit::WebString queryLocalizedString( | |
| 64 WebKit::WebLocalizedString::Name name, const WebKit::WebString& value); | |
| 65 virtual WebKit::WebString queryLocalizedString( | 64 virtual WebKit::WebString queryLocalizedString( |
| 66 WebKit::WebLocalizedString::Name name, | 65 WebKit::WebLocalizedString::Name name, |
| 67 const WebKit::WebString& value1, const WebKit::WebString& value2); | 66 const WebKit::WebString& value) OVERRIDE; |
| 67 virtual WebKit::WebString queryLocalizedString( |
| 68 WebKit::WebLocalizedString::Name name, |
| 69 const WebKit::WebString& value1, |
| 70 const WebKit::WebString& value2) OVERRIDE; |
| 68 | 71 |
| 69 virtual WebKit::WebString defaultLocale(); | 72 virtual WebKit::WebString defaultLocale() OVERRIDE; |
| 70 | 73 |
| 71 virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( | 74 virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( |
| 72 const WebKit::WebString& path, unsigned quota); | 75 const WebKit::WebString& path, unsigned quota) OVERRIDE; |
| 73 | 76 |
| 74 virtual void dispatchStorageEvent(const WebKit::WebString& key, | 77 virtual void dispatchStorageEvent(const WebKit::WebString& key, |
| 75 const WebKit::WebString& old_value, | 78 const WebKit::WebString& old_value, |
| 76 const WebKit::WebString& new_value, | 79 const WebKit::WebString& new_value, |
| 77 const WebKit::WebString& origin, | 80 const WebKit::WebString& origin, |
| 78 const WebKit::WebURL& url, | 81 const WebKit::WebURL& url, |
| 79 bool is_local_storage); | 82 bool is_local_storage) OVERRIDE; |
| 80 virtual WebKit::WebIDBFactory* idbFactory(); | 83 virtual WebKit::WebIDBFactory* idbFactory() OVERRIDE; |
| 81 | 84 |
| 82 virtual void createIDBKeysFromSerializedValuesAndKeyPath( | 85 virtual void createIDBKeysFromSerializedValuesAndKeyPath( |
| 83 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, | 86 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values, |
| 84 const WebKit::WebString& keyPath, | 87 const WebKit::WebString& keyPath, |
| 85 WebKit::WebVector<WebKit::WebIDBKey>& keys_out); | 88 WebKit::WebVector<WebKit::WebIDBKey>& keys_out) OVERRIDE; |
| 86 | 89 |
| 87 virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue( | 90 virtual WebKit::WebSerializedScriptValue injectIDBKeyIntoSerializedValue( |
| 88 const WebKit::WebIDBKey& key, | 91 const WebKit::WebIDBKey& key, |
| 89 const WebKit::WebSerializedScriptValue& value, | 92 const WebKit::WebSerializedScriptValue& value, |
| 90 const WebKit::WebString& keyPath); | 93 const WebKit::WebString& keyPath) OVERRIDE; |
| 91 | 94 |
| 92 | 95 |
| 93 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
| 94 void SetThemeEngine(WebKit::WebThemeEngine* engine) { | 97 void SetThemeEngine(WebKit::WebThemeEngine* engine) { |
| 95 active_theme_engine_ = engine ? | 98 active_theme_engine_ = engine ? |
| 96 engine : WebKitPlatformSupportImpl::themeEngine(); | 99 engine : WebKitPlatformSupportImpl::themeEngine(); |
| 97 } | 100 } |
| 98 | 101 |
| 99 virtual WebKit::WebThemeEngine *themeEngine() { | 102 virtual WebKit::WebThemeEngine *themeEngine() OVERRIDE { |
| 100 return active_theme_engine_; | 103 return active_theme_engine_; |
| 101 } | 104 } |
| 102 #endif | 105 #endif |
| 103 | 106 |
| 104 virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository(); | 107 virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository() OVERRIDE; |
| 105 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D(); | 108 virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D() OVERRIDE; |
| 109 |
| 110 virtual string16 GetLocalizedString(int message_id) OVERRIDE; |
| 111 virtual base::StringPiece GetDataResource(int resource_id) OVERRIDE; |
| 112 virtual void GetPlugins(bool refresh, |
| 113 std::vector<webkit::WebPluginInfo>* plugins) OVERRIDE; |
| 114 virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( |
| 115 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) |
| 116 OVERRIDE; |
| 117 virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( |
| 118 WebKit::WebSocketStreamHandle* handle, |
| 119 webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE; |
| 106 | 120 |
| 107 private: | 121 private: |
| 108 scoped_ptr<webkit_glue::SimpleWebMimeRegistryImpl> mime_registry_; | 122 scoped_ptr<webkit_glue::SimpleWebMimeRegistryImpl> mime_registry_; |
| 109 MockWebClipboardImpl mock_clipboard_; | 123 MockWebClipboardImpl mock_clipboard_; |
| 110 webkit_glue::WebClipboardImpl real_clipboard_; | 124 webkit_glue::WebClipboardImpl real_clipboard_; |
| 111 webkit_glue::WebFileUtilitiesImpl file_utilities_; | 125 webkit_glue::WebFileUtilitiesImpl file_utilities_; |
| 112 ScopedTempDir appcache_dir_; | 126 ScopedTempDir appcache_dir_; |
| 113 SimpleAppCacheSystem appcache_system_; | 127 SimpleAppCacheSystem appcache_system_; |
| 114 SimpleDatabaseSystem database_system_; | 128 SimpleDatabaseSystem database_system_; |
| 115 SimpleWebCookieJarImpl cookie_jar_; | 129 SimpleWebCookieJarImpl cookie_jar_; |
| 116 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; | 130 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; |
| 117 SimpleFileSystem file_system_; | 131 SimpleFileSystem file_system_; |
| 118 | 132 |
| 119 #if defined(OS_WIN) | 133 #if defined(OS_WIN) |
| 120 WebKit::WebThemeEngine* active_theme_engine_; | 134 WebKit::WebThemeEngine* active_theme_engine_; |
| 121 #endif | 135 #endif |
| 122 }; | 136 }; |
| 123 | 137 |
| 124 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ | 138 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ |
| OLD | NEW |