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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 51683002: [Net] Assert that URLRequests with LOAD_IGNORE_LIMITS have MAXIMUM_PRIORITY (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 1 month 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 daf4c575ede70d36c56bc01d6716c7b58a4768a9..042a9c1f4888155da1aaa118dcb366107ecf2ac7 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -1896,6 +1896,28 @@ TEST_F(URLRequestTest, SetJobPriority) {
EXPECT_EQ(MEDIUM, job->priority());
}
+// Setting the IGNORE_LIMITS load flag should be okay if the priority
+// is MAXIMUM_PRIORITY.
+TEST_F(URLRequestTest, PriorityIgnoreLimits) {
+ TestDelegate d;
+ URLRequest req(GURL("http://test_intercept/foo"),
+ MAXIMUM_PRIORITY,
+ &d,
+ &default_context_);
+ EXPECT_EQ(MAXIMUM_PRIORITY, req.priority());
+
+ scoped_refptr<URLRequestTestJob> job =
+ new URLRequestTestJob(&req, &default_network_delegate_);
+ AddTestInterceptor()->set_main_intercept_job(job.get());
+
+ req.SetLoadFlags(LOAD_IGNORE_LIMITS);
+ EXPECT_EQ(MAXIMUM_PRIORITY, req.priority());
mmenke 2013/11/01 19:06:39 Should we make sure req.SetPriority(MAXIMUM_PRIORI
akalin 2013/11/01 23:15:51 Done.
+
+ req.Start();
+ EXPECT_EQ(MAXIMUM_PRIORITY, req.priority());
+ EXPECT_EQ(MAXIMUM_PRIORITY, job->priority());
+}
+
// TODO(droger): Support SpawnedTestServer on iOS (see http://crbug.com/148666).
#if !defined(OS_IOS)
// A subclass of SpawnedTestServer that uses a statically-configured hostname.
@@ -2004,7 +2026,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
DEFAULT_PRIORITY,
&d,
&default_context_);
- req.set_load_flags(LOAD_DO_NOT_SEND_COOKIES);
+ req.SetLoadFlags(LOAD_DO_NOT_SEND_COOKIES);
req.Start();
base::RunLoop().Run();
@@ -2048,7 +2070,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
DEFAULT_PRIORITY,
&d,
&default_context_);
- req.set_load_flags(LOAD_DO_NOT_SAVE_COOKIES);
+ req.SetLoadFlags(LOAD_DO_NOT_SAVE_COOKIES);
req.Start();
base::RunLoop().Run();
@@ -2490,7 +2512,7 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) {
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kReferer, "http://bar.com/");
req.SetExtraRequestHeaders(headers);
- req.set_load_flags(LOAD_VALIDATE_CACHE);
+ req.SetLoadFlags(LOAD_VALIDATE_CACHE);
req.Start();
base::RunLoop().Run();
@@ -5301,7 +5323,7 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
DEFAULT_PRIORITY,
&d,
&default_context_);
- r.set_load_flags(LOAD_VALIDATE_CACHE);
+ r.SetLoadFlags(LOAD_VALIDATE_CACHE);
r.Start();
base::RunLoop().Run();
@@ -5421,7 +5443,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthLoadTiming) {
DEFAULT_PRIORITY,
&d,
&default_context_);
- r.set_load_flags(LOAD_VALIDATE_CACHE);
+ r.SetLoadFlags(LOAD_VALIDATE_CACHE);
r.Start();
base::RunLoop().Run();

Powered by Google App Engine
This is Rietveld 408576698