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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc

Issue 501163002: Make URLRequest's constructor private, and make URLRequestContext a friend class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge yet again Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc
index 0e3b2377311ace47635803c4ec4e4934e9c59f9c..e2b121f66e69afd92bc27a4fb3d0f7296ccfcbd9 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_protocol_unittest.cc
@@ -298,12 +298,13 @@ TEST_F(DataReductionProxyProtocolTest, TestIdempotency) {
{ "CONNECT", false },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- net::TestURLRequest request(GURL("http://www.google.com/"),
- net::DEFAULT_PRIORITY,
- NULL,
- &context);
- request.set_method(tests[i].method);
- EXPECT_EQ(tests[i].expected_result, IsRequestIdempotent(&request));
+ scoped_ptr<net::URLRequest> request(
+ context.CreateRequest(GURL("http://www.google.com/"),
+ net::DEFAULT_PRIORITY,
+ NULL,
+ NULL));
+ request->set_method(tests[i].method);
+ EXPECT_EQ(tests[i].expected_result, IsRequestIdempotent(request.get()));
}
}
@@ -347,14 +348,15 @@ TEST_F(DataReductionProxyProtocolTest, OverrideResponseAsRedirect) {
new HttpResponseHeaders(headers));
scoped_refptr<HttpResponseHeaders> override_response_headers;
TestDelegate test_delegate;
- net::TestURLRequest request(GURL("http://www.google.com/"),
- net::DEFAULT_PRIORITY,
- NULL,
- &context);
- OverrideResponseAsRedirect(
- &request, original_response_headers.get(), &override_response_headers);
+ scoped_ptr<net::URLRequest> request(
+ context.CreateRequest(GURL("http://www.google.com/"),
+ net::DEFAULT_PRIORITY,
+ NULL,
+ NULL));
+ OverrideResponseAsRedirect(request.get(), original_response_headers.get(),
+ &override_response_headers);
int expected_flags = net::LOAD_DISABLE_CACHE | net::LOAD_BYPASS_PROXY;
- EXPECT_EQ(expected_flags, request.load_flags());
+ EXPECT_EQ(expected_flags, request->load_flags());
std::string override_headers;
override_response_headers->GetNormalizedHeaders(&override_headers);
EXPECT_EQ(std::string(tests[i].expected_headers), override_headers);

Powered by Google App Engine
This is Rietveld 408576698