summaryrefslogtreecommitdiffstats
path: root/webkit/support/test_webkit_client.h
diff options
context:
space:
mode:
authorjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 20:54:09 +0000
committerjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 20:54:09 +0000
commit0fbd522d848313c647d2301990ea18973d887b69 (patch)
tree1cd783a8dacbfbf640661196edb6c92a6e7c16dd /webkit/support/test_webkit_client.h
parenta74f123ad667cade1aa366bd423f6b68c99a2a78 (diff)
downloadchromium_src-0fbd522d848313c647d2301990ea18973d887b69.zip
chromium_src-0fbd522d848313c647d2301990ea18973d887b69.tar.gz
chromium_src-0fbd522d848313c647d2301990ea18973d887b69.tar.bz2
Adding a way to mock WebURLLoader in webkit_support.
This was originally in a CL in Webkit (https://bugs.webkit.org/show_bug.cgi?id=39456) but seems to make more sense in webkit_support. BUG=None TEST=None (the above CL makes use of this). Review URL: http://codereview.chromium.org/2749020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/test_webkit_client.h')
-rw-r--r--webkit/support/test_webkit_client.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/webkit/support/test_webkit_client.h b/webkit/support/test_webkit_client.h
index 7a2a052..c1415ab 100644
--- a/webkit/support/test_webkit_client.h
+++ b/webkit/support/test_webkit_client.h
@@ -7,20 +7,13 @@
#include "webkit/glue/webfilesystem_impl.h"
#include "webkit/glue/webkitclient_impl.h"
+#include "webkit/support/weburl_loader_mock_factory.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"
#include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h"
-class WebURLLoaderFactory {
- public:
- virtual WebKit::WebURLLoader* createURLLoader() = 0;
-
- protected:
- virtual ~WebURLLoaderFactory() {}
-};
-
// An implementation of WebKitClient for tests.
class TestWebKitClient : public webkit_glue::WebKitClientImpl {
public:
@@ -65,11 +58,8 @@ class TestWebKitClient : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
virtual WebKit::WebGraphicsContext3D* createGraphicsContext3D();
- // Sets the factory used to create WebURLLoader instances.
- // The caller owns the WebURLLoaderFactory and is responsible for calling this
- // method again with NULL when it's done.
- void set_url_loader_factory(WebURLLoaderFactory* url_loader_factory) {
- url_loader_factory_ = url_loader_factory;
+ WebURLLoaderMockFactory* url_loader_factory() {
+ return &url_loader_factory_;
}
private:
@@ -80,11 +70,7 @@ class TestWebKitClient : public webkit_glue::WebKitClientImpl {
SimpleAppCacheSystem appcache_system_;
SimpleDatabaseSystem database_system_;
SimpleWebCookieJarImpl cookie_jar_;
-
- // Used to create WebURLLoader.
- // If NULL, the class defers to webkit_glue::WebKitClientImpl for creating the
- // WebURLLoader.
- WebURLLoaderFactory* url_loader_factory_;
+ WebURLLoaderMockFactory url_loader_factory_;
#if defined(OS_WIN)
WebKit::WebThemeEngine* active_theme_engine_;