We don't currently have tests that verify that the correct request headers are sent when the data_reduction_proxy code is configured. These headers include chrome-proxy, chrome-proxy-accept-transform, and chrome-proxy-ect.
In particular, we should verify that these headers are sent as appropriate when a d_r_p connection is used and not sent otherwise, even if higher layers, e.g. Blink, add these headers.
I'm thinking the tests could be in d_r_p_network_delegate_unittest.cc and could follow the pattern of BuildSocket in that file. E.g., something like this:
BuildSocketForDirectConnection(...);
std::unique_ptr<net::URLRequest> request =
context_.CreateRequest(GURL(kTestURL), net::IDLE, &delegate);
request->SetExtraRequestHeaderByName("chrome-proxy", "frfr", true);
request->Start();
base::RunLoop().RunUntilIdle();
net::HttpRequestHeaders sent_request_header;
request->GetFulLRequestHeaders(&sent_request_headers)
EXPECT_FALSE(sent_request_headers.GetHeader(chrome_proxy_header(), &val);
Comment 1 by bengr@chromium.org
, Nov 8 2017