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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc

Issue 2261103002: Use modified URLRequest::Read() and delegate methods in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: comments Created 4 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/core/browser/data_reduction_proxy_interceptor_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
index c0cf9ab67a28cdedbc95d17ac454042ebe333696..e45c1c9836a02699159b45cf7965ee52427dcdd6 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor_unittest.cc
@@ -260,8 +260,7 @@ TEST_F(DataReductionProxyInterceptorWithServerTest, TestBypass) {
EXPECT_TRUE(request->is_pending());
base::RunLoop().Run();
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
- EXPECT_EQ(net::OK, request->status().error());
+ EXPECT_EQ(net::OK, delegate.request_status());
EXPECT_EQ("hello", delegate.data_received());
}
@@ -273,8 +272,7 @@ TEST_F(DataReductionProxyInterceptorWithServerTest, TestNoBypass) {
EXPECT_TRUE(request->is_pending());
base::RunLoop().Run();
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
- EXPECT_EQ(net::OK, request->status().error());
+ EXPECT_EQ(net::OK, delegate.request_status());
EXPECT_EQ("hello", delegate.data_received());
}
@@ -314,9 +312,7 @@ class DataReductionProxyInterceptorEndToEndTest : public testing::Test {
return request;
}
- const net::TestDelegate& delegate() const {
- return delegate_;
- }
+ const net::TestDelegate& delegate() const { return delegate_; }
net::MockClientSocketFactory* mock_socket_factory() {
return &mock_socket_factory_;
@@ -356,7 +352,7 @@ TEST_F(DataReductionProxyInterceptorEndToEndTest, ResponseWithoutRetry) {
std::unique_ptr<net::URLRequest> request =
CreateAndExecuteRequest(GURL("http://foo.com"));
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
+ EXPECT_EQ(net::OK, delegate().request_status());
EXPECT_EQ(200, request->GetResponseCode());
EXPECT_EQ(kBody, delegate().data_received());
EXPECT_EQ(origin().host_port_pair().ToString(),
@@ -390,7 +386,7 @@ TEST_F(DataReductionProxyInterceptorEndToEndTest, RedirectWithoutRetry) {
std::unique_ptr<net::URLRequest> request =
CreateAndExecuteRequest(GURL("http://foo.com"));
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
+ EXPECT_EQ(net::OK, delegate().request_status());
EXPECT_EQ(200, request->GetResponseCode());
EXPECT_EQ(kBody, delegate().data_received());
EXPECT_EQ(origin().host_port_pair().ToString(),
@@ -425,7 +421,7 @@ TEST_F(DataReductionProxyInterceptorEndToEndTest, ResponseWithBypassAndRetry) {
std::unique_ptr<net::URLRequest> request =
CreateAndExecuteRequest(GURL("http://foo.com"));
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
+ EXPECT_EQ(net::OK, delegate().request_status());
EXPECT_EQ(200, request->GetResponseCode());
EXPECT_EQ(kBody, delegate().data_received());
EXPECT_FALSE(request->was_fetched_via_proxy());
@@ -472,7 +468,7 @@ TEST_F(DataReductionProxyInterceptorEndToEndTest, RedirectWithBypassAndRetry) {
std::unique_ptr<net::URLRequest> request =
CreateAndExecuteRequest(GURL("http://foo.com"));
- EXPECT_EQ(net::URLRequestStatus::SUCCESS, request->status().status());
+ EXPECT_EQ(net::OK, delegate().request_status());
EXPECT_EQ(200, request->GetResponseCode());
EXPECT_EQ(kBody, delegate().data_received());
EXPECT_FALSE(request->was_fetched_via_proxy());

Powered by Google App Engine
This is Rietveld 408576698