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

Unified Diff: content/browser/loader/url_loader_factory_impl_unittest.cc

Issue 2515383004: Revert of Send encoded_body_length to renderer when response completed (1/3) (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/url_loader_factory_impl_unittest.cc
diff --git a/content/browser/loader/url_loader_factory_impl_unittest.cc b/content/browser/loader/url_loader_factory_impl_unittest.cc
index 9620798638c1750f87bf2490e64d34cf5b9e5a3f..97f81a3f83baffe065a8131a917f5d6bee7944bb 100644
--- a/content/browser/loader/url_loader_factory_impl_unittest.cc
+++ b/content/browser/loader/url_loader_factory_impl_unittest.cc
@@ -203,10 +203,6 @@
base::ReadFileToString(
root.Append(base::FilePath(FILE_PATH_LITERAL("hello.html"))), &expected);
EXPECT_EQ(expected, contents);
- EXPECT_EQ(static_cast<int64_t>(expected.size()),
- client.completion_status().encoded_data_length);
- EXPECT_EQ(static_cast<int64_t>(expected.size()),
- client.completion_status().encoded_body_length);
}
TEST_P(URLLoaderFactoryImplTest, GetFailedResponse) {
@@ -227,32 +223,6 @@
ASSERT_FALSE(client.response_body().is_valid());
EXPECT_EQ(net::ERR_TIMED_OUT, client.completion_status().error_code);
- EXPECT_EQ(0, client.completion_status().encoded_data_length);
- EXPECT_EQ(0, client.completion_status().encoded_body_length);
-}
-
-// In this case, the loading fails after receiving a response.
-TEST_P(URLLoaderFactoryImplTest, GetFailedResponse2) {
- NavigationResourceThrottle::set_ui_checks_always_succeed_for_testing(true);
- mojom::URLLoaderAssociatedPtr loader;
- ResourceRequest request;
- TestURLLoaderClient client;
- net::URLRequestFailedJob::AddUrlHandler();
- request.url = net::URLRequestFailedJob::GetMockHttpUrlWithFailurePhase(
- net::URLRequestFailedJob::READ_ASYNC, net::ERR_TIMED_OUT);
- request.method = "GET";
- request.is_main_frame = true;
- factory_->CreateLoaderAndStart(
- mojo::GetProxy(&loader, factory_.associated_group()), 2, 1, request,
- client.CreateRemoteAssociatedPtrInfo(factory_.associated_group()));
-
- client.RunUntilComplete();
- ASSERT_FALSE(client.has_received_response());
- ASSERT_TRUE(client.response_body().is_valid());
-
- EXPECT_EQ(net::ERR_TIMED_OUT, client.completion_status().error_code);
- EXPECT_GT(client.completion_status().encoded_data_length, 0);
- EXPECT_EQ(0, client.completion_status().encoded_body_length);
}
// This test tests a case where resource loading is cancelled before started.
@@ -358,10 +328,6 @@
base::ReadFileToString(
root.Append(base::FilePath(FILE_PATH_LITERAL("hello.html"))), &expected);
EXPECT_EQ(expected, contents);
- EXPECT_EQ(static_cast<int64_t>(expected.size()),
- client.completion_status().encoded_data_length);
- EXPECT_EQ(static_cast<int64_t>(expected.size()),
- client.completion_status().encoded_body_length);
}
TEST_P(URLLoaderFactoryImplTest, DownloadToFileFailure) {
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698