Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: webkit/support/weburl_loader_mock_factory.cc

Issue 10735037: Add WebURLLoaderMockFactory::GetLastHandledAsynchronousRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/weburl_loader_mock_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/weburl_loader_mock_factory.cc
diff --git a/webkit/support/weburl_loader_mock_factory.cc b/webkit/support/weburl_loader_mock_factory.cc
index ccf38910540df5b8e3d7ceecf8bfd9a91b6c8d11..b3d3fdd159c7f8de56464439abf6c4b7072722f5 100644
--- a/webkit/support/weburl_loader_mock_factory.cc
+++ b/webkit/support/weburl_loader_mock_factory.cc
@@ -61,6 +61,7 @@ void WebURLLoaderMockFactory::UnregisterAllURLs() {
}
void WebURLLoaderMockFactory::ServeAsynchronousRequests() {
+ last_handled_asynchronous_request_.reset();
// Serving a request might trigger more requests, so we cannot iterate on
// pending_loaders_ as it might get modified.
while (!pending_loaders_.empty()) {
@@ -70,6 +71,7 @@ void WebURLLoaderMockFactory::ServeAsynchronousRequests() {
WebURLResponse response;
WebURLError error;
WebData data;
+ last_handled_asynchronous_request_ = request;
LoadRequest(request, &response, &error, &data);
// Follow any redirects while the loader is still active.
while (response.httpStatusCode() >= 300 &&
@@ -77,6 +79,7 @@ void WebURLLoaderMockFactory::ServeAsynchronousRequests() {
WebURLRequest newRequest = loader->ServeRedirect(response);
if (!IsPending(loader) || loader->isDeferred())
break;
+ last_handled_asynchronous_request_ = newRequest;
LoadRequest(newRequest, &response, &error, &data);
}
// Serve the request if the loader is still active.
@@ -87,6 +90,11 @@ void WebURLLoaderMockFactory::ServeAsynchronousRequests() {
}
}
+WebKit::WebURLRequest
+WebURLLoaderMockFactory::GetLastHandledAsynchronousRequest() {
+ return last_handled_asynchronous_request_;
+}
+
bool WebURLLoaderMockFactory::IsMockedURL(const WebKit::WebURL& url) {
return url_to_reponse_info_.find(url) != url_to_reponse_info_.end();
}
« no previous file with comments | « webkit/support/weburl_loader_mock_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698