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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 51953002: [Net] Add a priority parameter to URLRequest's constructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error from rebase Created 7 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 e55af568da125feefd7ba94c3ae04001d9d0c14a..ebe5cbe097d03f4712c7e6582609dd36c90b323e 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -37,6 +37,7 @@
#include "net/base/net_log_unittest.h"
#include "net/base/net_module.h"
#include "net/base/net_util.h"
+#include "net/base/request_priority.h"
#include "net/base/test_data_directory.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/base/upload_data_stream.h"
@@ -621,7 +622,11 @@ class URLRequestTest : public PlatformTest {
TEST_F(URLRequestTest, AboutBlankTest) {
TestDelegate d;
{
- URLRequest r(GURL("about:blank"), &d, &default_context_);
+ URLRequest r(GURL("about:blank"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -643,28 +648,48 @@ TEST_F(URLRequestTest, DataURLImageTest) {
TestDelegate d;
{
// Use our nice little Chrome logo.
- URLRequest r(GURL(
- "data:image/png;base64,"
- "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADVklEQVQ4jX2TfUwUBBjG3"
- "w1y+HGcd9dxhXR8T4awOccJGgOSWclHImznLkTlSw0DDQXkrmgYgbUYnlQTqQxIEVxitD"
- "5UMCATRA1CEEg+Qjw3bWDxIauJv/5oumqs39/P827vnucRmYN0gyF01GI5MpCVdW0gO7t"
- "vNC+vqSEtbZefk5NuLv1jdJ46p/zw0HeH4+PHr3h7c1mjoV2t5rKzMx1+fg9bAgK6zHq9"
- "cU5z+LpA3xOtx34+vTeT21onRuzssC3zxbbSwC13d/pFuC7CkIMDxQpF7r/MWq12UctI1"
- "dWWm99ypqSYmRUBdKem8MkrO/kgaTt1O7YzlpzE5GIVd0WYUqt57yWf2McHTObYPbVD+Z"
- "wbtlLTVMZ3BW+TnLyXLaWtmEq6WJVbT3HBh3Svj2HQQcm43XwmtoYM6vVKleh0uoWvnzW"
- "3v3MpidruPTQPf0bia7sJOtBM0ufTWNvus/nkDFHF9ZS+uYVjRUasMeHUmyLYtcklTvzW"
- "GFZnNOXczThvpKIzjcahSqIzkvDLayDq6D3eOjtBbNUEIZYyqsvj4V4wY92eNJ4IoyhTb"
- "xXX1T5xsV9tm9r4TQwHLiZw/pdDZJea8TKmsmR/K0uLh/GwnCHghTja6lPhphezPfO5/5"
- "MrVvMzNaI3+ERHfrFzPKQukrQGI4d/3EFD/3E2mVNYvi4at7CXWREaxZGD+3hg28zD3gV"
- "Md6q5c8GdosynKmSeRuGzpjyl1/9UDGtPR5HeaKT8Wjo17WXk579BXVUhN64ehF9fhRtq"
- "/uxxZKzNiZFGD0wRC3NFROZ5mwIPL/96K/rKMMLrIzF9uhHr+/sYH7DAbwlgC4J+R2Z7F"
- "Ux1qLnV7MGF40smVSoJ/jvHRfYhQeUJd/SnYtGWhPHR0Sz+GE2F2yth0B36Vcz2KpnufB"
- "JbsysjjW4kblBUiIjiURUWqJY65zxbnTy57GQyH58zgy0QBtTQv5gH15XMdKkYu+TGaJM"
- "nlm2O34uI4b9tflqp1+QEFGzoW/ulmcofcpkZCYJhDfSpme7QcrHa+Xfji8paEQkTkSfm"
- "moRWRNZr/F1KfVMjW+IKEnv2FwZfKdzt0BQR6lClcZR0EfEXEfv/G6W9iLiIyCoReV5En"
- "hORIBHx+ufPj/gLB/zGI/G4Bk0AAAAASUVORK5CYII="),
+ URLRequest r(
+ GURL(
+ "data:image/png;base64,"
+ "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/"
+ "9hAAADVklEQVQ4jX2TfUwUBBjG3"
+ "w1y+"
+ "HGcd9dxhXR8T4awOccJGgOSWclHImznLkTlSw0DDQXkrmgYgbUYnlQTqQxIEVxitD"
+ "5UMCATRA1CEEg+Qjw3bWDxIauJv/5oumqs39/"
+ "P827vnucRmYN0gyF01GI5MpCVdW0gO7t"
+ "vNC+vqSEtbZefk5NuLv1jdJ46p/"
+ "zw0HeH4+PHr3h7c1mjoV2t5rKzMx1+fg9bAgK6zHq9"
+ "cU5z+LpA3xOtx34+vTeT21onRuzssC3zxbbSwC13d/pFuC7CkIMDxQpF7r/"
+ "MWq12UctI1"
+ "dWWm99ypqSYmRUBdKem8MkrO/"
+ "kgaTt1O7YzlpzE5GIVd0WYUqt57yWf2McHTObYPbVD+Z"
+ "wbtlLTVMZ3BW+"
+ "TnLyXLaWtmEq6WJVbT3HBh3Svj2HQQcm43XwmtoYM6vVKleh0uoWvnzW"
+ "3v3MpidruPTQPf0bia7sJOtBM0ufTWNvus/"
+ "nkDFHF9ZS+uYVjRUasMeHUmyLYtcklTvzW"
+ "GFZnNOXczThvpKIzjcahSqIzkvDLayDq6D3eOjtBbNUEIZYyqsvj4V4wY92eNJ4Ioy"
+ "hTb"
+ "xXX1T5xsV9tm9r4TQwHLiZw/pdDZJea8TKmsmR/K0uLh/"
+ "GwnCHghTja6lPhphezPfO5/5"
+ "MrVvMzNaI3+ERHfrFzPKQukrQGI4d/3EFD/"
+ "3E2mVNYvi4at7CXWREaxZGD+3hg28zD3gV"
+ "Md6q5c8GdosynKmSeRuGzpjyl1/"
+ "9UDGtPR5HeaKT8Wjo17WXk579BXVUhN64ehF9fhRtq"
+ "/uxxZKzNiZFGD0wRC3NFROZ5mwIPL/96K/rKMMLrIzF9uhHr+/"
+ "sYH7DAbwlgC4J+R2Z7F"
+ "Ux1qLnV7MGF40smVSoJ/jvHRfYhQeUJd/"
+ "SnYtGWhPHR0Sz+GE2F2yth0B36Vcz2KpnufB"
+ "JbsysjjW4kblBUiIjiURUWqJY65zxbnTy57GQyH58zgy0QBtTQv5gH15XMdKkYu+"
+ "TGaJM"
+ "nlm2O34uI4b9tflqp1+QEFGzoW/"
+ "ulmcofcpkZCYJhDfSpme7QcrHa+Xfji8paEQkTkSfm"
+ "moRWRNZr/F1KfVMjW+IKEnv2FwZfKdzt0BQR6lClcZR0EfEXEfv/"
+ "G6W9iLiIyCoReV5En"
+ "hORIBHx+ufPj/gLB/zGI/G4Bk0AAAAASUVORK5CYII="),
mmenke 2013/10/30 15:27:11 I think this was much better before. Assume you u
akalin 2013/10/30 21:44:37 Done.
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -689,7 +714,11 @@ TEST_F(URLRequestTest, FileTest) {
TestDelegate d;
{
- URLRequest r(app_url, &d, &default_context_);
+ URLRequest r(app_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -718,7 +747,11 @@ TEST_F(URLRequestTest, FileTestCancel) {
TestDelegate d;
{
- URLRequest r(app_url, &d, &default_context_);
+ URLRequest r(app_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -750,7 +783,11 @@ TEST_F(URLRequestTest, FileTestFullSpecifiedRange) {
TestDelegate d;
{
- URLRequest r(temp_url, &d, &default_context_);
+ URLRequest r(temp_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kRange,
@@ -794,7 +831,11 @@ TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) {
TestDelegate d;
{
- URLRequest r(temp_url, &d, &default_context_);
+ URLRequest r(temp_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kRange,
@@ -831,7 +872,11 @@ TEST_F(URLRequestTest, FileTestMultipleRanges) {
TestDelegate d;
{
- URLRequest r(temp_url, &d, &default_context_);
+ URLRequest r(temp_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kRange,
@@ -850,7 +895,11 @@ TEST_F(URLRequestTest, FileTestMultipleRanges) {
TEST_F(URLRequestTest, InvalidUrlTest) {
TestDelegate d;
{
- URLRequest r(GURL("invalid url"), &d, &default_context_);
+ URLRequest r(GURL("invalid url"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -887,8 +936,11 @@ TEST_F(URLRequestTest, ResolveShortcutTest) {
TestDelegate d;
{
- URLRequest r(FilePathToFileURL(base::FilePath(lnk_path)), &d,
- &default_context_);
+ URLRequest r(FilePathToFileURL(base::FilePath(lnk_path)),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -931,7 +983,11 @@ TEST_F(URLRequestTest, FileDirCancelTest) {
file_path = file_path.Append(FILE_PATH_LITERAL("net"));
file_path = file_path.Append(FILE_PATH_LITERAL("data"));
- URLRequest req(FilePathToFileURL(file_path), &d, &default_context_);
+ URLRequest req(FilePathToFileURL(file_path),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
EXPECT_TRUE(req.is_pending());
@@ -956,7 +1012,11 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) {
path = path.Append(FILE_PATH_LITERAL("url_request_unittest"));
TestDelegate d;
- URLRequest req(FilePathToFileURL(path), &d, &default_context_);
+ URLRequest req(FilePathToFileURL(path),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -970,7 +1030,11 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) {
// Don't accept the url "file:///" on windows. See http://crbug.com/1474.
TEST_F(URLRequestTest, FileDirRedirectSingleSlash) {
TestDelegate d;
- URLRequest req(GURL("file:///"), &d, &default_context_);
+ URLRequest req(GURL("file:///"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -1191,7 +1255,11 @@ TEST_F(URLRequestTest, Intercept) {
interceptor.main_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
base::SupportsUserData::Data* user_data0 = new base::SupportsUserData::Data();
base::SupportsUserData::Data* user_data1 = new base::SupportsUserData::Data();
base::SupportsUserData::Data* user_data2 = new base::SupportsUserData::Data();
@@ -1232,7 +1300,11 @@ TEST_F(URLRequestTest, InterceptRedirect) {
interceptor.redirect_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1265,7 +1337,11 @@ TEST_F(URLRequestTest, InterceptServerError) {
interceptor.final_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1294,7 +1370,11 @@ TEST_F(URLRequestTest, InterceptNetworkError) {
interceptor.final_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1323,7 +1403,11 @@ TEST_F(URLRequestTest, InterceptRestartRequired) {
interceptor.main_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1354,7 +1438,11 @@ TEST_F(URLRequestTest, InterceptRespectsCancelMain) {
interceptor.final_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1385,7 +1473,11 @@ TEST_F(URLRequestTest, InterceptRespectsCancelRedirect) {
interceptor.final_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1410,7 +1502,11 @@ TEST_F(URLRequestTest, InterceptRespectsCancelFinal) {
interceptor.cancel_final_request_ = true;
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1436,7 +1532,11 @@ TEST_F(URLRequestTest, InterceptRespectsCancelInRestart) {
interceptor.final_data_ = TestInterceptor::ok_data();
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("GET");
req.Start();
base::RunLoop().Run();
@@ -1451,12 +1551,17 @@ TEST_F(URLRequestTest, InterceptRespectsCancelInRestart) {
}
LoadTimingInfo RunLoadTimingTest(const LoadTimingInfo& job_load_timing,
- URLRequestContext* context) {
+ URLRequestContext* context,
+ NetworkDelegate* delegate) {
TestInterceptor interceptor;
interceptor.intercept_main_request_ = true;
interceptor.main_request_load_timing_info_ = job_load_timing;
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, context);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ context,
+ delegate);
req.Start();
base::RunLoop().Run();
@@ -1530,8 +1635,8 @@ TEST_F(URLRequestTest, InterceptLoadTiming) {
LoadTimingInfo job_load_timing =
NormalLoadTimingInfo(now, CONNECT_TIMING_HAS_DNS_TIMES, false);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Nothing should have been changed by the URLRequest.
EXPECT_EQ(job_load_timing.proxy_resolve_start,
@@ -1561,8 +1666,8 @@ TEST_F(URLRequestTest, InterceptLoadTimingProxy) {
LoadTimingInfo job_load_timing =
NormalLoadTimingInfo(now, CONNECT_TIMING_HAS_SSL_TIMES, true);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Nothing should have been changed by the URLRequest.
EXPECT_EQ(job_load_timing.proxy_resolve_start,
@@ -1606,8 +1711,8 @@ TEST_F(URLRequestTest, InterceptLoadTimingEarlyProxyResolution) {
job_load_timing.connect_timing.connect_end =
now - base::TimeDelta::FromDays(1);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Proxy times, connect times, and DNS times should all be replaced with
// request_start.
@@ -1636,8 +1741,8 @@ TEST_F(URLRequestTest, InterceptLoadTimingEarlyProxyResolutionReused) {
job_load_timing.proxy_resolve_start = now - base::TimeDelta::FromDays(4);
job_load_timing.proxy_resolve_end = now - base::TimeDelta::FromDays(3);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Proxy times and connect times should all be replaced with request_start.
EXPECT_EQ(load_timing_result.request_start,
@@ -1665,8 +1770,8 @@ TEST_F(URLRequestTest, InterceptLoadTimingEarlyConnect) {
job_load_timing.connect_timing.connect_end =
now - base::TimeDelta::FromDays(4);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Connect times, and SSL times should be replaced with request_start.
EXPECT_EQ(load_timing_result.request_start,
@@ -1697,8 +1802,8 @@ TEST_F(URLRequestTest, InterceptLoadTimingEarlyConnectWithProxy) {
job_load_timing.connect_timing.connect_end =
now - base::TimeDelta::FromDays(2);
- LoadTimingInfo load_timing_result = RunLoadTimingTest(job_load_timing,
- &default_context_);
+ LoadTimingInfo load_timing_result = RunLoadTimingTest(
+ job_load_timing, &default_context_, &default_network_delegate_);
// Connect times should be replaced with proxy_resolve_end.
EXPECT_EQ(load_timing_result.proxy_resolve_end,
@@ -1715,8 +1820,10 @@ TEST_F(URLRequestTest, InterceptLoadTimingEarlyConnectWithProxy) {
TEST_F(URLRequestTest, Identifiers) {
TestDelegate d;
TestURLRequestContext context;
- TestURLRequest req(GURL("http://example.com"), &d, &context, NULL);
- TestURLRequest other_req(GURL("http://example.com"), &d, &context, NULL);
+ TestURLRequest req(
+ GURL("http://example.com"), DEFAULT_PRIORITY, &d, &context, NULL);
+ TestURLRequest other_req(
+ GURL("http://example.com"), DEFAULT_PRIORITY, &d, &context, NULL);
ASSERT_NE(req.identifier(), other_req.identifier());
}
@@ -1731,7 +1838,11 @@ TEST_F(URLRequestTest, NetworkDelegateProxyError) {
TestURLRequestContextWithProxy context("myproxy:70", &network_delegate);
TestDelegate d;
- URLRequest req(GURL("http://example.com"), &d, &context);
+ URLRequest req(GURL("http://example.com"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.set_method("GET");
req.Start();
@@ -1751,7 +1862,11 @@ TEST_F(URLRequestTest, NetworkDelegateProxyError) {
// content is empty.
TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) {
TestDelegate d;
- URLRequest req(GURL("data:,"), &d, &default_context_);
+ URLRequest req(GURL("data:,"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
EXPECT_EQ("", d.data_received());
@@ -1762,7 +1877,11 @@ TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) {
// correctly, both before and after start.
TEST_F(URLRequestTest, SetPriorityBasic) {
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
EXPECT_EQ(DEFAULT_PRIORITY, req.priority());
req.SetPriority(LOW);
@@ -1779,7 +1898,11 @@ TEST_F(URLRequestTest, SetPriorityBasic) {
// Start on it.
TEST_F(URLRequestTest, SetJobPriorityBeforeJobStart) {
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
EXPECT_EQ(DEFAULT_PRIORITY, req.priority());
scoped_refptr<URLRequestTestJob> job =
@@ -1797,7 +1920,11 @@ TEST_F(URLRequestTest, SetJobPriorityBeforeJobStart) {
// job.
TEST_F(URLRequestTest, SetJobPriority) {
TestDelegate d;
- URLRequest req(GURL("http://test_intercept/foo"), &d, &default_context_);
+ URLRequest req(GURL("http://test_intercept/foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
scoped_refptr<URLRequestTestJob> job =
new URLRequestTestJob(&req, &default_network_delegate_);
@@ -1844,8 +1971,11 @@ TEST_F(URLRequestTest, DelayedCookieCallback) {
TestNetworkDelegate network_delegate;
context.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("set-cookie?CookieToNotSend=1"), &d, &context);
+ URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
@@ -1858,7 +1988,11 @@ TEST_F(URLRequestTest, DelayedCookieCallback) {
TestNetworkDelegate network_delegate;
context.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(test_server.GetURL("echoheader?Cookie"), &d, &context);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -1879,8 +2013,10 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
@@ -1892,8 +2028,11 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -1908,8 +2047,11 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.set_load_flags(LOAD_DO_NOT_SEND_COOKIES);
req.Start();
base::RunLoop().Run();
@@ -1933,8 +2075,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotUpdate=2"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -1950,8 +2094,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
TestDelegate d;
URLRequest req(
test_server.GetURL("set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.set_load_flags(LOAD_DO_NOT_SAVE_COOKIES);
req.Start();
@@ -1968,8 +2114,11 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -1994,8 +2143,10 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2008,8 +2159,11 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2026,8 +2180,11 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
network_delegate.set_cookie_options(TestNetworkDelegate::NO_GET_COOKIES);
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2049,8 +2206,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotUpdate=2"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2066,8 +2225,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
network_delegate.set_cookie_options(TestNetworkDelegate::NO_SET_COOKIE);
URLRequest req(
test_server.GetURL("set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2081,8 +2242,11 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2105,7 +2269,11 @@ TEST_F(URLRequestTest, DoNotSaveEmptyCookies) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(test_server.GetURL("set-cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("set-cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2125,8 +2293,10 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotSend=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2139,8 +2309,11 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2157,8 +2330,11 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
network_delegate.set_cookie_options(TestNetworkDelegate::NO_GET_COOKIES);
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2180,8 +2356,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
URLRequest req(test_server.GetURL("set-cookie?CookieToNotUpdate=2"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2197,8 +2375,10 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
network_delegate.set_cookie_options(TestNetworkDelegate::NO_SET_COOKIE);
URLRequest req(
test_server.GetURL("set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2212,8 +2392,11 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2279,10 +2462,13 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(test_server.GetURL(
- "set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
+ URLRequest req(
+ test_server.GetURL(
+ "set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
}
@@ -2291,8 +2477,11 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2303,10 +2492,13 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
FixedDateNetworkDelegate network_delegate("18-Apr-1977 22:49:13 UTC");
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(test_server.GetURL(
- "set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
+ URLRequest req(
+ test_server.GetURL(
+ "set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
}
@@ -2315,8 +2507,11 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
TestNetworkDelegate network_delegate;
default_context_.set_network_delegate(&network_delegate);
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Cookie"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Cookie"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
@@ -2335,8 +2530,11 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) {
// only the latter shall be respected.
{
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Referer"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Referer"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetReferrer("http://foo.com/");
HttpRequestHeaders headers;
@@ -2353,8 +2551,11 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) {
// shall be sent in the header.
{
TestDelegate d;
- URLRequest req(
- test_server.GetURL("echoheader?Referer"), &d, &default_context_);
+ URLRequest req(test_server.GetURL("echoheader?Referer"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kReferer, "http://bar.com/");
@@ -2389,7 +2590,11 @@ class URLRequestTestHTTP : public URLRequestTest {
bool include_data) {
static const char kData[] = "hello world";
TestDelegate d;
- URLRequest req(redirect_url, &d, &default_context_);
+ URLRequest req(redirect_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method(request_method);
if (include_data) {
req.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
@@ -2434,7 +2639,11 @@ class URLRequestTestHTTP : public URLRequestTest {
for (int i = 0; i < kIterations; ++i) {
TestDelegate d;
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.set_method(method.c_str());
r.set_upload(make_scoped_ptr(CreateSimpleUploadData(uploadBytes)));
@@ -2482,8 +2691,10 @@ class URLRequestTestHTTP : public URLRequestTest {
TestDelegate d;
URLRequest r(test_server_.GetURL("set-many-cookies?" +
base::IntToString(num_cookies)),
- &d,
- &default_context_);
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -2523,7 +2734,11 @@ TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) {
TestDelegate d;
{
- URLRequest r(GURL("https://www.redirect.com/"), &d, &context);
+ URLRequest r(GURL("https://www.redirect.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -2549,7 +2764,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateTunnelConnectionFailed) {
TestDelegate d;
{
- URLRequest r(GURL("https://www.redirect.com/"), &d, &context);
+ URLRequest r(GURL("https://www.redirect.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -2590,7 +2809,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateBlockAsynchronously) {
context.Init();
{
- URLRequest r(test_server_.GetURL("empty.html"), &d, &context);
+ URLRequest r(test_server_.GetURL("empty.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
for (size_t i = 0; i < blocking_stages_length; ++i) {
@@ -2623,7 +2846,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequest) {
&network_delegate);
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2653,7 +2880,7 @@ void NetworkDelegateCancelRequest(BlockingNetworkDelegate::BlockMode block_mode,
context.Init();
{
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2730,7 +2957,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequest) {
{
GURL original_url(test_server_.GetURL("empty.html"));
- URLRequest r(original_url, &d, &context);
+ URLRequest r(
+ original_url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2763,7 +2991,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequestSynchronously) {
{
GURL original_url(test_server_.GetURL("empty.html"));
- URLRequest r(original_url, &d, &context);
+ URLRequest r(
+ original_url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2798,7 +3027,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequestPost) {
{
GURL original_url(test_server_.GetURL("empty.html"));
- URLRequest r(original_url, &d, &context);
+ URLRequest r(
+ original_url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.set_method("POST");
r.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
HttpRequestHeaders headers;
@@ -2840,7 +3070,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncNoAction) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2871,7 +3101,7 @@ TEST_F(URLRequestTestHTTP,
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
{
@@ -2912,7 +3142,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncSetAuth) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2947,7 +3177,7 @@ TEST_F(URLRequestTestHTTP,
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -2985,7 +3215,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncCancel) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3019,7 +3249,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncNoAction) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3054,7 +3284,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncSetAuth) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3087,7 +3317,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncCancel) {
{
GURL url(test_server_.GetURL("auth-basic"));
- URLRequest r(url, &d, &context);
+ URLRequest r(url, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3117,7 +3347,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting1) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3153,7 +3387,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting2) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3188,7 +3426,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting3) {
context.Init();
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &context);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3223,7 +3465,11 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting4) {
context.Init();
{
- URLRequest r(test_server_.GetURL("auth-basic"), &d, &context);
+ URLRequest r(test_server_.GetURL("auth-basic"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -3255,7 +3501,11 @@ TEST_F(URLRequestTestHTTP, UnexpectedServerAuthTest) {
TestDelegate d;
{
- URLRequest r(GURL("https://www.server-auth.com/"), &d, &context);
+ URLRequest r(GURL("https://www.server-auth.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3272,7 +3522,11 @@ TEST_F(URLRequestTestHTTP, GetTest_NoCache) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3338,7 +3592,11 @@ TEST_F(URLRequestTestHTTP, GetTest) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3361,7 +3619,11 @@ TEST_F(URLRequestTestHTTP, GetTest_GetFullRequestHeaders) {
TestDelegate d;
{
GURL test_url(test_server_.GetURL(std::string()));
- URLRequest r(test_url, &d, &default_context_);
+ URLRequest r(test_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
EXPECT_FALSE(r.GetFullRequestHeaders(&headers));
@@ -3389,7 +3651,11 @@ TEST_F(URLRequestTestHTTP, GetTestLoadTiming) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3439,7 +3705,11 @@ TEST_F(URLRequestTestHTTP, GetZippedTest) {
context.set_network_delegate(&network_delegate);
context.Init();
- URLRequest r(test_server_.GetURL(test_file), &d, &context);
+ URLRequest r(test_server_.GetURL(test_file),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -3475,8 +3745,12 @@ TEST_F(URLRequestTestHTTP, HTTPSToHTTPRedirectNoRefererTest) {
// server should not be sent the referer.
GURL http_destination = test_server_.GetURL(std::string());
TestDelegate d;
- URLRequest req(https_test_server.GetURL(
- "server-redirect?" + http_destination.spec()), &d, &default_context_);
+ URLRequest req(
+ https_test_server.GetURL("server-redirect?" + http_destination.spec()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetReferrer("https://www.referrer.com/");
req.Start();
base::RunLoop().Run();
@@ -3494,7 +3768,11 @@ TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
GURL original_url =
test_server_.GetURL("server-redirect?" + destination_url.spec());
TestDelegate d;
- URLRequest req(original_url, &d, &default_context_);
+ URLRequest req(original_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -3534,7 +3812,11 @@ TEST_F(URLRequestTestHTTP, MultipleRedirectTest) {
GURL original_url = test_server_.GetURL(
"server-redirect?" + middle_redirect_url.spec());
TestDelegate d;
- URLRequest req(original_url, &d, &default_context_);
+ URLRequest req(original_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -3850,7 +4132,10 @@ TEST_F(URLRequestTestHTTP, DelegateInfoBeforeStart) {
{
URLRequest r(test_server_.GetURL("empty.html"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ NULL);
LoadStateWithParam load_state = r.GetLoadState();
EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
EXPECT_EQ(string16(), load_state.param);
@@ -3896,7 +4181,10 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfo) {
{
URLRequest r(test_server_.GetURL("simple.html"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ &network_delegate);
LoadStateWithParam load_state = r.GetLoadState();
EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
EXPECT_EQ(string16(), load_state.param);
@@ -3947,7 +4235,10 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoRedirect) {
{
URLRequest r(test_server_.GetURL("server-redirect?simple.html"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ &network_delegate);
LoadStateWithParam load_state = r.GetLoadState();
EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
EXPECT_EQ(string16(), load_state.param);
@@ -4023,7 +4314,10 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoAuth) {
{
URLRequest r(test_server_.GetURL("auth-basic"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ &network_delegate);
LoadStateWithParam load_state = r.GetLoadState();
EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
EXPECT_EQ(string16(), load_state.param);
@@ -4081,7 +4375,10 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) {
// the possability of multiple reads being combined in the unlikely event
// that it occurs.
URLRequest r(test_server_.GetURL("chunked?waitBetweenChunks=20"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ NULL);
LoadStateWithParam load_state = r.GetLoadState();
r.Start();
base::RunLoop().Run();
@@ -4129,7 +4426,10 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfoOnRedirect) {
{
URLRequest r(test_server_.GetURL("server-redirect?simple.html"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ NULL);
LoadStateWithParam load_state = r.GetLoadState();
r.Start();
base::RunLoop().Run();
@@ -4187,7 +4487,10 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateOnRedirectCancelled) {
{
URLRequest r(test_server_.GetURL("server-redirect?simple.html"),
- &request_delegate, &context);
+ DEFAULT_PRIORITY,
+ &request_delegate,
+ &context,
+ NULL);
LoadStateWithParam load_state = r.GetLoadState();
r.Start();
base::RunLoop().Run();
@@ -4248,7 +4551,11 @@ TEST_F(URLRequestTestHTTP, RedirectWithAdditionalHeadersTest) {
GURL original_url = test_server_.GetURL(
"server-redirect?" + destination_url.spec());
RedirectWithAdditionalHeadersDelegate d;
- URLRequest req(original_url, &d, &default_context_);
+ URLRequest req(original_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4284,7 +4591,11 @@ TEST_F(URLRequestTestHTTP, RedirectWithHeaderRemovalTest) {
GURL original_url = test_server_.GetURL(
"server-redirect?" + destination_url.spec());
RedirectWithHeaderRemovalDelegate d;
- URLRequest req(original_url, &d, &default_context_);
+ URLRequest req(original_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetExtraRequestHeaderByName(kExtraHeaderToRemove, "dummy", false);
req.Start();
base::RunLoop().Run();
@@ -4300,7 +4611,11 @@ TEST_F(URLRequestTestHTTP, RedirectWithHeaderRemovalTest) {
TEST_F(URLRequestTestHTTP, CancelTest) {
TestDelegate d;
{
- URLRequest r(GURL("http://www.google.com/"), &d, &default_context_);
+ URLRequest r(GURL("http://www.google.com/"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4322,7 +4637,11 @@ TEST_F(URLRequestTestHTTP, CancelTest2) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
d.set_cancel_in_response_started(true);
@@ -4343,7 +4662,11 @@ TEST_F(URLRequestTestHTTP, CancelTest3) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
d.set_cancel_in_received_data(true);
@@ -4367,7 +4690,11 @@ TEST_F(URLRequestTestHTTP, CancelTest4) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server_.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -4393,7 +4720,11 @@ TEST_F(URLRequestTestHTTP, CancelTest5) {
// populate cache
{
TestDelegate d;
- URLRequest r(test_server_.GetURL("cachetime"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("cachetime"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
base::RunLoop().Run();
EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status());
@@ -4402,7 +4733,11 @@ TEST_F(URLRequestTestHTTP, CancelTest5) {
// cancel read from cache (see bug 990242)
{
TestDelegate d;
- URLRequest r(test_server_.GetURL("cachetime"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("cachetime"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
r.Cancel();
base::RunLoop().Run();
@@ -4429,7 +4764,11 @@ TEST_F(URLRequestTestHTTP, PostEmptyTest) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.set_method("POST");
r.Start();
@@ -4451,7 +4790,11 @@ TEST_F(URLRequestTestHTTP, PostFileTest) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.set_method("POST");
base::FilePath dir;
@@ -4511,7 +4854,11 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataBeforeStart) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.EnableChunkedUpload();
r.set_method("POST");
AddChunksToUpload(&r);
@@ -4529,7 +4876,11 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataJustAfterStart) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.EnableChunkedUpload();
r.set_method("POST");
r.Start();
@@ -4546,7 +4897,11 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataAfterStart) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("echo"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("echo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.EnableChunkedUpload();
r.set_method("POST");
r.Start();
@@ -4564,8 +4919,11 @@ TEST_F(URLRequestTestHTTP, ResponseHeadersTest) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("files/with-headers.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/with-headers.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4598,10 +4956,11 @@ TEST_F(URLRequestTestHTTP, ProcessSTS) {
ASSERT_TRUE(https_test_server.Start());
TestDelegate d;
- URLRequest request(
- https_test_server.GetURL("files/hsts-headers.html"),
- &d,
- &default_context_);
+ URLRequest request(https_test_server.GetURL("files/hsts-headers.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
request.Start();
base::RunLoop().Run();
@@ -4642,10 +5001,11 @@ TEST_F(URLRequestTestHTTP, MAYBE_ProcessPKP) {
ASSERT_TRUE(https_test_server.Start());
TestDelegate d;
- URLRequest request(
- https_test_server.GetURL("files/hpkp-headers.html"),
- &d,
- &default_context_);
+ URLRequest request(https_test_server.GetURL("files/hpkp-headers.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
request.Start();
base::RunLoop().Run();
@@ -4675,8 +5035,10 @@ TEST_F(URLRequestTestHTTP, ProcessSTSOnce) {
TestDelegate d;
URLRequest request(
https_test_server.GetURL("files/hsts-multiple-headers.html"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
request.Start();
base::RunLoop().Run();
@@ -4704,8 +5066,10 @@ TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP) {
TestDelegate d;
URLRequest request(
https_test_server.GetURL("files/hsts-and-hpkp-headers.html"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
request.Start();
base::RunLoop().Run();
@@ -4746,8 +5110,10 @@ TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP2) {
TestDelegate d;
URLRequest request(
https_test_server.GetURL("files/hsts-and-hpkp-headers2.html"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
request.Start();
base::RunLoop().Run();
@@ -4775,8 +5141,11 @@ TEST_F(URLRequestTestHTTP, ContentTypeNormalizationTest) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(test_server_.GetURL(
- "files/content-type-normalization.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/content-type-normalization.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4808,8 +5177,11 @@ TEST_F(URLRequestTestHTTP, RestrictFileRedirects) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(test_server_.GetURL(
- "files/redirect-to-file.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-to-file.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4821,8 +5193,11 @@ TEST_F(URLRequestTestHTTP, RestrictDataRedirects) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(test_server_.GetURL(
- "files/redirect-to-data.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-to-data.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::MessageLoop::current()->Run();
@@ -4834,8 +5209,11 @@ TEST_F(URLRequestTestHTTP, RedirectToInvalidURL) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(test_server_.GetURL(
- "files/redirect-to-invalid-url.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-to-invalid-url.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4847,8 +5225,11 @@ TEST_F(URLRequestTestHTTP, NoUserPassInReferrer) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheader?Referer"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheader?Referer"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetReferrer("http://user:pass@foo.com/");
req.Start();
base::RunLoop().Run();
@@ -4860,8 +5241,11 @@ TEST_F(URLRequestTestHTTP, NoFragmentInReferrer) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheader?Referer"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheader?Referer"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetReferrer("http://foo.com/test#fragment");
req.Start();
base::RunLoop().Run();
@@ -4873,8 +5257,11 @@ TEST_F(URLRequestTestHTTP, EmptyReferrerAfterValidReferrer) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheader?Referer"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheader?Referer"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.SetReferrer("http://foo.com/test#fragment");
req.SetReferrer("");
req.Start();
@@ -4889,8 +5276,11 @@ TEST_F(URLRequestTestHTTP, CancelRedirect) {
TestDelegate d;
{
d.set_cancel_in_received_redirect(true);
- URLRequest req(
- test_server_.GetURL("files/redirect-test.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-test.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4908,7 +5298,11 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect) {
{
d.set_quit_on_redirect(true);
GURL test_url(test_server_.GetURL("files/redirect-test.html"));
- URLRequest req(test_url, &d, &default_context_);
+ URLRequest req(test_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -4942,7 +5336,11 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect_GetFullRequestHeaders) {
{
d.set_quit_on_redirect(true);
GURL test_url(test_server_.GetURL("files/redirect-test.html"));
- URLRequest req(test_url, &d, &default_context_);
+ URLRequest req(test_url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
EXPECT_FALSE(d.have_full_request_headers());
@@ -4983,8 +5381,11 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) {
TestDelegate d;
{
d.set_quit_on_redirect(true);
- URLRequest req(
- test_server_.GetURL("files/redirect-test.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-test.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
@@ -5006,8 +5407,11 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
// Populate the cache.
{
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheadercache?foo"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheadercache?foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader("foo", "1");
req.SetExtraRequestHeaders(headers);
@@ -5022,8 +5426,11 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
// Expect a cache hit.
{
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheadercache?foo"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheadercache?foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader("foo", "1");
req.SetExtraRequestHeaders(headers);
@@ -5040,8 +5447,11 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
// Expect a cache miss.
{
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheadercache?foo"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("echoheadercache?foo"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader("foo", "2");
req.SetExtraRequestHeaders(headers);
@@ -5064,7 +5474,11 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
TestDelegate d;
d.set_credentials(AuthCredentials(kUser, kSecret));
- URLRequest r(test_server_.GetURL("auth-basic"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("auth-basic"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
base::RunLoop().Run();
@@ -5079,7 +5493,11 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
TestDelegate d;
d.set_credentials(AuthCredentials(kUser, kSecret));
- URLRequest r(test_server_.GetURL("auth-basic"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("auth-basic"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.set_load_flags(LOAD_VALIDATE_CACHE);
r.Start();
@@ -5111,7 +5529,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
TestDelegate d;
d.set_credentials(AuthCredentials(kUser, kSecret));
- URLRequest r(url_requiring_auth, &d, &context);
+ URLRequest r(
+ url_requiring_auth, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -5140,7 +5559,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
replacements.SetPasswordStr(password);
GURL url_with_identity = url_requiring_auth.ReplaceComponents(replacements);
- URLRequest r(url_with_identity, &d, &context);
+ URLRequest r(
+ url_with_identity, DEFAULT_PRIORITY, &d, &context, &network_delegate);
r.Start();
base::RunLoop().Run();
@@ -5162,7 +5582,11 @@ TEST_F(URLRequestTestHTTP, BasicAuthLoadTiming) {
TestDelegate d;
d.set_credentials(AuthCredentials(kUser, kSecret));
- URLRequest r(test_server_.GetURL("auth-basic"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("auth-basic"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
base::RunLoop().Run();
@@ -5193,7 +5617,11 @@ TEST_F(URLRequestTestHTTP, BasicAuthLoadTiming) {
TestDelegate d;
d.set_credentials(AuthCredentials(kUser, kSecret));
- URLRequest r(test_server_.GetURL("auth-basic"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("auth-basic"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.set_load_flags(LOAD_VALIDATE_CACHE);
r.Start();
@@ -5222,8 +5650,11 @@ TEST_F(URLRequestTestHTTP, Post302RedirectGet) {
const char kData[] = "hello world";
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("files/redirect-to-echoall"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("files/redirect-to-echoall"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("POST");
req.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
@@ -5309,7 +5740,11 @@ TEST_F(URLRequestTestHTTP, InterceptPost302RedirectGet) {
const char kData[] = "hello world";
TestDelegate d;
- URLRequest req(test_server_.GetURL("empty.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("empty.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("POST");
req.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
HttpRequestHeaders headers;
@@ -5333,7 +5768,11 @@ TEST_F(URLRequestTestHTTP, InterceptPost307RedirectPost) {
const char kData[] = "hello world";
TestDelegate d;
- URLRequest req(test_server_.GetURL("empty.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("empty.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
req.set_method("POST");
req.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
HttpRequestHeaders headers;
@@ -5364,8 +5803,11 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptLanguage) {
context.Init();
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheader?Accept-Language"), &d, &context);
+ URLRequest req(test_server_.GetURL("echoheader?Accept-Language"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
EXPECT_EQ("en", d.data_received());
@@ -5385,8 +5827,11 @@ TEST_F(URLRequestTestHTTP, EmptyAcceptLanguage) {
context.set_http_user_agent_settings(&settings);
TestDelegate d;
- URLRequest req(
- test_server_.GetURL("echoheader?Accept-Language"), &d, &context);
+ URLRequest req(test_server_.GetURL("echoheader?Accept-Language"),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
EXPECT_EQ("None", d.data_received());
@@ -5399,8 +5844,10 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptLanguage) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?Accept-Language"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kAcceptLanguage, "ru");
req.SetExtraRequestHeaders(headers);
@@ -5415,8 +5862,10 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptEncoding) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?Accept-Encoding"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
req.SetExtraRequestHeaders(headers);
req.Start();
@@ -5431,8 +5880,10 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptEncoding) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?Accept-Encoding"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kAcceptEncoding, "identity");
req.SetExtraRequestHeaders(headers);
@@ -5448,8 +5899,10 @@ TEST_F(URLRequestTestHTTP, SetAcceptCharset) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?Accept-Charset"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kAcceptCharset, "koi-8r");
req.SetExtraRequestHeaders(headers);
@@ -5464,8 +5917,10 @@ TEST_F(URLRequestTestHTTP, DefaultUserAgent) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
req.Start();
base::RunLoop().Run();
EXPECT_EQ(req.context()->GetUserAgent(req.url()), d.data_received());
@@ -5478,8 +5933,10 @@ TEST_F(URLRequestTestHTTP, OverrideUserAgent) {
TestDelegate d;
URLRequest req(test_server_.GetURL("echoheader?User-Agent"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
HttpRequestHeaders headers;
headers.SetHeader(HttpRequestHeaders::kUserAgent, "Lynx (textmode)");
req.SetExtraRequestHeaders(headers);
@@ -5514,7 +5971,11 @@ TEST_F(URLRequestTestHTTP, EmptyHttpUserAgentSettings) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) {
TestDelegate d;
- URLRequest req(test_server_.GetURL(tests[i].request), &d, &context);
+ URLRequest req(test_server_.GetURL(tests[i].request),
+ DEFAULT_PRIORITY,
+ &d,
+ &context,
+ &network_delegate);
req.Start();
base::RunLoop().Run();
EXPECT_EQ(tests[i].expected_response, d.data_received())
@@ -5528,7 +5989,11 @@ TEST_F(URLRequestTestHTTP, SetSubsequentJobPriority) {
ASSERT_TRUE(test_server_.Start());
TestDelegate d;
- URLRequest req(test_server_.GetURL("empty.html"), &d, &default_context_);
+ URLRequest req(test_server_.GetURL("empty.html"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
EXPECT_EQ(DEFAULT_PRIORITY, req.priority());
scoped_refptr<URLRequestRedirectJob> redirect_job =
@@ -5572,7 +6037,11 @@ TEST_F(HTTPSRequestTest, HTTPSGetTest) {
TestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5603,7 +6072,11 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5639,7 +6112,11 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) {
TestDelegate d;
{
d.set_allow_certificate_errors(err_allowed);
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5684,7 +6161,8 @@ TEST_F(HTTPSRequestTest, TLSv1Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(
+ test_server.GetURL(std::string()), DEFAULT_PRIORITY, &d, &context, NULL);
r.Start();
base::RunLoop().Run();
@@ -5725,8 +6203,10 @@ TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) {
TestDelegate d;
URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d",
test_server.host_port_pair().port())),
+ DEFAULT_PRIORITY,
&d,
- &context);
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5773,8 +6253,10 @@ TEST_F(HTTPSRequestTest, HTTPSErrorsNoClobberTSSTest) {
TestDelegate d;
URLRequest r(GURL(base::StringPrintf("https://www.google.com:%d",
test_server.host_port_pair().port())),
+ DEFAULT_PRIORITY,
&d,
- &context);
+ &context,
+ &network_delegate);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5844,8 +6326,10 @@ TEST_F(HTTPSRequestTest, HSTSPreservesPosts) {
URLRequest req(GURL(base::StringPrintf("http://www.somewhere.com:%d/echo",
test_server.host_port_pair().port())),
+ DEFAULT_PRIORITY,
&d,
- &context);
+ &context,
+ &network_delegate);
req.set_method("POST");
req.set_upload(make_scoped_ptr(CreateSimpleUploadData(kData)));
@@ -5877,7 +6361,8 @@ TEST_F(HTTPSRequestTest, SSLv3Fallback) {
TestURLRequestContext context(true);
context.Init();
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context);
+ URLRequest r(
+ test_server.GetURL(std::string()), DEFAULT_PRIORITY, &d, &context, NULL);
r.Start();
base::RunLoop().Run();
@@ -5926,7 +6411,11 @@ TEST_F(HTTPSRequestTest, ClientAuthTest) {
SSLClientAuthTestDelegate d;
{
- URLRequest r(test_server.GetURL(std::string()), &d, &default_context_);
+ URLRequest r(test_server.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5965,8 +6454,11 @@ TEST_F(HTTPSRequestTest, ResumeTest) {
{
TestDelegate d;
- URLRequest r(
- test_server.GetURL("ssl-session-cache"), &d, &default_context_);
+ URLRequest r(test_server.GetURL("ssl-session-cache"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -5981,8 +6473,11 @@ TEST_F(HTTPSRequestTest, ResumeTest) {
{
TestDelegate d;
- URLRequest r(
- test_server.GetURL("ssl-session-cache"), &d, &default_context_);
+ URLRequest r(test_server.GetURL("ssl-session-cache"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6034,8 +6529,11 @@ TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) {
{
TestDelegate d;
- URLRequest r(
- test_server.GetURL("ssl-session-cache"), &d, &default_context_);
+ URLRequest r(test_server.GetURL("ssl-session-cache"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6066,8 +6564,11 @@ TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) {
{
TestDelegate d;
- URLRequest r(
- test_server.GetURL("ssl-session-cache"), &d, &default_context_);
+ URLRequest r(test_server.GetURL("ssl-session-cache"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6185,7 +6686,11 @@ class HTTPSOCSPTest : public HTTPSRequestTest {
TestDelegate d;
d.set_allow_certificate_errors(true);
- URLRequest r(test_server.GetURL(std::string()), &d, &context_);
+ URLRequest r(test_server.GetURL(std::string()),
+ DEFAULT_PRIORITY,
+ &d,
+ &context_,
+ NULL);
r.Start();
base::RunLoop().Run();
@@ -6640,7 +7145,11 @@ TEST_F(URLRequestTestFTP, UnsafePort) {
TestDelegate d;
{
- URLRequest r(url, &d, &default_context_);
+ URLRequest r(url,
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6658,7 +7167,11 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPDirectoryListing) {
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("/"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("/"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6684,7 +7197,11 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTestAnonymous) {
app_path = app_path.AppendASCII("LICENSE");
TestDelegate d;
{
- URLRequest r(test_server_.GetURL("/LICENSE"), &d, &default_context_);
+ URLRequest r(test_server_.GetURL("/LICENSE"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6715,8 +7232,10 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPGetTest) {
{
URLRequest r(
test_server_.GetURLWithUserAndPassword("/LICENSE", "chrome", "chrome"),
+ DEFAULT_PRIORITY,
&d,
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6749,12 +7268,12 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPassword) {
app_path = app_path.AppendASCII("LICENSE");
TestDelegate d;
{
- URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "chrome",
- "wrong_password"),
- &d,
- &default_context_);
+ URLRequest r(test_server_.GetURLWithUserAndPassword(
+ "/LICENSE", "chrome", "wrong_password"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6782,12 +7301,12 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongPasswordRestart) {
// the initial login with wrong credentials will fail.
d.set_credentials(AuthCredentials(kChrome, kChrome));
{
- URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "chrome",
- "wrong_password"),
- &d,
- &default_context_);
+ URLRequest r(test_server_.GetURLWithUserAndPassword(
+ "/LICENSE", "chrome", "wrong_password"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6812,12 +7331,12 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUser) {
app_path = app_path.AppendASCII("LICENSE");
TestDelegate d;
{
- URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "wrong_user",
- "chrome"),
- &d,
- &default_context_);
+ URLRequest r(test_server_.GetURLWithUserAndPassword(
+ "/LICENSE", "wrong_user", "chrome"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6845,12 +7364,12 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCheckWrongUserRestart) {
// the initial login with wrong credentials will fail.
d.set_credentials(AuthCredentials(kChrome, kChrome));
{
- URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "wrong_user",
- "chrome"),
- &d,
- &default_context_);
+ URLRequest r(test_server_.GetURLWithUserAndPassword(
+ "/LICENSE", "wrong_user", "chrome"),
+ DEFAULT_PRIORITY,
+ &d,
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6878,11 +7397,11 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) {
{
// Pass correct login identity in the URL.
URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "chrome",
- "chrome"),
+ test_server_.GetURLWithUserAndPassword("/LICENSE", "chrome", "chrome"),
+ DEFAULT_PRIORITY,
d.get(),
- &default_context_);
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6900,7 +7419,11 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheURLCredentials) {
d.reset(new TestDelegate);
{
// This request should use cached identity from previous request.
- URLRequest r(test_server_.GetURL("/LICENSE"), d.get(), &default_context_);
+ URLRequest r(test_server_.GetURL("/LICENSE"),
+ DEFAULT_PRIORITY,
+ d.get(),
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6929,12 +7452,12 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheLoginBoxCredentials) {
// the initial login with wrong credentials will fail.
d->set_credentials(AuthCredentials(kChrome, kChrome));
{
- URLRequest r(
- test_server_.GetURLWithUserAndPassword("/LICENSE",
- "chrome",
- "wrong_password"),
- d.get(),
- &default_context_);
+ URLRequest r(test_server_.GetURLWithUserAndPassword(
+ "/LICENSE", "chrome", "wrong_password"),
+ DEFAULT_PRIORITY,
+ d.get(),
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());
@@ -6955,7 +7478,11 @@ TEST_F(URLRequestTestFTP, DISABLED_FTPCacheLoginBoxCredentials) {
{
// Don't pass wrong credentials in the URL, they would override valid cached
// ones.
- URLRequest r(test_server_.GetURL("/LICENSE"), d.get(), &default_context_);
+ URLRequest r(test_server_.GetURL("/LICENSE"),
+ DEFAULT_PRIORITY,
+ d.get(),
+ &default_context_,
+ &default_network_delegate_);
r.Start();
EXPECT_TRUE(r.is_pending());

Powered by Google App Engine
This is Rietveld 408576698