Index: content/browser/loader/resource_dispatcher_host_unittest.cc |
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc |
index c900ae04afd3f31e6693f05e9d948a9544ff2378..674d0dd7bf18fb719a089ee3ce063ed862c75f9f 100644 |
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc |
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc |
@@ -2569,6 +2569,7 @@ TEST_P(ResourceDispatcherHostTest, IgnoreCancelForDownloads) { |
// Return some data so that the request is identified as a download |
// and the proper resource handlers are created. |
EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
+ base::MessageLoop::current()->RunUntilIdle(); |
// And now simulate a cancellation coming from the renderer. |
ResourceHostMsg_CancelRequest msg(request_id); |
@@ -2580,6 +2581,7 @@ TEST_P(ResourceDispatcherHostTest, IgnoreCancelForDownloads) { |
EXPECT_EQ(1, host_.pending_requests()); |
while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} |
+ base::MessageLoop::current()->RunUntilIdle(); |
} |
TEST_P(ResourceDispatcherHostTest, CancelRequestsForContext) { |
@@ -2640,6 +2642,7 @@ TEST_P(ResourceDispatcherHostTest, CancelRequestsForContext) { |
// Return some data so that the request is identified as a download |
// and the proper resource handlers are created. |
EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage()); |
+ base::MessageLoop::current()->RunUntilIdle(); |
// And now simulate a cancellation coming from the renderer. |
ResourceHostMsg_CancelRequest msg(request_id); |
@@ -2657,6 +2660,9 @@ TEST_P(ResourceDispatcherHostTest, CancelRequestsForContext) { |
// Cancelling by context should work. |
host_.CancelRequestsForContext(filter_->resource_context()); |
EXPECT_EQ(0, host_.pending_requests()); |
+ |
+ while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} |
+ base::RunLoop().RunUntilIdle(); |
} |
} |
@@ -3028,6 +3034,7 @@ TEST_P(ResourceDispatcherHostTest, TransferNavigationText) { |
// Flush all the pending requests to get the response through the |
// MimeTypeResourceHandler. |
while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} |
+ base::MessageLoop::current()->RunUntilIdle(); |
// Restore, now that we've set up a transfer. |
SetBrowserClientForTesting(old_client); |
@@ -3196,6 +3203,7 @@ TEST_P(ResourceDispatcherHostTest, TransferNavigationWithTwoRedirects) { |
// Flush all the pending requests to get the response through the |
// MimeTypeResourceHandler. |
while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} |
+ base::MessageLoop::current()->RunUntilIdle(); |
// Restore. |
SetBrowserClientForTesting(old_client); |