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

Unified Diff: third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc

Issue 2644083003: ResourceFetcherTest: introduce FetchTestingPlatformSupport (Closed)
Patch Set: Created 3 years, 11 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
Index: third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
index af7f93829b9eb2489e5b411f6eb8ea4f522d90fc..c9a6e1308744ef2b938e228a4588207337e5daf5 100644
--- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
+++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock_factory_impl.cc
@@ -91,7 +91,7 @@ void WebURLLoaderMockFactoryImpl::serveAsynchronousRequests() {
while (response.httpStatusCode() >= 300 &&
response.httpStatusCode() < 400) {
WebURLRequest newRequest = loader->ServeRedirect(request, response);
- base::RunLoop().RunUntilIdle();
+ RunUntilIdle();
if (!loader || loader->is_cancelled() || loader->is_deferred())
break;
LoadRequest(newRequest, &response, &error, &data);
@@ -99,10 +99,10 @@ void WebURLLoaderMockFactoryImpl::serveAsynchronousRequests() {
// Serve the request if the loader is still active.
if (loader && !loader->is_cancelled() && !loader->is_deferred()) {
loader->ServeAsynchronousRequest(delegate_, response, data, error);
- base::RunLoop().RunUntilIdle();
+ RunUntilIdle();
}
}
- base::RunLoop().RunUntilIdle();
+ RunUntilIdle();
}
bool WebURLLoaderMockFactoryImpl::IsMockedURL(const blink::WebURL& url) {
@@ -130,6 +130,10 @@ void WebURLLoaderMockFactoryImpl::LoadAsynchronouly(
pending_loaders_.set(loader, request);
}
+void WebURLLoaderMockFactoryImpl::RunUntilIdle() {
+ base::RunLoop().RunUntilIdle();
+}
+
void WebURLLoaderMockFactoryImpl::LoadRequest(const WebURLRequest& request,
WebURLResponse* response,
WebURLError* error,

Powered by Google App Engine
This is Rietveld 408576698