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

Unified Diff: content/child/web_url_loader_impl_unittest.cc

Issue 2835123005: Send the decoded size when response completed and stop summing in ResourceLoader::DidReceiveData() (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « content/child/web_url_loader_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/child/web_url_loader_impl_unittest.cc
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc
index e4877d2490322cd9f576c00a4c9be7f58c4dff8f..f0ff7471cf8d2eb2a6713611e876d055158ef7f1 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -193,7 +193,8 @@ class TestWebURLLoaderClient : public blink::WebURLLoaderClient {
void DidFinishLoading(double finishTime,
int64_t totalEncodedDataLength,
- int64_t totalEncodedBodyLength) override {
+ int64_t totalEncodedBodyLength,
+ int64_t totalDecodedBodyLength) override {
EXPECT_TRUE(loader_);
EXPECT_TRUE(did_receive_response_);
EXPECT_FALSE(did_finish_);
@@ -205,7 +206,8 @@ class TestWebURLLoaderClient : public blink::WebURLLoaderClient {
void DidFail(const blink::WebURLError& error,
int64_t totalEncodedDataLength,
- int64_t totalEncodedBodyLength) override {
+ int64_t totalEncodedBodyLength,
+ int64_t totalDecodedBodyLength) override {
EXPECT_TRUE(loader_);
EXPECT_FALSE(did_finish_);
error_ = error;
@@ -323,7 +325,8 @@ class WebURLLoaderImplTest : public testing::Test {
void DoCompleteRequest() {
EXPECT_FALSE(client()->did_finish());
peer()->OnCompletedRequest(net::OK, false, false, base::TimeTicks(),
- strlen(kTestData), strlen(kTestData));
+ strlen(kTestData), strlen(kTestData),
+ strlen(kTestData));
EXPECT_TRUE(client()->did_finish());
// There should be no error.
EXPECT_EQ(net::OK, client()->error().reason);
@@ -333,7 +336,8 @@ class WebURLLoaderImplTest : public testing::Test {
void DoFailRequest() {
EXPECT_FALSE(client()->did_finish());
peer()->OnCompletedRequest(net::ERR_FAILED, false, false, base::TimeTicks(),
- strlen(kTestData), strlen(kTestData));
+ strlen(kTestData), strlen(kTestData),
+ strlen(kTestData));
EXPECT_FALSE(client()->did_finish());
EXPECT_EQ(net::ERR_FAILED, client()->error().reason);
EXPECT_EQ(net::kErrorDomain, client()->error().domain.Utf8());
@@ -573,7 +577,8 @@ TEST_F(WebURLLoaderImplTest, FtpDeleteOnReceiveMoreData) {
// cancel in DoReceiveDataFtp, before the request finishes.
client()->set_delete_on_receive_data();
peer()->OnCompletedRequest(net::OK, false, false, base::TimeTicks(),
- strlen(kTestData), strlen(kTestData));
+ strlen(kTestData), strlen(kTestData),
+ strlen(kTestData));
EXPECT_FALSE(client()->did_finish());
}
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698