New issue
Advanced search Search tips

Issue 719713 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Add tests to verify expected DRP request headers are sent

Project Member Reported by bengr@chromium.org, May 8 2017

Issue description

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

Refreshed during triage.
Status: WontFix (was: Available)
We now have DCHECKs in code that verify this (see: https://cs.chromium.org/chromium/src/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc?rcl=b66ff967c10f72e5a2cc46aa2479cf4c77bc9f97&l=250). These DCHECKs are in the code path of most of our unittests that use mock sockets.

Given that, I am not sure if this bug is really needed. I am going to close this. Please feel free to reopen, if somebody feels otherwise.


Sign in to add a comment