Index: net/url_request/url_request_unittest.cc |
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc |
index c99852be0d392e6b13226a6aa27fc9770d82da94..e78411e00a46c4011312f49ce0fd12ab52385f61 100644 |
--- a/net/url_request/url_request_unittest.cc |
+++ b/net/url_request/url_request_unittest.cc |
@@ -7891,7 +7891,7 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnLoadOnlyFromCache) { |
EXPECT_FALSE(req->response_info().network_accessed); |
} |
-// Test that a single job with a throttled priority completes |
+// Test that a single job with a THROTTLED priority completes |
// correctly in the absence of contention. |
TEST_F(URLRequestTestHTTP, ThrottledPriority) { |
ASSERT_TRUE(http_test_server()->Start()); |
@@ -7906,6 +7906,31 @@ TEST_F(URLRequestTestHTTP, ThrottledPriority) { |
EXPECT_TRUE(req->status().is_success()); |
} |
+// Test that three jobs with THROTTLED priorities complete |
+// correctly in the absence of contention (the completion of the |
+// first one will unthrottle the third, but there is no visibility |
+// to that at this level). |
+TEST_F(URLRequestTestHTTP, MultiThrottledPriority) { |
+ ASSERT_TRUE(http_test_server()->Start()); |
+ |
+ TestDelegate d; |
+ GURL test_url(http_test_server()->GetURL("/")); |
+ std::unique_ptr<URLRequest> req1( |
+ default_context_.CreateRequest(test_url, THROTTLED, &d)); |
+ std::unique_ptr<URLRequest> req2( |
+ default_context_.CreateRequest(test_url, THROTTLED, &d)); |
+ std::unique_ptr<URLRequest> req3( |
+ default_context_.CreateRequest(test_url, THROTTLED, &d)); |
+ req1->Start(); |
+ req2->Start(); |
+ req3->Start(); |
+ base::RunLoop().Run(); |
+ |
+ EXPECT_TRUE(req1->status().is_success()); |
+ EXPECT_TRUE(req2->status().is_success()); |
+ EXPECT_TRUE(req3->status().is_success()); |
+} |
+ |
class URLRequestInterceptorTestHTTP : public URLRequestTestHTTP { |
public: |
// TODO(bengr): Merge this with the URLRequestInterceptorHTTPTest fixture, |