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

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: Rebase 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
« no previous file with comments | « net/url_request/url_request_throttler_unittest.cc ('k') | webkit/browser/appcache/appcache_update_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8ba618744cefc4653d637c07944431107837e0fa..dd7dc770f3f509d204cafab4b260ed0e720abced 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -1931,6 +1931,31 @@ 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());
+
+ req.SetPriority(MAXIMUM_PRIORITY);
+ EXPECT_EQ(MAXIMUM_PRIORITY, req.priority());
+
+ 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.
@@ -2039,7 +2064,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();
@@ -2083,7 +2108,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();
@@ -2525,7 +2550,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();
@@ -5371,7 +5396,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();
@@ -5491,7 +5516,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();
« no previous file with comments | « net/url_request/url_request_throttler_unittest.cc ('k') | webkit/browser/appcache/appcache_update_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698