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

Side by Side Diff: webkit/tools/test_shell/test_shell_webkit_init.h

Issue 203074: Refactor the DB code to make all DB layout tests pass on test_shell.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « webkit/tools/test_shell/test_shell.gyp ('k') | webkit/webkit.gyp » ('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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // 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/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
11 #include "base/stats_counters.h" 11 #include "base/stats_counters.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "media/base/media.h" 13 #include "media/base/media.h"
14 #include "webkit/api/public/WebData.h" 14 #include "webkit/api/public/WebData.h"
15 #include "webkit/api/public/WebKit.h" 15 #include "webkit/api/public/WebKit.h"
16 #include "webkit/api/public/WebStorageArea.h" 16 #include "webkit/api/public/WebStorageArea.h"
17 #include "webkit/api/public/WebStorageNamespace.h" 17 #include "webkit/api/public/WebStorageNamespace.h"
18 #include "webkit/api/public/WebString.h" 18 #include "webkit/api/public/WebString.h"
19 #include "webkit/api/public/WebURL.h" 19 #include "webkit/api/public/WebURL.h"
20 #include "webkit/appcache/web_application_cache_host_impl.h" 20 #include "webkit/appcache/web_application_cache_host_impl.h"
21 #include "webkit/database/vfs_backend.h"
22 #include "webkit/extensions/v8/gears_extension.h"
23 #include "webkit/extensions/v8/interval_extension.h"
21 #include "webkit/glue/simple_webmimeregistry_impl.h" 24 #include "webkit/glue/simple_webmimeregistry_impl.h"
22 #include "webkit/glue/webclipboard_impl.h" 25 #include "webkit/glue/webclipboard_impl.h"
23 #include "webkit/glue/webkit_glue.h" 26 #include "webkit/glue/webkit_glue.h"
24 #include "webkit/glue/webkitclient_impl.h" 27 #include "webkit/glue/webkitclient_impl.h"
25 #include "webkit/extensions/v8/gears_extension.h"
26 #include "webkit/extensions/v8/interval_extension.h"
27 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" 28 #include "webkit/tools/test_shell/mock_webclipboard_impl.h"
28 #include "webkit/tools/test_shell/simple_appcache_system.h" 29 #include "webkit/tools/test_shell/simple_appcache_system.h"
30 #include "webkit/tools/test_shell/simple_database_system.h"
29 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 31 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
30 #include "v8/include/v8.h" 32 #include "v8/include/v8.h"
31 33
32 #if defined(OS_WIN) 34 #if defined(OS_WIN)
33 #include "webkit/api/public/win/WebThemeEngine.h" 35 #include "webkit/api/public/win/WebThemeEngine.h"
34 #include "webkit/tools/test_shell/test_shell_webthemeengine.h" 36 #include "webkit/tools/test_shell/test_shell_webthemeengine.h"
35 #endif 37 #endif
36 38
37 class TestShellWebKitInit : public webkit_glue::WebKitClientImpl { 39 class TestShellWebKitInit : public webkit_glue::WebKitClientImpl {
38 public: 40 public:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } else { 86 } else {
85 return &real_clipboard_; 87 return &real_clipboard_;
86 } 88 }
87 } 89 }
88 90
89 virtual WebKit::WebSandboxSupport* sandboxSupport() { 91 virtual WebKit::WebSandboxSupport* sandboxSupport() {
90 return NULL; 92 return NULL;
91 } 93 }
92 94
93 virtual bool sandboxEnabled() { 95 virtual bool sandboxEnabled() {
94 return false; 96 return true;
95 } 97 }
96 98
97 virtual bool getFileSize(const WebKit::WebString& path, 99 virtual base::PlatformFile databaseOpenFile(
98 long long& result) { 100 const WebKit::WebString& file_name, int desired_flags,
101 base::PlatformFile* dir_handle) {
102 return SimpleDatabaseSystem::GetInstance()->OpenFile(
103 webkit_glue::WebStringToFilePath(file_name),
104 desired_flags, dir_handle);
105 }
106
107 virtual int databaseDeleteFile(const WebKit::WebString& file_name,
108 bool sync_dir) {
109 return SimpleDatabaseSystem::GetInstance()->DeleteFile(
110 webkit_glue::WebStringToFilePath(file_name), sync_dir);
111 }
112
113 virtual long databaseGetFileAttributes(const WebKit::WebString& file_name) {
114 return SimpleDatabaseSystem::GetInstance()->GetFileAttributes(
115 webkit_glue::WebStringToFilePath(file_name));
116 }
117
118 virtual long long databaseGetFileSize(const WebKit::WebString& file_name) {
119 return SimpleDatabaseSystem::GetInstance()->GetFileSize(
120 webkit_glue::WebStringToFilePath(file_name));
121 }
122
123 virtual bool getFileSize(const WebKit::WebString& path, long long& result) {
99 return file_util::GetFileSize( 124 return file_util::GetFileSize(
100 FilePath(webkit_glue::WebStringToFilePathString(path)), 125 webkit_glue::WebStringToFilePath(path),
101 reinterpret_cast<int64*>(&result)); 126 reinterpret_cast<int64*>(&result));
102 } 127 }
103 128
104 virtual unsigned long long visitedLinkHash(const char* canonicalURL, 129 virtual unsigned long long visitedLinkHash(const char* canonicalURL,
105 size_t length) { 130 size_t length) {
106 return 0; 131 return 0;
107 } 132 }
108 133
109 virtual bool isLinkVisited(unsigned long long linkHash) { 134 virtual bool isLinkVisited(unsigned long long linkHash) {
110 return false; 135 return false;
111 } 136 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return active_theme_engine_; 203 return active_theme_engine_;
179 } 204 }
180 #endif 205 #endif
181 206
182 private: 207 private:
183 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; 208 webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
184 MockWebClipboardImpl mock_clipboard_; 209 MockWebClipboardImpl mock_clipboard_;
185 webkit_glue::WebClipboardImpl real_clipboard_; 210 webkit_glue::WebClipboardImpl real_clipboard_;
186 ScopedTempDir appcache_dir_; 211 ScopedTempDir appcache_dir_;
187 SimpleAppCacheSystem appcache_system_; 212 SimpleAppCacheSystem appcache_system_;
213 SimpleDatabaseSystem database_system_;
188 214
189 #if defined(OS_WIN) 215 #if defined(OS_WIN)
190 WebKit::WebThemeEngine* active_theme_engine_; 216 WebKit::WebThemeEngine* active_theme_engine_;
191 #endif 217 #endif
192 }; 218 };
193 219
194 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_ 220 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_WEBKIT_INIT_H_
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell.gyp ('k') | webkit/webkit.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698