summaryrefslogtreecommitdiffstats
path: root/webkit/support/test_webkit_client.h
diff options
context:
space:
mode:
authortkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 08:25:08 +0000
committertkent@google.com <tkent@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 08:25:08 +0000
commit43b3be394cf9062a2b80e4dba5d880759d060633 (patch)
tree074b05cf00d1df1e057f8cedcc23774519cbd988 /webkit/support/test_webkit_client.h
parentebaac267c41fce4a5b8ed4341ba32be40c7ac43e (diff)
downloadchromium_src-43b3be394cf9062a2b80e4dba5d880759d060633.zip
chromium_src-43b3be394cf9062a2b80e4dba5d880759d060633.tar.gz
chromium_src-43b3be394cf9062a2b80e4dba5d880759d060633.tar.bz2
Initial change for DumpRrenderTree support library
This library provides: - An implementation of WebKitClient, - An implementation of WebPlugin, - An implementation of WebMediaPalyer, - Initialization and termination functions, - Two function for database, and - Some functions required by webkit_glue. webkit_support.gyp is not referred by build/all.gyp. A gyp for DRT/chromium in WebKit tree will refer to it. BUG=none TEST=none. This is a part of test code. Review URL: http://codereview.chromium.org/652226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/test_webkit_client.h')
-rw-r--r--webkit/support/test_webkit_client.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/webkit/support/test_webkit_client.h b/webkit/support/test_webkit_client.h
new file mode 100644
index 0000000..c17999a
--- /dev/null
+++ b/webkit/support/test_webkit_client.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_
+#define WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_
+
+#include "webkit/glue/simple_webmimeregistry_impl.h"
+#include "webkit/glue/webkitclient_impl.h"
+#include "webkit/tools/test_shell/mock_webclipboard_impl.h"
+#include "webkit/tools/test_shell/simple_appcache_system.h"
+#include "webkit/tools/test_shell/simple_database_system.h"
+#include "webkit/tools/test_shell/simple_webcookiejar_impl.h"
+
+// An implementation of WebKitClient for tests.
+class TestWebKitClient : public webkit_glue::WebKitClientImpl {
+ public:
+ explicit TestWebKitClient();
+ virtual ~TestWebKitClient();
+
+ virtual WebKit::WebMimeRegistry* mimeRegistry();
+ WebKit::WebClipboard* clipboard();
+ virtual WebKit::WebSandboxSupport* sandboxSupport();
+ virtual WebKit::WebCookieJar* cookieJar();
+ virtual bool sandboxEnabled();
+ virtual WebKit::WebKitClient::FileHandle databaseOpenFile(
+ const WebKit::WebString& vfs_file_name, int desired_flags,
+ WebKit::WebKitClient::FileHandle* dir_handle);
+ virtual int databaseDeleteFile(const WebKit::WebString& vfs_file_name,
+ bool sync_dir);
+ virtual long databaseGetFileAttributes(
+ const WebKit::WebString& vfs_file_name);
+ virtual long long databaseGetFileSize(
+ const WebKit::WebString& vfs_file_name);
+ virtual bool getFileSize(const WebKit::WebString& path, long long& result);
+ virtual unsigned long long visitedLinkHash(const char* canonicalURL,
+ size_t length);
+ virtual bool isLinkVisited(unsigned long long linkHash);
+ virtual WebKit::WebMessagePortChannel* createMessagePortChannel();
+ virtual void prefetchHostName(const WebKit::WebString&);
+ virtual WebKit::WebData loadResource(const char* name);
+ virtual WebKit::WebString defaultLocale();
+ virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
+ const WebKit::WebString& path, unsigned quota);
+
+ void dispatchStorageEvent(const WebKit::WebString& key,
+ const WebKit::WebString& old_value, const WebKit::WebString& new_value,
+ const WebKit::WebString& origin, const WebKit::WebURL& url,
+ bool is_local_storage);
+
+ virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
+ WebKit::WebApplicationCacheHostClient* client);
+
+#if defined(OS_WIN)
+ void SetThemeEngine(WebKit::WebThemeEngine* engine);
+ virtual WebKit::WebThemeEngine *themeEngine();
+#endif
+
+ virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
+
+ private:
+ webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
+ MockWebClipboardImpl mock_clipboard_;
+ ScopedTempDir appcache_dir_;
+ SimpleAppCacheSystem appcache_system_;
+ SimpleDatabaseSystem database_system_;
+ SimpleWebCookieJarImpl cookie_jar_;
+
+#if defined(OS_WIN)
+ WebKit::WebThemeEngine* active_theme_engine_;
+#endif
+ DISALLOW_COPY_AND_ASSIGN(TestWebKitClient);
+};
+
+#endif // WEBKIT_SUPPORT_TEST_WEBKIT_CLIENT_H_