Chromium Code Reviews| 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 8ef10a853c89da14750260253cc58b37c36f1406..6f0a4f6b59888fce0f3a5cd7f705e6c74c1567c6 100644 |
| --- a/net/url_request/url_request_unittest.cc |
| +++ b/net/url_request/url_request_unittest.cc |
| @@ -1404,6 +1404,33 @@ TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) { |
| EXPECT_EQ(1, default_network_delegate_.completed_requests()); |
| } |
| +// Make sure that URLRequest passes on its priority updates to its |
| +// job. |
| +TEST_F(URLRequestTest, Priority) { |
| + TestInterceptor interceptor; |
| + |
| + interceptor.intercept_main_request_ = true; |
|
mmenke
2013/03/12 18:40:22
Rather than having URLRequest friend the individua
akalin
2013/03/12 22:08:28
Done.
|
| + |
| + TestDelegate d; |
| + URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_); |
| + EXPECT_EQ(LOWEST, req.priority()); |
| + EXPECT_TRUE(!req.job_); |
| + |
| + req.SetPriority(IDLE); |
| + EXPECT_EQ(IDLE, req.priority()); |
| + EXPECT_TRUE(!req.job_); |
| + |
| + req.Start(); |
| + EXPECT_TRUE(req.job_ != NULL); |
| + scoped_refptr<URLRequestTestJob> job( |
| + static_cast<URLRequestTestJob*>(req.job_.get())); |
| + EXPECT_EQ(IDLE, job->priority()); |
| + |
| + req.SetPriority(HIGHEST); |
| + EXPECT_EQ(HIGHEST, req.priority()); |
| + EXPECT_EQ(HIGHEST, job->priority()); |
| +} |
| + |
| // TODO(droger): Support TestServer on iOS (see http://crbug.com/148666). |
| #if !defined(OS_IOS) |
| // A subclass of TestServer that uses a statically-configured hostname. This is |