Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: webkit/support/test_webkit_platform_support.h

Issue 12220091: Add implementations of WebKit::Platform testing APIs to TestWebKitPlatformSupport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with compile guard for WebUnitTestSupport.h Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/support/test_webkit_platform_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
11 #include "webkit/glue/webfileutilities_impl.h" 11 #include "webkit/glue/webfileutilities_impl.h"
12 #include "webkit/glue/webkitplatformsupport_impl.h" 12 #include "webkit/glue/webkitplatformsupport_impl.h"
13 #include "webkit/support/simple_database_system.h" 13 #include "webkit/support/simple_database_system.h"
14 #include "webkit/support/weburl_loader_mock_factory.h" 14 #include "webkit/support/weburl_loader_mock_factory.h"
15 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" 15 #include "webkit/tools/test_shell/mock_webclipboard_impl.h"
16 #include "webkit/tools/test_shell/simple_appcache_system.h" 16 #include "webkit/tools/test_shell/simple_appcache_system.h"
17 #include "webkit/tools/test_shell/simple_dom_storage_system.h" 17 #include "webkit/tools/test_shell/simple_dom_storage_system.h"
18 #include "webkit/tools/test_shell/simple_file_system.h" 18 #include "webkit/tools/test_shell/simple_file_system.h"
19 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h" 19 #include "webkit/tools/test_shell/simple_webcookiejar_impl.h"
20 #include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h" 20 #include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h"
21 21
22 #if HAVE_WEBUNITTESTSUPPORT
23 #include "third_party/WebKit/Source/Platform/chromium/public/WebUnitTestSupport. h"
24 #endif
25
22 class TestShellWebBlobRegistryImpl; 26 class TestShellWebBlobRegistryImpl;
23 27
24 namespace WebKit { 28 namespace WebKit {
25 class WebAudioDevice; 29 class WebAudioDevice;
26 } 30 }
27 31
28 typedef struct _HyphenDict HyphenDict; 32 typedef struct _HyphenDict HyphenDict;
29 33
30 // An implementation of WebKitPlatformSupport for tests. 34 // An implementation of WebKitPlatformSupport for tests.
31 class TestWebKitPlatformSupport : 35 class TestWebKitPlatformSupport :
36 #if HAVE_WEBUNITTESTSUPPORT
37 public NON_EXPORTED_BASE(WebKit::WebUnitTestSupport),
38 #endif
32 public webkit_glue::WebKitPlatformSupportImpl { 39 public webkit_glue::WebKitPlatformSupportImpl {
33 public: 40 public:
34 TestWebKitPlatformSupport(bool unit_test_mode, 41 TestWebKitPlatformSupport(bool unit_test_mode,
35 WebKit::Platform* shadow_platform_delegate); 42 WebKit::Platform* shadow_platform_delegate);
36 virtual ~TestWebKitPlatformSupport(); 43 virtual ~TestWebKitPlatformSupport();
37 44
38 virtual WebKit::WebMimeRegistry* mimeRegistry(); 45 virtual WebKit::WebMimeRegistry* mimeRegistry();
39 virtual WebKit::WebClipboard* clipboard(); 46 virtual WebKit::WebClipboard* clipboard();
40 virtual WebKit::WebFileUtilities* fileUtilities(); 47 virtual WebKit::WebFileUtilities* fileUtilities();
41 virtual WebKit::WebSandboxSupport* sandboxSupport(); 48 virtual WebKit::WebSandboxSupport* sandboxSupport();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 const char16* characters, 134 const char16* characters,
128 size_t length, 135 size_t length,
129 size_t before_index, 136 size_t before_index,
130 const WebKit::WebString& locale); 137 const WebKit::WebString& locale);
131 138
132 virtual WebKit::WebGestureCurve* createFlingAnimationCurve( 139 virtual WebKit::WebGestureCurve* createFlingAnimationCurve(
133 int device_source, 140 int device_source,
134 const WebKit::WebFloatPoint& velocity, 141 const WebKit::WebFloatPoint& velocity,
135 const WebKit::WebSize& cumulative_scroll); 142 const WebKit::WebSize& cumulative_scroll);
136 143
144 #if HAVE_WEBUNITTESTSUPPORT
145 virtual WebKit::WebUnitTestSupport* unitTestSupport();
146 #endif
147
148 // WebUnitTestSupport implementation
149 virtual void registerMockedURL(const WebKit::WebURL& url,
150 const WebKit::WebURLResponse& response,
151 const WebKit::WebString& filePath);
152 virtual void registerMockedErrorURL(const WebKit::WebURL& url,
153 const WebKit::WebURLResponse& response,
154 const WebKit::WebURLError& error);
155 virtual void unregisterMockedURL(const WebKit::WebURL& url);
156 virtual void unregisterAllMockedURLs();
157 virtual void serveAsynchronousMockedRequests();
158 virtual WebKit::WebString webKitRootDir();
159
137 private: 160 private:
138 TestShellWebMimeRegistryImpl mime_registry_; 161 TestShellWebMimeRegistryImpl mime_registry_;
139 MockWebClipboardImpl mock_clipboard_; 162 MockWebClipboardImpl mock_clipboard_;
140 webkit_glue::WebFileUtilitiesImpl file_utilities_; 163 webkit_glue::WebFileUtilitiesImpl file_utilities_;
141 base::ScopedTempDir appcache_dir_; 164 base::ScopedTempDir appcache_dir_;
142 SimpleAppCacheSystem appcache_system_; 165 SimpleAppCacheSystem appcache_system_;
143 SimpleDatabaseSystem database_system_; 166 SimpleDatabaseSystem database_system_;
144 SimpleDomStorageSystem dom_storage_system_; 167 SimpleDomStorageSystem dom_storage_system_;
145 SimpleWebCookieJarImpl cookie_jar_; 168 SimpleWebCookieJarImpl cookie_jar_;
146 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_; 169 scoped_refptr<TestShellWebBlobRegistryImpl> blob_registry_;
147 SimpleFileSystem file_system_; 170 SimpleFileSystem file_system_;
148 base::ScopedTempDir file_system_root_; 171 base::ScopedTempDir file_system_root_;
149 WebURLLoaderMockFactory url_loader_factory_; 172 WebURLLoaderMockFactory url_loader_factory_;
150 bool unit_test_mode_; 173 bool unit_test_mode_;
151 WebKit::WebGamepads gamepad_data_; 174 WebKit::WebGamepads gamepad_data_;
152 WebKit::Platform* shadow_platform_delegate_; 175 WebKit::Platform* shadow_platform_delegate_;
153 HyphenDict* hyphen_dictionary_; 176 HyphenDict* hyphen_dictionary_;
154 177
155 #if defined(OS_WIN) || defined(OS_MACOSX) 178 #if defined(OS_WIN) || defined(OS_MACOSX)
156 WebKit::WebThemeEngine* active_theme_engine_; 179 WebKit::WebThemeEngine* active_theme_engine_;
157 #endif 180 #endif
158 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); 181 DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport);
159 }; 182 };
160 183
161 #endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ 184 #endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/support/test_webkit_platform_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698