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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 1866483002: Add a new priority level, THROTTLED, below IDLE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjusted predictor priorities. Created 4 years, 2 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: 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 e87119195ede9de1568ce4ed182a65ef6943cc07..c87ac7a720e16945731b55df007744f1d393f77a 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -7807,6 +7807,21 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnLoadOnlyFromCache) {
EXPECT_FALSE(req->response_info().network_accessed);
}
+// 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());
+
+ TestDelegate d;
+ GURL test_url(http_test_server()->GetURL("/"));
+ std::unique_ptr<URLRequest> req(
+ default_context_.CreateRequest(test_url, THROTTLED, &d));
+ req->Start();
+ base::RunLoop().Run();
+
+ EXPECT_TRUE(req->status().is_success());
+}
+
TEST_F(URLRequestTestHTTP, RawBodyBytesNoContentEncoding) {
ASSERT_TRUE(http_test_server()->Start());

Powered by Google App Engine
This is Rietveld 408576698