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(); |
} |