summaryrefslogtreecommitdiffstats
path: root/webkit/support/test_webkit_client.cc
diff options
context:
space:
mode:
authorjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 22:16:24 +0000
committerjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 22:16:24 +0000
commitbb07d7a8169743e3992e9f5f0baa82a2aa4aa2dc (patch)
tree3d311e95a01257c5c45974c589ebe3be06a39b1c /webkit/support/test_webkit_client.cc
parent4caa7300f49f5f0d30c8880bacf14a064fed51d5 (diff)
downloadchromium_src-bb07d7a8169743e3992e9f5f0baa82a2aa4aa2dc.zip
chromium_src-bb07d7a8169743e3992e9f5f0baa82a2aa4aa2dc.tar.gz
chromium_src-bb07d7a8169743e3992e9f5f0baa82a2aa4aa2dc.tar.bz2
Making webkit_support usable in WebKit unit-tests.
Adding a way to generate custom WebURLLoader (so unit-tests can mock resource loading). BUG=None TEST=DumpRenderTree should work. Review URL: http://codereview.chromium.org/2094017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/test_webkit_client.cc')
-rw-r--r--webkit/support/test_webkit_client.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/webkit/support/test_webkit_client.cc b/webkit/support/test_webkit_client.cc
index 874717c..21648f0 100644
--- a/webkit/support/test_webkit_client.cc
+++ b/webkit/support/test_webkit_client.cc
@@ -51,7 +51,7 @@
using WebKit::WebScriptController;
-TestWebKitClient::TestWebKitClient() {
+TestWebKitClient::TestWebKitClient() : url_loader_factory_(NULL) {
v8::V8::SetCounterFunction(StatsTable::FindLocation);
WebKit::initialize(this);
@@ -193,6 +193,12 @@ WebKit::WebMessagePortChannel* TestWebKitClient::createMessagePortChannel() {
void TestWebKitClient::prefetchHostName(const WebKit::WebString&) {
}
+WebKit::WebURLLoader* TestWebKitClient::createURLLoader() {
+ if (url_loader_factory_)
+ return url_loader_factory_->createURLLoader();
+ return webkit_glue::WebKitClientImpl::createURLLoader();
+}
+
WebKit::WebData TestWebKitClient::loadResource(const char* name) {
if (!strcmp(name, "deleteButton")) {
// Create a red 30x30 square.