diff options
author | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:03:59 +0000 |
---|---|---|
committer | japhet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 00:03:59 +0000 |
commit | 4d11a5e11f1dc08a00c3c3bc098de0b685e36787 (patch) | |
tree | 8c9534bed8c7222ab36ef2b2e81e343f7d15a39d /webkit/support/weburl_loader_mock_factory.cc | |
parent | ffe2b2113c22f442393f9517ce259d959eb0e6cb (diff) | |
download | chromium_src-4d11a5e11f1dc08a00c3c3bc098de0b685e36787.zip chromium_src-4d11a5e11f1dc08a00c3c3bc098de0b685e36787.tar.gz chromium_src-4d11a5e11f1dc08a00c3c3bc098de0b685e36787.tar.bz2 |
Support WebCore's memory cache reusing main resources in unit tests.
* Spin the message loop, in case an asynchronous cache load is waiting
* Clear the memory cache when unregistering mocked urls.
BUG=170171
TEST=Everything stays green, webkit bug 105667 will use this soon
Review URL: https://chromiumcodereview.appspot.com/11940002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177276 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/weburl_loader_mock_factory.cc')
-rw-r--r-- | webkit/support/weburl_loader_mock_factory.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webkit/support/weburl_loader_mock_factory.cc b/webkit/support/weburl_loader_mock_factory.cc index 3a14968..43b15e4 100644 --- a/webkit/support/weburl_loader_mock_factory.cc +++ b/webkit/support/weburl_loader_mock_factory.cc @@ -10,8 +10,11 @@ #include "third_party/WebKit/Source/Platform/chromium/public/WebURLError.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebURLRequest.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebURLResponse.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" +#include "webkit/support/webkit_support.h" #include "webkit/support/weburl_loader_mock.h" +using WebKit::WebCache; using WebKit::WebData; using WebKit::WebString; using WebKit::WebURL; @@ -73,6 +76,7 @@ void WebURLLoaderMockFactory::UnregisterURL(const WebKit::WebURL& url) { void WebURLLoaderMockFactory::UnregisterAllURLs() { url_to_reponse_info_.clear(); url_to_error_info_.clear(); + WebCache::clear(); } void WebURLLoaderMockFactory::ServeAsynchronousRequests() { @@ -103,6 +107,7 @@ void WebURLLoaderMockFactory::ServeAsynchronousRequests() { // The loader might have already been removed. pending_loaders_.erase(loader); } + webkit_support::RunAllPendingMessages(); } WebKit::WebURLRequest |