| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ | 5 #ifndef WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
| 6 #define WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ | 6 #define WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/files/scoped_temp_dir.h" |
| 9 #include "third_party/WebKit/public/platform/WebGamepads.h" | 10 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 10 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 11 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 11 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" | 12 #include "third_party/WebKit/public/platform/WebUnitTestSupport.h" |
| 12 #include "webkit/child/webkitplatformsupport_child_impl.h" | 13 #include "webkit/child/webkitplatformsupport_child_impl.h" |
| 13 #include "webkit/glue/simple_webmimeregistry_impl.h" | 14 #include "webkit/glue/simple_webmimeregistry_impl.h" |
| 14 #include "webkit/glue/webfileutilities_impl.h" | 15 #include "webkit/glue/webfileutilities_impl.h" |
| 15 #include "webkit/mocks/mock_webhyphenator.h" | 16 #include "webkit/mocks/mock_webhyphenator.h" |
| 16 #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" | 17 #include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" |
| 17 #include "webkit/support/mock_webclipboard_impl.h" | 18 #include "webkit/support/mock_webclipboard_impl.h" |
| 18 #include "webkit/support/simple_appcache_system.h" | |
| 19 #include "webkit/support/simple_database_system.h" | |
| 20 #include "webkit/support/simple_dom_storage_system.h" | |
| 21 #include "webkit/support/simple_file_system.h" | |
| 22 #include "webkit/support/simple_webcookiejar_impl.h" | |
| 23 #include "webkit/support/weburl_loader_mock_factory.h" | 19 #include "webkit/support/weburl_loader_mock_factory.h" |
| 24 | 20 |
| 25 class TestShellWebBlobRegistryImpl; | 21 class TestShellWebBlobRegistryImpl; |
| 26 | 22 |
| 27 namespace cc { | 23 namespace cc { |
| 28 class ContextProvider; | 24 class ContextProvider; |
| 29 } | 25 } |
| 30 | 26 |
| 31 namespace WebKit { | 27 namespace WebKit { |
| 32 class WebAudioDevice; | 28 class WebAudioDevice; |
| 33 class WebGraphicsContext3DProvider; | 29 class WebGraphicsContext3DProvider; |
| 34 class WebLayerTreeView; | 30 class WebLayerTreeView; |
| 35 } | 31 } |
| 36 | 32 |
| 37 // An implementation of WebKitPlatformSupport for tests. | 33 // An implementation of WebKitPlatformSupport for tests. |
| 38 class TestWebKitPlatformSupport : | 34 class TestWebKitPlatformSupport : |
| 39 public WebKit::WebUnitTestSupport, | 35 public WebKit::WebUnitTestSupport, |
| 40 public webkit_glue::WebKitPlatformSupportChildImpl { | 36 public webkit_glue::WebKitPlatformSupportChildImpl { |
| 41 public: | 37 public: |
| 42 TestWebKitPlatformSupport(); | 38 TestWebKitPlatformSupport(); |
| 43 virtual ~TestWebKitPlatformSupport(); | 39 virtual ~TestWebKitPlatformSupport(); |
| 44 | 40 |
| 45 virtual WebKit::WebMimeRegistry* mimeRegistry(); | 41 virtual WebKit::WebMimeRegistry* mimeRegistry(); |
| 46 virtual WebKit::WebClipboard* clipboard(); | 42 virtual WebKit::WebClipboard* clipboard(); |
| 47 virtual WebKit::WebFileUtilities* fileUtilities(); | 43 virtual WebKit::WebFileUtilities* fileUtilities(); |
| 48 virtual WebKit::WebSandboxSupport* sandboxSupport(); | 44 virtual WebKit::WebSandboxSupport* sandboxSupport(); |
| 49 virtual WebKit::WebCookieJar* cookieJar(); | |
| 50 virtual WebKit::WebBlobRegistry* blobRegistry(); | 45 virtual WebKit::WebBlobRegistry* blobRegistry(); |
| 51 virtual WebKit::WebFileSystem* fileSystem(); | |
| 52 virtual WebKit::WebHyphenator* hyphenator(); | 46 virtual WebKit::WebHyphenator* hyphenator(); |
| 53 virtual WebKit::WebIDBFactory* idbFactory(); | 47 virtual WebKit::WebIDBFactory* idbFactory(); |
| 54 | 48 |
| 55 virtual bool sandboxEnabled(); | 49 virtual bool sandboxEnabled(); |
| 56 virtual WebKit::Platform::FileHandle databaseOpenFile( | |
| 57 const WebKit::WebString& vfs_file_name, int desired_flags); | |
| 58 virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name, | |
| 59 bool sync_dir); | |
| 60 virtual long databaseGetFileAttributes( | |
| 61 const WebKit::WebString& vfs_file_name); | |
| 62 virtual long long databaseGetFileSize( | |
| 63 const WebKit::WebString& vfs_file_name); | |
| 64 virtual long long databaseGetSpaceAvailableForOrigin( | |
| 65 const WebKit::WebString& origin_identifier); | |
| 66 virtual unsigned long long visitedLinkHash(const char* canonicalURL, | 50 virtual unsigned long long visitedLinkHash(const char* canonicalURL, |
| 67 size_t length); | 51 size_t length); |
| 68 virtual bool isLinkVisited(unsigned long long linkHash); | 52 virtual bool isLinkVisited(unsigned long long linkHash); |
| 69 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); | 53 virtual WebKit::WebMessagePortChannel* createMessagePortChannel(); |
| 70 virtual void prefetchHostName(const WebKit::WebString&); | 54 virtual void prefetchHostName(const WebKit::WebString&); |
| 71 virtual WebKit::WebURLLoader* createURLLoader(); | 55 virtual WebKit::WebURLLoader* createURLLoader(); |
| 72 virtual WebKit::WebData loadResource(const char* name); | 56 virtual WebKit::WebData loadResource(const char* name); |
| 73 virtual WebKit::WebString queryLocalizedString( | 57 virtual WebKit::WebString queryLocalizedString( |
| 74 WebKit::WebLocalizedString::Name name); | 58 WebKit::WebLocalizedString::Name name); |
| 75 virtual WebKit::WebString queryLocalizedString( | 59 virtual WebKit::WebString queryLocalizedString( |
| 76 WebKit::WebLocalizedString::Name name, | 60 WebKit::WebLocalizedString::Name name, |
| 77 const WebKit::WebString& value); | 61 const WebKit::WebString& value); |
| 78 virtual WebKit::WebString queryLocalizedString( | 62 virtual WebKit::WebString queryLocalizedString( |
| 79 WebKit::WebLocalizedString::Name name, | 63 WebKit::WebLocalizedString::Name name, |
| 80 const WebKit::WebString& value1, | 64 const WebKit::WebString& value1, |
| 81 const WebKit::WebString& value2); | 65 const WebKit::WebString& value2); |
| 82 virtual WebKit::WebString defaultLocale(); | 66 virtual WebKit::WebString defaultLocale(); |
| 83 virtual WebKit::WebStorageNamespace* createLocalStorageNamespace( | |
| 84 const WebKit::WebString& path, unsigned quota); | |
| 85 | 67 |
| 86 #if defined(OS_WIN) || defined(OS_MACOSX) | 68 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 87 void SetThemeEngine(WebKit::WebThemeEngine* engine); | 69 void SetThemeEngine(WebKit::WebThemeEngine* engine); |
| 88 virtual WebKit::WebThemeEngine *themeEngine(); | 70 virtual WebKit::WebThemeEngine *themeEngine(); |
| 89 #endif | 71 #endif |
| 90 | 72 |
| 91 virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( | 73 virtual WebKit::WebGraphicsContext3D* createOffscreenGraphicsContext3D( |
| 92 const WebKit::WebGraphicsContext3D::Attributes&); | 74 const WebKit::WebGraphicsContext3D::Attributes&); |
| 93 virtual WebKit::WebGraphicsContext3DProvider* | 75 virtual WebKit::WebGraphicsContext3DProvider* |
| 94 createSharedOffscreenGraphicsContext3DProvider(); | 76 createSharedOffscreenGraphicsContext3DProvider(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 virtual WebKit::WebString webKitRootDir(); | 142 virtual WebKit::WebString webKitRootDir(); |
| 161 virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting(); | 143 virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting(); |
| 162 virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting( | 144 virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting( |
| 163 TestViewType type); | 145 TestViewType type); |
| 164 | 146 |
| 165 private: | 147 private: |
| 166 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; | 148 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; |
| 167 MockWebClipboardImpl mock_clipboard_; | 149 MockWebClipboardImpl mock_clipboard_; |
| 168 webkit_glue::WebFileUtilitiesImpl file_utilities_; | 150 webkit_glue::WebFileUtilitiesImpl file_utilities_; |
| 169 base::ScopedTempDir appcache_dir_; | 151 base::ScopedTempDir appcache_dir_; |
| 170 SimpleAppCacheSystem appcache_system_; | |
| 171 SimpleDatabaseSystem database_system_; | |
| 172 SimpleDomStorageSystem dom_storage_system_; | |
| 173 SimpleWebCookieJarImpl cookie_jar_; | |
| 174 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; | 152 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; |
| 175 SimpleFileSystem file_system_; | |
| 176 base::ScopedTempDir file_system_root_; | 153 base::ScopedTempDir file_system_root_; |
| 177 webkit_glue::MockWebHyphenator hyphenator_; | 154 webkit_glue::MockWebHyphenator hyphenator_; |
| 178 WebURLLoaderMockFactory url_loader_factory_; | 155 WebURLLoaderMockFactory url_loader_factory_; |
| 179 WebKit::WebGamepads gamepad_data_; | 156 WebKit::WebGamepads gamepad_data_; |
| 180 webkit::WebCompositorSupportImpl compositor_support_; | 157 webkit::WebCompositorSupportImpl compositor_support_; |
| 181 | 158 |
| 182 scoped_refptr<cc::ContextProvider> main_thread_contexts_; | 159 scoped_refptr<cc::ContextProvider> main_thread_contexts_; |
| 183 | 160 |
| 184 #if defined(OS_WIN) || defined(OS_MACOSX) | 161 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 185 WebKit::WebThemeEngine* active_theme_engine_; | 162 WebKit::WebThemeEngine* active_theme_engine_; |
| 186 #endif | 163 #endif |
| 187 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); | 164 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); |
| 188 }; | 165 }; |
| 189 | 166 |
| 190 #endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ | 167 #endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ |
| OLD | NEW |