| 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 7282a0e54070ce6c5c9e8ca5468d0b0cc56167d7..aef7cfb0806994ca7578766a797dbfa48107d7b7 100644
|
| --- a/net/url_request/url_request_unittest.cc
|
| +++ b/net/url_request/url_request_unittest.cc
|
| @@ -108,6 +108,7 @@
|
| #include "net/test/spawned_test_server/spawned_test_server.h"
|
| #include "net/test/test_data_directory.h"
|
| #include "net/test/url_request/url_request_failed_job.h"
|
| +#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
|
| #include "net/url_request/data_protocol_handler.h"
|
| #include "net/url_request/static_http_user_agent_settings.h"
|
| #include "net/url_request/url_request.h"
|
| @@ -841,8 +842,9 @@ class URLRequestTest : public PlatformTest {
|
| TEST_F(URLRequestTest, AboutBlankTest) {
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - GURL("about:blank"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + default_context_.CreateRequest(GURL("about:blank"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -885,7 +887,7 @@ TEST_F(URLRequestTest, DataURLImageTest) {
|
| "34uI4b9tflqp1+QEFGzoW/ulmcofcpkZCYJhDfSpme7QcrHa+Xfji8paEQkTkSfmm"
|
| "oRWRNZr/F1KfVMjW+IKEnv2FwZfKdzt0BQR6lClcZR0EfEXEfv/G6W9iLiIyCoReV"
|
| "5EnhORIBHx+ufPj/gLB/zGI/G4Bk0AAAAASUVORK5CYII="),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -919,8 +921,8 @@ TEST_F(URLRequestTest, FileTest) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(app_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + app_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -949,8 +951,8 @@ TEST_F(URLRequestTest, FileTestCancel) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(app_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + app_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -983,8 +985,8 @@ TEST_F(URLRequestTest, FileTestFullSpecifiedRange) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(temp_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + temp_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(
|
| @@ -1028,8 +1030,8 @@ TEST_F(URLRequestTest, FileTestHalfSpecifiedRange) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(temp_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + temp_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kRange,
|
| @@ -1066,8 +1068,8 @@ TEST_F(URLRequestTest, FileTestMultipleRanges) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(temp_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + temp_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kRange, "bytes=0-0,10-200,200-300");
|
| @@ -1096,8 +1098,8 @@ TEST_F(URLRequestTest, AllowFileURLs) {
|
| TestNetworkDelegate network_delegate;
|
| network_delegate.set_can_access_files(true);
|
| default_context_.set_network_delegate(&network_delegate);
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(test_file_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + test_file_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
| EXPECT_FALSE(d.request_failed());
|
| @@ -1109,8 +1111,8 @@ TEST_F(URLRequestTest, AllowFileURLs) {
|
| TestNetworkDelegate network_delegate;
|
| network_delegate.set_can_access_files(false);
|
| default_context_.set_network_delegate(&network_delegate);
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(test_file_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + test_file_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
| EXPECT_TRUE(d.request_failed());
|
| @@ -1131,7 +1133,8 @@ TEST_F(URLRequestTest, FileDirCancelTest) {
|
| file_path = file_path.Append(FILE_PATH_LITERAL("data"));
|
|
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - FilePathToFileURL(file_path), DEFAULT_PRIORITY, &d));
|
| + FilePathToFileURL(file_path), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| EXPECT_TRUE(req->is_pending());
|
|
|
| @@ -1155,8 +1158,9 @@ TEST_F(URLRequestTest, FileDirOutputSanity) {
|
| path = path.Append(kTestFilePath);
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - FilePathToFileURL(path), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(
|
| + default_context_.CreateRequest(FilePathToFileURL(path), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -1190,8 +1194,9 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) {
|
| path = path.Append(kTestFilePath);
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - FilePathToFileURL(path), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(
|
| + default_context_.CreateRequest(FilePathToFileURL(path), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -1205,8 +1210,8 @@ TEST_F(URLRequestTest, FileDirRedirectNoCrash) {
|
| // Don't accept the url "file:///" on windows. See http://crbug.com/1474.
|
| TEST_F(URLRequestTest, FileDirRedirectSingleSlash) {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(GURL("file:///"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + GURL("file:///"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -1220,8 +1225,9 @@ TEST_F(URLRequestTest, FileDirRedirectSingleSlash) {
|
| TEST_F(URLRequestTest, InvalidUrlTest) {
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - GURL("invalid url"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + default_context_.CreateRequest(GURL("invalid url"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -1238,7 +1244,8 @@ TEST_F(URLRequestTest, InvalidReferrerTest) {
|
| context.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(GURL("http://localhost/"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://localhost/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer("https://somewhere.com/");
|
|
|
| req->Start();
|
| @@ -1272,7 +1279,8 @@ TEST_F(URLRequestTest, ResolveShortcutTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - FilePathToFileURL(base::FilePath(lnk_path)), DEFAULT_PRIORITY, &d));
|
| + FilePathToFileURL(base::FilePath(lnk_path)), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -1656,7 +1664,8 @@ TEST_F(URLRequestInterceptorTest, Intercept) {
|
| interceptor()->set_main_data(MockURLRequestInterceptor::ok_data());
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| 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();
|
| @@ -1694,7 +1703,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRedirect) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1727,7 +1737,8 @@ TEST_F(URLRequestInterceptorTest, InterceptServerError) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1755,7 +1766,8 @@ TEST_F(URLRequestInterceptorTest, InterceptNetworkError) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1783,7 +1795,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRestartRequired) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1814,7 +1827,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRespectsCancelMain) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1844,7 +1858,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRespectsCancelRedirect) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1867,7 +1882,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRespectsCancelFinal) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1891,7 +1907,8 @@ TEST_F(URLRequestInterceptorTest, InterceptRespectsCancelInRestart) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -1961,8 +1978,9 @@ LoadTimingInfo RunURLRequestInterceptorLoadTimingTest(
|
| interceptor->set_intercept_main_request(true);
|
| interceptor->set_main_request_load_timing_info(job_load_timing);
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(
|
| + context.CreateRequest(GURL("http://test_intercept/foo"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2181,9 +2199,11 @@ TEST_F(URLRequestTest, Identifiers) {
|
| TestDelegate d;
|
| TestURLRequestContext context;
|
| std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| std::unique_ptr<URLRequest> other_req(
|
| - context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| ASSERT_NE(req->identifier(), other_req->identifier());
|
| }
|
| @@ -2204,7 +2224,8 @@ TEST_F(URLRequestTest, MAYBE_NetworkDelegateProxyError) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://example.com"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
|
|
| req->Start();
|
| @@ -2225,8 +2246,8 @@ TEST_F(URLRequestTest, MAYBE_NetworkDelegateProxyError) {
|
| // content is empty.
|
| TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(GURL("data:,"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + GURL("data:,"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ("", d.data_received());
|
| @@ -2238,7 +2259,8 @@ TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) {
|
| TEST_F(URLRequestTest, SetPriorityBasic) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| EXPECT_EQ(DEFAULT_PRIORITY, req->priority());
|
|
|
| req->SetPriority(LOW);
|
| @@ -2256,7 +2278,8 @@ TEST_F(URLRequestTest, SetPriorityBasic) {
|
| TEST_F(URLRequestTest, SetJobPriorityBeforeJobStart) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| EXPECT_EQ(DEFAULT_PRIORITY, req->priority());
|
|
|
| RequestPriority job_priority;
|
| @@ -2276,7 +2299,8 @@ TEST_F(URLRequestTest, SetJobPriorityBeforeJobStart) {
|
| TEST_F(URLRequestTest, SetJobPriority) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| RequestPriority job_priority;
|
| std::unique_ptr<URLRequestJob> job(new PriorityMonitoringURLRequestJob(
|
| @@ -2297,7 +2321,8 @@ TEST_F(URLRequestTest, SetJobPriority) {
|
| TEST_F(URLRequestTest, PriorityIgnoreLimits) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - GURL("http://test_intercept/foo"), MAXIMUM_PRIORITY, &d));
|
| + GURL("http://test_intercept/foo"), MAXIMUM_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| EXPECT_EQ(MAXIMUM_PRIORITY, req->priority());
|
|
|
| RequestPriority job_priority;
|
| @@ -2345,7 +2370,7 @@ TEST_F(URLRequestTest, DelayedCookieCallback) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2359,7 +2384,8 @@ TEST_F(URLRequestTest, DelayedCookieCallback) {
|
| context.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2381,7 +2407,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2394,7 +2420,8 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2410,7 +2437,8 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetLoadFlags(LOAD_DO_NOT_SEND_COOKIES);
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -2435,7 +2463,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotUpdate=2"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2451,7 +2479,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetLoadFlags(LOAD_DO_NOT_SAVE_COOKIES);
|
| req->Start();
|
|
|
| @@ -2469,7 +2497,8 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2495,7 +2524,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2509,7 +2538,8 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2527,7 +2557,8 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
|
| TestDelegate d;
|
| network_delegate.set_cookie_options(TestNetworkDelegate::NO_GET_COOKIES);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2556,7 +2587,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotUpdate=2"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2572,7 +2603,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
|
| network_delegate.set_cookie_options(TestNetworkDelegate::NO_SET_COOKIE);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -2587,7 +2618,8 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2611,7 +2643,8 @@ TEST_F(URLRequestTest, DoNotSaveEmptyCookies) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/set-cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/set-cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2632,7 +2665,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSend=1"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2646,7 +2679,8 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2664,7 +2698,8 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
|
| TestDelegate d;
|
| network_delegate.set_cookie_options(TestNetworkDelegate::NO_GET_COOKIES);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2687,7 +2722,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotUpdate=2"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2703,7 +2738,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
|
| network_delegate.set_cookie_options(TestNetworkDelegate::NO_SET_COOKIE);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL("/set-cookie?CookieToNotSave=1&CookieToNotUpdate=1"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -2718,7 +2753,8 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2750,7 +2786,7 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| test_server.GetURL(kHost,
|
| "/set-cookie?StrictSameSiteCookie=1;SameSite=Strict&"
|
| "LaxSameSiteCookie=1;SameSite=Lax"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2762,7 +2798,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
|
| req->set_initiator(url::Origin(test_server.GetURL(kHost, "/")));
|
| req->Start();
|
| @@ -2780,7 +2817,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -2796,7 +2834,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kSubHost, "/"));
|
| req->set_initiator(url::Origin(test_server.GetURL(kSubHost, "/")));
|
| req->Start();
|
| @@ -2813,7 +2852,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kCrossHost, "/"));
|
| req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
|
| req->Start();
|
| @@ -2831,7 +2871,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
|
| req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
|
| req->set_method("GET");
|
| @@ -2850,7 +2891,8 @@ TEST_F(URLRequestTest, SameSiteCookies) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL(kHost, "/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_first_party_for_cookies(test_server.GetURL(kHost, "/"));
|
| req->set_initiator(url::Origin(test_server.GetURL(kCrossHost, "/")));
|
| req->set_method("POST");
|
| @@ -2886,7 +2928,7 @@ TEST_F(URLRequestTest, SecureCookiePrefixOnNonsecureOrigin) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| http_server.GetURL("/set-cookie?__Secure-nonsecure-origin=1;Secure"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2897,7 +2939,8 @@ TEST_F(URLRequestTest, SecureCookiePrefixOnNonsecureOrigin) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2922,9 +2965,9 @@ TEST_F(URLRequestTest, SecureCookiePrefixNonsecure) {
|
| // Try to set a non-Secure __Secure- cookie.
|
| {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(https_server.GetURL("/set-cookie?__Secure-foo=1"),
|
| - DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| + https_server.GetURL("/set-cookie?__Secure-foo=1"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2935,7 +2978,8 @@ TEST_F(URLRequestTest, SecureCookiePrefixNonsecure) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -2961,7 +3005,7 @@ TEST_F(URLRequestTest, SecureCookiePrefixSecure) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| https_server.GetURL("/set-cookie?__Secure-bar=1;Secure"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -2972,7 +3016,8 @@ TEST_F(URLRequestTest, SecureCookiePrefixSecure) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -3004,7 +3049,7 @@ TEST_F(URLRequestTest, StrictSecureCookiesOnNonsecureOrigin) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| http_server.GetURL("/set-cookie?nonsecure-origin=1;Secure"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -3015,7 +3060,8 @@ TEST_F(URLRequestTest, StrictSecureCookiesOnNonsecureOrigin) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -3043,7 +3089,7 @@ TEST_F(URLRequestTest, StrictSecureCookiesOnSecureOrigin) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| https_server.GetURL("/set-cookie?secure-origin=1;Secure"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(0, network_delegate.blocked_get_cookies_count());
|
| @@ -3054,7 +3100,8 @@ TEST_F(URLRequestTest, StrictSecureCookiesOnSecureOrigin) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + https_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -3076,8 +3123,8 @@ TEST_F(URLRequestTest, CancelOnSuspend) {
|
| TestDelegate d;
|
| // Request that just hangs.
|
| GURL url(URLRequestFailedJob::GetMockHttpUrl(ERR_IO_PENDING));
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| power_monitor_source->Suspend();
|
| @@ -3150,7 +3197,7 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL(
|
| "/set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| }
|
| @@ -3160,7 +3207,8 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -3174,7 +3222,7 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| test_server.GetURL(
|
| "/set-cookie?StillGood=1;expires=Mon,18-Apr-1977,22:50:13,GMT"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| }
|
| @@ -3184,7 +3232,8 @@ TEST_F(URLRequestTest, AcceptClockSkewCookieWithWrongDateTimezone) {
|
| default_context_.set_network_delegate(&network_delegate);
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Cookie"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -3204,7 +3253,8 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer("http://foo.com/");
|
|
|
| HttpRequestHeaders headers;
|
| @@ -3222,7 +3272,8 @@ TEST_F(URLRequestTest, DoNotOverrideReferrer) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - test_server.GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kReferer, "http://bar.com/");
|
| @@ -3254,8 +3305,8 @@ class URLRequestTestHTTP : public URLRequestTest {
|
| bool include_data) {
|
| static const char kData[] = "hello world";
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method(request_method);
|
| if (include_data) {
|
| req->set_upload(CreateSimpleUploadData(kData));
|
| @@ -3299,8 +3350,8 @@ class URLRequestTestHTTP : public URLRequestTest {
|
| const std::string& redirect_method,
|
| const std::string& origin_value) {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method(request_method);
|
| req->SetExtraRequestHeaderByName(HttpRequestHeaders::kOrigin,
|
| redirect_url.GetOrigin().spec(), false);
|
| @@ -3347,7 +3398,8 @@ class URLRequestTestHTTP : public URLRequestTest {
|
| for (int i = 0; i < kIterations; ++i) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server_.GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + test_server_.GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_method(method.c_str());
|
|
|
| r->set_upload(CreateSimpleUploadData(uploadBytes));
|
| @@ -3371,7 +3423,7 @@ class URLRequestTestHTTP : public URLRequestTest {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| test_server_.GetURL("/set-many-cookies?" +
|
| base::IntToString(num_cookies)),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -3485,7 +3537,8 @@ TEST_F(TokenBindingURLRequestTest, TokenBindingTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - https_test_server.GetURL("tokbind-ekm"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("tokbind-ekm"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3528,8 +3581,8 @@ TEST_F(TokenBindingURLRequestTest, ForwardTokenBinding) {
|
| {
|
| GURL redirect_url =
|
| https_test_server.GetURL("forward-tokbind?/tokbind-ekm");
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3583,8 +3636,8 @@ TEST_F(TokenBindingURLRequestTest, DontForwardHeaderFromHttp) {
|
| {
|
| GURL redirect_url = http_server.GetURL(
|
| "forward-tokbind?" + https_test_server.GetURL("tokbind-ekm").spec());
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3635,8 +3688,8 @@ TEST_F(TokenBindingURLRequestTest, ForwardWithoutTokenBinding) {
|
| {
|
| GURL redirect_url = token_binding_test_server.GetURL(
|
| "forward-tokbind?" + https_test_server.GetURL("tokbind-ekm").spec());
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3670,7 +3723,8 @@ TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - GURL("https://www.redirect.com/"), DEFAULT_PRIORITY, &d));
|
| + GURL("https://www.redirect.com/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3697,7 +3751,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateTunnelConnectionFailed) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - GURL("https://www.redirect.com/"), DEFAULT_PRIORITY, &d));
|
| + GURL("https://www.redirect.com/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -3741,7 +3796,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateBlockAsynchronously) {
|
|
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| for (size_t i = 0; i < blocking_stages_length; ++i) {
|
| @@ -3773,8 +3829,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelRequest) {
|
| http_test_server()->host_port_pair().ToString(), &network_delegate);
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + context.CreateRequest(http_test_server()->GetURL("/"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -3805,8 +3862,8 @@ void NetworkDelegateCancelRequest(BlockingNetworkDelegate::BlockMode block_mode,
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -3890,8 +3947,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequest) {
|
|
|
| {
|
| GURL original_url(http_test_server()->GetURL("/defaultresponse"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| // Quit after hitting the redirect, so can check the headers.
|
| d.set_quit_on_redirect(true);
|
| @@ -3945,8 +4002,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequestSynchronously) {
|
|
|
| {
|
| GURL original_url(http_test_server()->GetURL("/defaultresponse"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| // Quit after hitting the redirect, so can check the headers.
|
| d.set_quit_on_redirect(true);
|
| @@ -4003,8 +4060,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequestPost) {
|
|
|
| {
|
| GURL original_url(http_test_server()->GetURL("/defaultresponse"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_method("POST");
|
| r->set_upload(CreateSimpleUploadData(kData));
|
| HttpRequestHeaders headers;
|
| @@ -4058,8 +4115,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateRedirectRequestOnHeadersReceived) {
|
|
|
| {
|
| GURL original_url(http_test_server()->GetURL("/defaultresponse"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -4103,8 +4160,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncNoAction) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -4134,8 +4191,8 @@ TEST_F(URLRequestTestHTTP,
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| {
|
| @@ -4175,8 +4232,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncSetAuth) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4210,8 +4267,8 @@ TEST_F(URLRequestTestHTTP,
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4248,8 +4305,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredSyncCancel) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4282,8 +4339,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncNoAction) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4317,8 +4374,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncSetAuth) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4349,8 +4406,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateOnAuthRequiredAsyncCancel) {
|
|
|
| {
|
| GURL url(http_test_server()->GetURL("/auth-basic"));
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4379,8 +4436,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting1) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + context.CreateRequest(http_test_server()->GetURL("/"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -4416,8 +4474,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting2) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + context.CreateRequest(http_test_server()->GetURL("/"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -4451,8 +4510,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting3) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + context.CreateRequest(http_test_server()->GetURL("/"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -4487,7 +4547,8 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateCancelWhileWaiting4) {
|
|
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -4540,7 +4601,8 @@ TEST_F(URLRequestTestHTTP, UnexpectedServerAuthTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - GURL("https://www.server-auth.com/"), DEFAULT_PRIORITY, &d));
|
| + GURL("https://www.server-auth.com/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -4559,7 +4621,8 @@ TEST_F(URLRequestTestHTTP, GetTest_NoCache) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -4626,7 +4689,8 @@ TEST_F(URLRequestTestHTTP, GetTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -4649,8 +4713,8 @@ TEST_F(URLRequestTestHTTP, GetTest_GetFullRequestHeaders) {
|
| TestDelegate d;
|
| {
|
| GURL test_url(http_test_server()->GetURL("/defaultresponse"));
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + test_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| HttpRequestHeaders headers;
|
| EXPECT_FALSE(r->GetFullRequestHeaders(&headers));
|
| @@ -4679,7 +4743,8 @@ TEST_F(URLRequestTestHTTP, GetTestLoadTiming) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -4741,8 +4806,9 @@ TEST_F(URLRequestTestHTTP, GetZippedTest) {
|
| context.set_network_delegate(&network_delegate);
|
| context.Init();
|
|
|
| - std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| - test_server.GetURL(test_file), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(
|
| + context.CreateRequest(test_server.GetURL(test_file), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -4778,8 +4844,8 @@ TEST_F(URLRequestTestHTTP, RedirectLoadTiming) {
|
| GURL original_url =
|
| http_test_server()->GetURL("/server-redirect?" + destination_url.spec());
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -4819,8 +4885,8 @@ TEST_F(URLRequestTestHTTP, MultipleRedirectTest) {
|
| GURL original_url = http_test_server()->GetURL("/server-redirect?" +
|
| middle_redirect_url.spec());
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -5130,9 +5196,9 @@ TEST_F(URLRequestTestHTTP, DelegateInfoBeforeStart) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(http_test_server()->GetURL("/defaultresponse"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY,
|
| + &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
|
| EXPECT_EQ(base::string16(), load_state.param);
|
| @@ -5174,9 +5240,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfo) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(http_test_server()->GetURL("/simple.html"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + http_test_server()->GetURL("/simple.html"), DEFAULT_PRIORITY,
|
| + &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
|
| EXPECT_EQ(base::string16(), load_state.param);
|
| @@ -5227,7 +5293,7 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoRedirect) {
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| http_test_server()->GetURL("/server-redirect?simple.html"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + DEFAULT_PRIORITY, &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
|
| EXPECT_EQ(base::string16(), load_state.param);
|
| @@ -5298,9 +5364,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoAuth) {
|
| context.Init();
|
|
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(http_test_server()->GetURL("/auth-basic"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY,
|
| + &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| EXPECT_EQ(LOAD_STATE_IDLE, load_state.state);
|
| EXPECT_EQ(base::string16(), load_state.param);
|
| @@ -5365,7 +5431,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) {
|
| // that it occurs.
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| test_server.GetURL("/chunked?waitBetweenChunks=20"), DEFAULT_PRIORITY,
|
| - &request_delegate));
|
| + &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -5414,7 +5480,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfoOnRedirect) {
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| http_test_server()->GetURL("/server-redirect?simple.html"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + DEFAULT_PRIORITY, &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -5472,7 +5538,7 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateOnRedirectCancelled) {
|
| {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| http_test_server()->GetURL("/server-redirect?simple.html"),
|
| - DEFAULT_PRIORITY, &request_delegate));
|
| + DEFAULT_PRIORITY, &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| LoadStateWithParam load_state = r->GetLoadState();
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -5532,8 +5598,8 @@ TEST_F(URLRequestTestHTTP, RedirectWithAdditionalHeadersTest) {
|
| GURL original_url =
|
| http_test_server()->GetURL("/server-redirect?" + destination_url.spec());
|
| RedirectWithAdditionalHeadersDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -5569,8 +5635,8 @@ TEST_F(URLRequestTestHTTP, RedirectWithHeaderRemovalTest) {
|
| GURL original_url =
|
| http_test_server()->GetURL("/server-redirect?" + destination_url.spec());
|
| RedirectWithHeaderRemovalDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetExtraRequestHeaderByName(kExtraHeaderToRemove, "dummy", false);
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -5587,7 +5653,8 @@ TEST_F(URLRequestTestHTTP, CancelAfterStart) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - GURL("http://www.google.com/"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://www.google.com/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -5610,7 +5677,8 @@ TEST_F(URLRequestTestHTTP, CancelInResponseStarted) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| d.set_cancel_in_response_started(true);
|
|
|
| @@ -5632,7 +5700,8 @@ TEST_F(URLRequestTestHTTP, CancelOnDataReceived) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| d.set_cancel_in_received_data(true);
|
|
|
| @@ -5655,7 +5724,8 @@ TEST_F(URLRequestTestHTTP, CancelDuringEofRead) {
|
| {
|
| // This returns an empty response (With headers).
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| d.set_cancel_in_received_data(true);
|
|
|
| @@ -5677,7 +5747,8 @@ TEST_F(URLRequestTestHTTP, CancelByDestroyingAfterStart) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -5704,7 +5775,8 @@ TEST_F(URLRequestTestHTTP, CancelWhileReadingFromCache) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(OK, d.request_status());
|
| @@ -5714,7 +5786,8 @@ TEST_F(URLRequestTestHTTP, CancelWhileReadingFromCache) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| r->Cancel();
|
| base::RunLoop().Run();
|
| @@ -5742,7 +5815,8 @@ TEST_F(URLRequestTestHTTP, PostEmptyTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_method("POST");
|
|
|
| r->Start();
|
| @@ -5764,7 +5838,8 @@ TEST_F(URLRequestTestHTTP, PostFileTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_method("POST");
|
|
|
| base::FilePath dir;
|
| @@ -5812,7 +5887,8 @@ TEST_F(URLRequestTestHTTP, PostUnreadableFileTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_method("POST");
|
|
|
| std::vector<std::unique_ptr<UploadElementReader>> element_readers;
|
| @@ -5874,7 +5950,8 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataBeforeStart) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| std::unique_ptr<ChunkedUploadDataStream> upload_data_stream(
|
| new ChunkedUploadDataStream(0));
|
| std::unique_ptr<ChunkedUploadDataStream::Writer> writer =
|
| @@ -5897,7 +5974,8 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataJustAfterStart) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| std::unique_ptr<ChunkedUploadDataStream> upload_data_stream(
|
| new ChunkedUploadDataStream(0));
|
| std::unique_ptr<ChunkedUploadDataStream::Writer> writer =
|
| @@ -5919,7 +5997,8 @@ TEST_F(URLRequestTestHTTP, TestPostChunkedDataAfterStart) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echo"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| std::unique_ptr<ChunkedUploadDataStream> upload_data_stream(
|
| new ChunkedUploadDataStream(0));
|
| std::unique_ptr<ChunkedUploadDataStream::Writer> writer =
|
| @@ -5942,7 +6021,8 @@ TEST_F(URLRequestTestHTTP, ResponseHeadersTest) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/with-headers.html"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/with-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -5980,7 +6060,8 @@ TEST_F(URLRequestTestHTTP, ProcessSTS) {
|
| std::string test_server_hostname = https_test_server.GetURL("/").host();
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| - https_test_server.GetURL("/hsts-headers.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/hsts-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6015,7 +6096,8 @@ TEST_F(URLRequestTestHTTP, STSNotProcessedOnIP) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| - https_test_server.GetURL("/hsts-headers.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/hsts-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
| TransportSecurityState* security_state =
|
| @@ -6047,7 +6129,8 @@ TEST_F(URLRequestTestHTTP, ProcessPKP) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| - https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
| TransportSecurityState* security_state =
|
| @@ -6126,7 +6209,8 @@ TEST_F(URLRequestTestHTTP, ProcessPKPAndSendReport) {
|
| // Now send a request to trigger the violation.
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
|
| - https_test_server.GetURL("/simple.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/simple.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| violating_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6191,7 +6275,7 @@ TEST_F(URLRequestTestHTTP, ProcessPKPReportOnly) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
|
| https_test_server.GetURL("/hpkp-headers-report-only.html"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| violating_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6241,7 +6325,7 @@ TEST_F(URLRequestTestHTTP, ProcessPKPReportOnlyWithNoViolation) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| https_test_server.GetURL("/hpkp-headers-report-only.html"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6262,7 +6346,8 @@ TEST_F(URLRequestTestHTTP, PKPNotProcessedOnIP) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| - https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6321,7 +6406,8 @@ TEST_F(URLRequestTestHTTP, PKPBypassRecorded) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| - https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d));
|
| + https_test_server.GetURL("/hpkp-headers.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6344,7 +6430,7 @@ TEST_F(URLRequestTestHTTP, ProcessSTSOnce) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| https_test_server.GetURL("/hsts-multiple-headers.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6373,7 +6459,7 @@ TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| https_test_server.GetURL("/hsts-and-hpkp-headers.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6417,7 +6503,7 @@ TEST_F(URLRequestTestHTTP, ProcessSTSAndPKP2) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| https_test_server.GetURL("/hsts-and-hpkp-headers2.html"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6535,8 +6621,8 @@ TEST_F(URLRequestTestHTTP, ExpectCTHeader) {
|
| GURL::Replacements replace_host;
|
| replace_host.SetHostStr(kExpectCTStaticHostname);
|
| url = url.ReplaceComponents(replace_host);
|
| - std::unique_ptr<URLRequest> violating_request(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| violating_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6595,8 +6681,8 @@ TEST_F(URLRequestTestHTTP, DontProcessReportToHeaderNoService) {
|
| context.Init();
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> request(
|
| - context.CreateRequest(request_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| + request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
| }
|
| @@ -6614,8 +6700,8 @@ TEST_F(URLRequestTestHTTP, DontProcessReportToHeaderHTTP) {
|
| context.Init();
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> request(
|
| - context.CreateRequest(request_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| + request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6636,8 +6722,8 @@ TEST_F(URLRequestTestHTTP, ProcessReportToHeaderHTTPS) {
|
| context.Init();
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> request(
|
| - context.CreateRequest(request_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| + request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6662,8 +6748,8 @@ TEST_F(URLRequestTestHTTP, DontProcessReportToHeaderInvalidHTTPS) {
|
|
|
| TestDelegate d;
|
| d.set_allow_certificate_errors(true);
|
| - std::unique_ptr<URLRequest> request(
|
| - context.CreateRequest(request_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> request(context.CreateRequest(
|
| + request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6680,7 +6766,7 @@ TEST_F(URLRequestTestHTTP, ContentTypeNormalizationTest) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/content-type-normalization.html"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6722,7 +6808,7 @@ TEST_F(URLRequestTestHTTP, RestrictFileRedirects) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/redirect-to-file.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6736,7 +6822,7 @@ TEST_F(URLRequestTestHTTP, RestrictDataRedirects) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/redirect-to-data.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6749,7 +6835,7 @@ TEST_F(URLRequestTestHTTP, RedirectToInvalidURL) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/redirect-to-invalid-url.html"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6764,8 +6850,8 @@ TEST_F(URLRequestTestHTTP, CacheRedirect) {
|
|
|
| {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(OK, d.request_status());
|
| @@ -6776,8 +6862,8 @@ TEST_F(URLRequestTestHTTP, CacheRedirect) {
|
| {
|
| TestDelegate d;
|
| d.set_quit_on_redirect(true);
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(redirect_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6808,8 +6894,8 @@ TEST_F(URLRequestTestHTTP, NoCacheOnNetworkDelegateRedirect) {
|
| redirect_to_url);
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(initial_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + initial_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(OK, d.request_status());
|
| @@ -6819,8 +6905,8 @@ TEST_F(URLRequestTestHTTP, NoCacheOnNetworkDelegateRedirect) {
|
|
|
| {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(initial_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + initial_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -6843,7 +6929,8 @@ TEST_F(URLRequestTestHTTP, UnsafeRedirectToWhitelistedUnsafeURL) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/whatever"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/whatever"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -6869,7 +6956,8 @@ TEST_F(URLRequestTestHTTP, UnsafeRedirectToDifferentUnsafeURL) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/whatever"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/whatever"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -6892,8 +6980,8 @@ TEST_F(URLRequestTestHTTP, UnsafeRedirectWithDifferentReferenceFragment) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -6921,8 +7009,8 @@ TEST_F(URLRequestTestHTTP, RedirectWithReferenceFragmentAndUnrelatedUnsafeUrl) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -6949,8 +7037,8 @@ TEST_F(URLRequestTestHTTP, RedirectWithReferenceFragment) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -6972,8 +7060,8 @@ TEST_F(URLRequestTestHTTP, RedirectJobWithReferenceFragment) {
|
| GURL redirect_url(http_test_server()->GetURL("/echo"));
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| std::unique_ptr<URLRequestRedirectJob> job(new URLRequestRedirectJob(
|
| r.get(), &default_network_delegate_, redirect_url,
|
| @@ -6994,7 +7082,8 @@ TEST_F(URLRequestTestHTTP, UnsupportedReferrerScheme) {
|
| const std::string referrer("foobar://totally.legit.referrer");
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer(referrer);
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -7007,7 +7096,8 @@ TEST_F(URLRequestTestHTTP, NoUserPassInReferrer) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer("http://user:pass@foo.com/");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -7020,7 +7110,8 @@ TEST_F(URLRequestTestHTTP, NoFragmentInReferrer) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer("http://foo.com/test#fragment");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -7033,7 +7124,8 @@ TEST_F(URLRequestTestHTTP, EmptyReferrerAfterValidReferrer) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/echoheader?Referer"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetReferrer("http://foo.com/test#fragment");
|
| req->SetReferrer("");
|
| req->Start();
|
| @@ -7049,8 +7141,8 @@ TEST_F(URLRequestTestHTTP, CancelRedirect) {
|
| {
|
| d.set_cancel_in_received_redirect(true);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -7068,8 +7160,8 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect) {
|
| {
|
| d.set_quit_on_redirect(true);
|
| GURL test_url(http_test_server()->GetURL("/redirect-test.html"));
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + test_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -7101,8 +7193,8 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect_GetFullRequestHeaders) {
|
| {
|
| d.set_quit_on_redirect(true);
|
| GURL test_url(http_test_server()->GetURL("/redirect-test.html"));
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + test_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| EXPECT_FALSE(d.have_full_request_headers());
|
|
|
| @@ -7142,8 +7234,8 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) {
|
| {
|
| d.set_quit_on_redirect(true);
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -7167,7 +7259,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheadercache?foo"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader("foo", "1");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7184,7 +7276,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheadercache?foo"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader("foo", "1");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7203,7 +7295,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheadercache?foo"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader("foo", "2");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7227,7 +7319,8 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
|
| d.set_credentials(AuthCredentials(kUser, kSecret));
|
|
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -7243,7 +7336,8 @@ TEST_F(URLRequestTestHTTP, BasicAuth) {
|
| d.set_credentials(AuthCredentials(kUser, kSecret));
|
|
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->SetLoadFlags(LOAD_VALIDATE_CACHE);
|
| r->Start();
|
|
|
| @@ -7276,7 +7370,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
|
| d.set_credentials(AuthCredentials(kUser, kSecret));
|
|
|
| std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url_requiring_auth, DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(url_requiring_auth, DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -7303,8 +7398,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
|
| replacements.SetPasswordStr("secret");
|
| GURL url_with_identity = url_requiring_auth.ReplaceComponents(replacements);
|
|
|
| - std::unique_ptr<URLRequest> r(
|
| - context.CreateRequest(url_with_identity, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| + url_with_identity, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -7327,7 +7422,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthLoadTiming) {
|
| d.set_credentials(AuthCredentials(kUser, kSecret));
|
|
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -7359,7 +7455,8 @@ TEST_F(URLRequestTestHTTP, BasicAuthLoadTiming) {
|
| d.set_credentials(AuthCredentials(kUser, kSecret));
|
|
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->SetLoadFlags(LOAD_VALIDATE_CACHE);
|
| r->Start();
|
|
|
| @@ -7389,8 +7486,8 @@ TEST_F(URLRequestTestHTTP, Post302RedirectGet) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/redirect-to-echoall"), DEFAULT_PRIORITY,
|
| - &d));
|
| + http_test_server()->GetURL("/redirect-to-echoall"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("POST");
|
| req->set_upload(CreateSimpleUploadData(kData));
|
|
|
| @@ -7528,8 +7625,8 @@ TEST_F(URLRequestTestHTTP, NoRedirectOn308WithoutLocationHeader) {
|
| TestDelegate d;
|
| const GURL url = http_test_server()->GetURL("/308-without-location-header");
|
|
|
| - std::unique_ptr<URLRequest> request(
|
| - default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> request(default_context_.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| request->Start();
|
| base::RunLoop().Run();
|
| @@ -7548,8 +7645,8 @@ TEST_F(URLRequestTestHTTP, Redirect302PreserveReferenceFragment) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(original_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| base::RunLoop().Run();
|
| @@ -7569,8 +7666,8 @@ TEST_F(URLRequestTestHTTP, RedirectPreserveFirstPartyURL) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_first_party_for_cookies(first_party_url);
|
|
|
| r->Start();
|
| @@ -7591,8 +7688,8 @@ TEST_F(URLRequestTestHTTP, RedirectUpdateFirstPartyURL) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->set_first_party_for_cookies(original_first_party_url);
|
| r->set_first_party_url_policy(
|
| URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
|
| @@ -7613,7 +7710,8 @@ TEST_F(URLRequestTestHTTP, InterceptPost302RedirectGet) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("POST");
|
| req->set_upload(CreateSimpleUploadData(kData));
|
| HttpRequestHeaders headers;
|
| @@ -7639,7 +7737,8 @@ TEST_F(URLRequestTestHTTP, InterceptPost307RedirectPost) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("POST");
|
| req->set_upload(CreateSimpleUploadData(kData));
|
| HttpRequestHeaders headers;
|
| @@ -7674,7 +7773,7 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptLanguage) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Language"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ("en", d.data_received());
|
| @@ -7697,7 +7796,7 @@ TEST_F(URLRequestTestHTTP, EmptyAcceptLanguage) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Language"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ("None", d.data_received());
|
| @@ -7711,7 +7810,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptLanguage) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Language"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kAcceptLanguage, "ru");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7727,7 +7826,7 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptEncoding) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Encoding"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| req->SetExtraRequestHeaders(headers);
|
| req->Start();
|
| @@ -7743,7 +7842,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptEncoding) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Encoding"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kAcceptEncoding, "identity");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7760,7 +7859,7 @@ TEST_F(URLRequestTestHTTP, SetAcceptCharset) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?Accept-Charset"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kAcceptCharset, "koi-8r");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7776,7 +7875,7 @@ TEST_F(URLRequestTestHTTP, DefaultUserAgent) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?User-Agent"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(default_context_.http_user_agent_settings()->GetUserAgent(),
|
| @@ -7797,7 +7896,7 @@ TEST_F(URLRequestTestHTTP, MAYBE_OverrideUserAgent) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| http_test_server()->GetURL("/echoheader?User-Agent"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| HttpRequestHeaders headers;
|
| headers.SetHeader(HttpRequestHeaders::kUserAgent, "Lynx (textmode)");
|
| req->SetExtraRequestHeaders(headers);
|
| @@ -7830,7 +7929,8 @@ TEST_F(URLRequestTestHTTP, EmptyHttpUserAgentSettings) {
|
| for (size_t i = 0; i < arraysize(tests); i++) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - http_test_server()->GetURL(tests[i].request), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL(tests[i].request), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
| EXPECT_EQ(tests[i].expected_response, d.data_received())
|
| @@ -7845,7 +7945,8 @@ TEST_F(URLRequestTestHTTP, SetSubsequentJobPriority) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| EXPECT_EQ(DEFAULT_PRIORITY, req->priority());
|
|
|
| std::unique_ptr<URLRequestRedirectJob> redirect_job(new URLRequestRedirectJob(
|
| @@ -7887,7 +7988,8 @@ TEST_F(URLRequestTestHTTP, NetworkSuspendTest) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -7940,7 +8042,8 @@ TEST_F(URLRequestTestHTTP, NetworkCancelAfterCreateTransactionFailsTest) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d));
|
| + context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| // Don't send cookies (Collecting cookies is asynchronous, and need request to
|
| // try to create an HttpNetworkTransaction synchronously on start).
|
| req->SetLoadFlags(LOAD_DO_NOT_SEND_COOKIES);
|
| @@ -7964,8 +8067,8 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedSetOnNetworkRequest) {
|
|
|
| TestDelegate d;
|
| GURL test_url(http_test_server()->GetURL("/"));
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + test_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -7979,7 +8082,8 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnCachedResponse) {
|
| // Populate the cache.
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -7988,7 +8092,8 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnCachedResponse) {
|
| EXPECT_FALSE(req->response_info().was_cached);
|
|
|
| req = default_context_.CreateRequest(http_test_server()->GetURL("/cachetime"),
|
| - DEFAULT_PRIORITY, &d);
|
| + DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS);
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -8002,8 +8107,8 @@ TEST_F(URLRequestTestHTTP, NetworkAccessedClearOnLoadOnlyFromCache) {
|
|
|
| TestDelegate d;
|
| GURL test_url(http_test_server()->GetURL("/"));
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(test_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + test_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->SetLoadFlags(LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION);
|
|
|
| req->Start();
|
| @@ -8019,8 +8124,8 @@ TEST_F(URLRequestTestHTTP, ThrottledPriority) {
|
|
|
| TestDelegate d;
|
| GURL test_url(http_test_server()->GetURL("/"));
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(test_url, THROTTLED, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + test_url, THROTTLED, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -8099,18 +8204,21 @@ TEST_F(URLRequestTestHTTP, MultiThrottledPriority) {
|
| // HttpNetworkTransacations. Use different URLRequest::Delegates so that
|
| // the requests may be waited on separately.
|
| TestDelegate d1;
|
| - std::unique_ptr<URLRequest> req1(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/l"), THROTTLED, &d1));
|
| + std::unique_ptr<URLRequest> req1(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/l"), THROTTLED,
|
| + &d1, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req1.get());
|
|
|
| TestDelegate d2;
|
| - std::unique_ptr<URLRequest> req2(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/2"), THROTTLED, &d2));
|
| + std::unique_ptr<URLRequest> req2(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/2"), THROTTLED,
|
| + &d2, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req2.get());
|
|
|
| TestDelegate d3;
|
| - std::unique_ptr<URLRequest> req3(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/3"), THROTTLED, &d3));
|
| + std::unique_ptr<URLRequest> req3(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/3"), THROTTLED,
|
| + &d3, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req1->Start();
|
| req2->Start();
|
| req3->Start();
|
| @@ -8178,18 +8286,21 @@ TEST_F(URLRequestTestHTTP, ThrottledFailure) {
|
| // HttpNetworkTransacations. Use different URLRequest::Delegates so that
|
| // the requests may be waited on separately.
|
| TestDelegate d1;
|
| - std::unique_ptr<URLRequest> req1(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/l"), THROTTLED, &d1));
|
| + std::unique_ptr<URLRequest> req1(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/l"), THROTTLED,
|
| + &d1, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req1.get());
|
|
|
| TestDelegate d2;
|
| - std::unique_ptr<URLRequest> req2(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/2"), THROTTLED, &d2));
|
| + std::unique_ptr<URLRequest> req2(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/2"), THROTTLED,
|
| + &d2, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req2.get());
|
|
|
| TestDelegate d3;
|
| - std::unique_ptr<URLRequest> req3(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/3"), THROTTLED, &d3));
|
| + std::unique_ptr<URLRequest> req3(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/3"), THROTTLED,
|
| + &d3, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req1->Start();
|
| req2->Start();
|
| req3->Start();
|
| @@ -8253,18 +8364,21 @@ TEST_F(URLRequestTestHTTP, ThrottledRepriUnblock) {
|
| // HttpNetworkTransacations. Use different URLRequest::Delegates so that
|
| // the requests may be waited on separately.
|
| TestDelegate d1;
|
| - std::unique_ptr<URLRequest> req1(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/l"), THROTTLED, &d1));
|
| + std::unique_ptr<URLRequest> req1(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/l"), THROTTLED,
|
| + &d1, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req1.get());
|
|
|
| TestDelegate d2;
|
| - std::unique_ptr<URLRequest> req2(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/2"), THROTTLED, &d2));
|
| + std::unique_ptr<URLRequest> req2(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/2"), THROTTLED,
|
| + &d2, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| notification_handler.AddURLRequestToBlockList(req2.get());
|
|
|
| TestDelegate d3;
|
| - std::unique_ptr<URLRequest> req3(context.CreateRequest(
|
| - http_test_server()->GetURL("/echoall/3"), THROTTLED, &d3));
|
| + std::unique_ptr<URLRequest> req3(
|
| + context.CreateRequest(http_test_server()->GetURL("/echoall/3"), THROTTLED,
|
| + &d3, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req1->Start();
|
| req2->Start();
|
| req3->Start();
|
| @@ -8307,7 +8421,8 @@ TEST_F(URLRequestTestHTTP, RawBodyBytesNoContentEncoding) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - http_test_server()->GetURL("/simple.html"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/simple.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -8319,7 +8434,8 @@ TEST_F(URLRequestTestHTTP, RawBodyBytesGzipEncoding) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - http_test_server()->GetURL("/gzip-encoded"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/gzip-encoded"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -8334,7 +8450,8 @@ TEST_F(URLRequestTestHTTP, TesBeforeStartTransactionFails) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| DCHECK(!d.response_completed());
|
| base::RunLoop().Run();
|
| @@ -8374,7 +8491,8 @@ TEST_F(URLRequestInterceptorTestHTTP,
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/redirect-test.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -8407,7 +8525,7 @@ TEST_F(URLRequestInterceptorTestHTTP,
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| http_test_server()->GetURL("/two-content-lengths.html"), DEFAULT_PRIORITY,
|
| - &d));
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -8440,7 +8558,8 @@ TEST_F(URLRequestInterceptorTestHTTP,
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - http_test_server()->GetURL("/simple.html"), DEFAULT_PRIORITY, &d));
|
| + http_test_server()->GetURL("/simple.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("GET");
|
| req->Start();
|
| base::RunLoop().Run();
|
| @@ -8510,8 +8629,8 @@ class URLRequestTestReferrerPolicy : public URLRequestTest {
|
| origin_server_->GetURL("/server-redirect?" + destination_url.spec());
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(origin_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + origin_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_referrer_policy(policy);
|
| req->SetReferrer(referrer.spec());
|
| req->Start();
|
| @@ -8703,7 +8822,8 @@ TEST_F(HTTPSRequestTest, HTTPSGetTest) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -8733,7 +8853,8 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
|
| {
|
| d.set_allow_certificate_errors(err_allowed);
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -8768,7 +8889,8 @@ TEST_F(HTTPSRequestTest, HTTPSExpiredTest) {
|
| {
|
| d.set_allow_certificate_errors(err_allowed);
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -8818,7 +8940,7 @@ TEST_F(HTTPSRequestTest, HTTPSPreloadedHSTSTest) {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| GURL(base::StringPrintf("https://www.google.com:%d",
|
| test_server.host_port_pair().port())),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -8871,7 +8993,7 @@ TEST_F(HTTPSRequestTest, HTTPSErrorsNoClobberTSSTest) {
|
| std::unique_ptr<URLRequest> r(context.CreateRequest(
|
| GURL(base::StringPrintf("https://www.google.com:%d",
|
| test_server.host_port_pair().port())),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -8944,7 +9066,7 @@ TEST_F(HTTPSRequestTest, HSTSPreservesPosts) {
|
| std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| GURL(base::StringPrintf("http://www.somewhere.com:%d/echo",
|
| test_server.host_port_pair().port())),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->set_method("POST");
|
| req->set_upload(CreateSimpleUploadData(kData));
|
|
|
| @@ -9003,8 +9125,8 @@ TEST_F(HTTPSRequestTest, HSTSCrossOriginAddHeaders) {
|
| // Quit on redirect to allow response header inspection upon redirect.
|
| d.set_quit_on_redirect(true);
|
|
|
| - std::unique_ptr<URLRequest> req(
|
| - context.CreateRequest(hsts_http_url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| + hsts_http_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| // Set Origin header to simulate a cross-origin request.
|
| HttpRequestHeaders request_headers;
|
| request_headers.SetHeader("Origin", kOriginHeaderValue);
|
| @@ -9064,7 +9186,8 @@ TEST_F(HTTPSRequestTest, ClientAuthTest) {
|
| SSLClientAuthTestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9104,7 +9227,8 @@ TEST_F(HTTPSRequestTest, ResumeTest) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9120,7 +9244,8 @@ TEST_F(HTTPSRequestTest, ResumeTest) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9195,7 +9320,8 @@ TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9229,7 +9355,8 @@ TEST_F(HTTPSRequestTest, SSLSessionCacheShardTest) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9277,7 +9404,7 @@ class HTTPSFallbackTest : public testing::Test {
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| request_ = context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY,
|
| - &delegate_);
|
| + &delegate_, TRAFFIC_ANNOTATION_FOR_TESTS);
|
| request_->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -9389,7 +9516,8 @@ TEST_F(HTTPSSessionTest, DontResumeSessionsForInvalidCertificates) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9408,7 +9536,8 @@ TEST_F(HTTPSSessionTest, DontResumeSessionsForInvalidCertificates) {
|
| {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("ssl-session-cache"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -9493,8 +9622,9 @@ class HTTPSOCSPTest : public HTTPSRequestTest {
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| delegate->set_allow_certificate_errors(true);
|
| - std::unique_ptr<URLRequest> r(context_.CreateRequest(
|
| - test_server.GetURL("/"), DEFAULT_PRIORITY, delegate));
|
| + std::unique_ptr<URLRequest> r(
|
| + context_.CreateRequest(test_server.GetURL("/"), DEFAULT_PRIORITY,
|
| + delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
|
|
| base::RunLoop().Run();
|
| @@ -9784,8 +9914,8 @@ TEST_F(HTTPSOCSPTest, ExpectStapleReportSentOnMissing) {
|
| GURL::Replacements replace_host;
|
| replace_host.SetHostStr(kExpectStapleStaticHostname);
|
| url = url.ReplaceComponents(replace_host);
|
| - std::unique_ptr<URLRequest> violating_request(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| violating_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -9844,8 +9974,8 @@ TEST_F(HTTPSOCSPTest, ExpectStapleReportNotSentOnMissingWithCertError) {
|
| GURL::Replacements replace_host;
|
| replace_host.SetHostStr(kExpectStapleStaticHostname);
|
| url = url.ReplaceComponents(replace_host);
|
| - std::unique_ptr<URLRequest> violating_request(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| violating_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -9896,8 +10026,8 @@ TEST_F(HTTPSOCSPTest, ExpectStapleReportNotSentOnValid) {
|
| GURL::Replacements replace_host;
|
| replace_host.SetHostStr(kExpectStapleStaticHostname);
|
| url = url.ReplaceComponents(replace_host);
|
| - std::unique_ptr<URLRequest> ok_request(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> ok_request(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| ok_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -9955,8 +10085,8 @@ TEST_F(HTTPSOCSPTest, ExpectStapleReportNotSentOnNotChecked) {
|
| GURL::Replacements replace_host;
|
| replace_host.SetHostStr(kExpectStapleStaticHostname);
|
| url = url.ReplaceComponents(replace_host);
|
| - std::unique_ptr<URLRequest> ok_request(
|
| - context.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> ok_request(context.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| ok_request->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -10255,7 +10385,8 @@ TEST_F(HTTPSAIATest, AIAFetching) {
|
| TestDelegate d;
|
| d.set_allow_certificate_errors(true);
|
| std::unique_ptr<URLRequest> r(context_.CreateRequest(
|
| - test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d));
|
| + test_server.GetURL("/defaultresponse"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
| @@ -10608,8 +10739,8 @@ TEST_F(URLRequestTestFTP, UnsafePort) {
|
|
|
| TestDelegate d;
|
| {
|
| - std::unique_ptr<URLRequest> r(
|
| - default_context_.CreateRequest(url, DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| + url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10626,7 +10757,8 @@ TEST_F(URLRequestTestFTP, FTPDirectoryListing) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - ftp_test_server_.GetURL("/"), DEFAULT_PRIORITY, &d));
|
| + ftp_test_server_.GetURL("/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10649,7 +10781,8 @@ TEST_F(URLRequestTestFTP, FTPGetTestAnonymous) {
|
| TestDelegate d;
|
| {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, &d));
|
| + ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10674,7 +10807,7 @@ TEST_F(URLRequestTestFTP, FTPGetTest) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "chrome",
|
| "chrome"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10703,7 +10836,7 @@ TEST_F(URLRequestTestFTP, FTPCheckWrongPassword) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "chrome",
|
| "wrong_password"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10727,7 +10860,7 @@ TEST_F(URLRequestTestFTP, FTPCheckWrongPasswordRestart) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "chrome",
|
| "wrong_password"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10748,7 +10881,7 @@ TEST_F(URLRequestTestFTP, FTPCheckWrongUser) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "wrong_user",
|
| "chrome"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10772,7 +10905,7 @@ TEST_F(URLRequestTestFTP, FTPCheckWrongUserRestart) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "wrong_user",
|
| "chrome"),
|
| - DEFAULT_PRIORITY, &d));
|
| + DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10794,7 +10927,7 @@ TEST_F(URLRequestTestFTP, FTPCacheURLCredentials) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "chrome",
|
| "chrome"),
|
| - DEFAULT_PRIORITY, d.get()));
|
| + DEFAULT_PRIORITY, d.get(), TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10810,7 +10943,8 @@ TEST_F(URLRequestTestFTP, FTPCacheURLCredentials) {
|
| {
|
| // This request should use cached identity from previous request.
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, d.get()));
|
| + ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, d.get(),
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10834,7 +10968,7 @@ TEST_F(URLRequestTestFTP, FTPCacheLoginBoxCredentials) {
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| ftp_test_server_.GetURLWithUserAndPassword(kFtpTestFile, "chrome",
|
| "wrong_password"),
|
| - DEFAULT_PRIORITY, d.get()));
|
| + DEFAULT_PRIORITY, d.get(), TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10853,7 +10987,8 @@ TEST_F(URLRequestTestFTP, FTPCacheLoginBoxCredentials) {
|
| // Don't pass wrong credentials in the URL, they would override valid cached
|
| // ones.
|
| std::unique_ptr<URLRequest> r(default_context_.CreateRequest(
|
| - ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, d.get()));
|
| + ftp_test_server_.GetURL(kFtpTestFile), DEFAULT_PRIORITY, d.get(),
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| r->Start();
|
| EXPECT_TRUE(r->is_pending());
|
|
|
| @@ -10871,7 +11006,8 @@ TEST_F(URLRequestTestFTP, RawBodyBytes) {
|
|
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context().CreateRequest(
|
| - ftp_test_server_.GetURL("simple.html"), DEFAULT_PRIORITY, &d));
|
| + ftp_test_server_.GetURL("simple.html"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
| req->Start();
|
| base::RunLoop().Run();
|
|
|
| @@ -10882,8 +11018,8 @@ TEST_F(URLRequestTestFTP, RawBodyBytes) {
|
|
|
| TEST_F(URLRequestTest, NetworkAccessedClearOnDataRequest) {
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(
|
| - default_context_.CreateRequest(GURL("data:,"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| + GURL("data:,"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| EXPECT_FALSE(req->response_info().network_accessed);
|
|
|
| @@ -10904,8 +11040,9 @@ TEST_F(URLRequestTest, NetworkAccessedSetOnHostResolutionFailure) {
|
| context.Init();
|
|
|
| TestDelegate d;
|
| - std::unique_ptr<URLRequest> req(context.CreateRequest(
|
| - GURL("http://test_intercept/foo"), DEFAULT_PRIORITY, &d));
|
| + std::unique_ptr<URLRequest> req(
|
| + context.CreateRequest(GURL("http://test_intercept/foo"), DEFAULT_PRIORITY,
|
| + &d, TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| EXPECT_FALSE(req->response_info().network_accessed);
|
|
|
| @@ -10919,7 +11056,8 @@ TEST_F(URLRequestTest, NetworkAccessedSetOnHostResolutionFailure) {
|
| TEST_F(URLRequestTest, URLRequestRedirectJobCancelRequest) {
|
| TestDelegate d;
|
| std::unique_ptr<URLRequest> req(default_context_.CreateRequest(
|
| - GURL("http://not-a-real-domain/"), DEFAULT_PRIORITY, &d));
|
| + GURL("http://not-a-real-domain/"), DEFAULT_PRIORITY, &d,
|
| + TRAFFIC_ANNOTATION_FOR_TESTS));
|
|
|
| std::unique_ptr<URLRequestRedirectJob> job(new URLRequestRedirectJob(
|
| req.get(), &default_network_delegate_,
|
|
|