diff options
author | jcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 20:54:09 +0000 |
---|---|---|
committer | jcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-21 20:54:09 +0000 |
commit | 0fbd522d848313c647d2301990ea18973d887b69 (patch) | |
tree | 1cd783a8dacbfbf640661196edb6c92a6e7c16dd /webkit/support/webkit_support.h | |
parent | a74f123ad667cade1aa366bd423f6b68c99a2a78 (diff) | |
download | chromium_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/webkit_support.h')
-rw-r--r-- | webkit/support/webkit_support.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index c6dfc35..694f77b1 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" class Task; +class WebURLLoaderMockFactory; namespace WebKit { class WebApplicationCacheHost; class WebApplicationCacheHostClient; @@ -21,6 +22,7 @@ class WebPlugin; class WebString; class WebThemeEngine; class WebURL; +class WebURLResponse; struct WebPluginParams; } @@ -35,11 +37,17 @@ namespace webkit_support { // |unit_test_mode| should be set to true when running in a TestSuite, in which // case no AtExitManager is created and ICU is not initialized (as it is already // done by the TestSuite). -// SetUpTestEnvironment() calls WebKit::initialize(). +// SetUpTestEnvironment() and SetUpTestEnvironmentForUnitTests() calls +// WebKit::initialize(). // TearDownTestEnvironment() calls WebKit::shutdown(). -// TODO(jcivelli): remove the next method once DumpRenderTree.cpp is not using -// it anymore upstream. +// SetUpTestEnvironmentForUnitTests() should be used when running in a +// TestSuite, in which case no AtExitManager is created and ICU is not +// initialized (as it is already done by the TestSuite). void SetUpTestEnvironment(); +void SetUpTestEnvironmentForUnitTests(); +// TODO(jcivelli): the method below is deprecated and should be removed when +// DumpRenderTree has been modified to use the version with no +// parameter. void SetUpTestEnvironment(bool unit_test_mode); void TearDownTestEnvironment(); @@ -63,6 +71,21 @@ WebKit::WebApplicationCacheHost* CreateApplicationCacheHost( // Returns the root directory of the WebKit code. WebKit::WebString GetWebKitRootDir(); +// ------- URL load mocking. +// Registers the file at |file_path| to be served when |url| is requested. +// |response| is the response provided with the contents. +void RegisterMockedURL(const WebKit::WebURL& url, + const WebKit::WebURLResponse& response, + const WebKit::WebString& file_path); + +// Unregisters URLs so they are no longer mocked. +void UnregisterMockedURL(const WebKit::WebURL& url); +void UnregisterAllMockedURLs(); + +// Causes all pending asynchronous requests to be served. When this method +// returns all the pending requests have been processed. +void ServeAsynchronousMockedRequests(); + // Wrappers to minimize dependecy. // -------- Debugging |