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

Unified Diff: content/child/resource_dispatcher_unittest.cc

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Fixes from ksakamoto review Created 4 years, 5 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: content/child/resource_dispatcher_unittest.cc
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index 51a5b1aea8563cfa0dfa286ae5b67993bebe0367..582355a92177bfe607447a4fbb90c5a72950af53 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -31,7 +31,7 @@
#include "content/public/child/fixed_received_data.h"
#include "content/public/child/request_peer.h"
#include "content/public/child/resource_dispatcher_delegate.h"
-#include "content/public/common/content_features.cc"
+#include "content/public/common/content_features.h"
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
@@ -90,7 +90,7 @@ class TestRequestPeer : public RequestPeer {
EXPECT_TRUE(context_->received_response);
EXPECT_FALSE(context_->complete);
context_->data.append(data->payload(), data->length());
- context_->total_encoded_data_length += data->encoded_length();
+ context_->total_encoded_data_length += data->encoded_data_length();
}
void OnCompletedRequest(int error_code,
@@ -290,9 +290,9 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
void NotifyDataDownloaded(int request_id,
int decoded_length,
- int encoded_length) {
+ int encoded_data_length) {
EXPECT_TRUE(dispatcher_->OnMessageReceived(ResourceMsg_DataDownloaded(
- request_id, decoded_length, encoded_length)));
+ request_id, decoded_length, encoded_data_length)));
}
void NotifyRequestComplete(int request_id, size_t total_size) {
@@ -550,8 +550,8 @@ class TestResourceDispatcherDelegate : public ResourceDispatcherDelegate {
int64_t total_transfer_size) override {
original_peer_->OnReceivedResponse(response_info_);
if (!data_.empty()) {
- original_peer_->OnReceivedData(base::WrapUnique(
- new FixedReceivedData(data_.data(), data_.size(), -1)));
+ original_peer_->OnReceivedData(base::WrapUnique(new FixedReceivedData(
+ data_.data(), data_.size(), -1, data_.size())));
}
original_peer_->OnCompletedRequest(error_code, was_ignored_by_handler,
stale_copy_in_cache, security_info,
@@ -823,15 +823,15 @@ TEST_F(ResourceDispatcherTest, DownloadToFile) {
EXPECT_TRUE(peer_context.received_response);
int expected_total_downloaded_length = 0;
- int expected_total_encoded_length = 0;
+ int expected_total_encoded_data_length = 0;
for (int i = 0; i < 10; ++i) {
NotifyDataDownloaded(id, kDownloadedIncrement, kEncodedIncrement);
ConsumeDataDownloaded_ACK(id);
expected_total_downloaded_length += kDownloadedIncrement;
- expected_total_encoded_length += kEncodedIncrement;
+ expected_total_encoded_data_length += kEncodedIncrement;
EXPECT_EQ(expected_total_downloaded_length,
peer_context.total_downloaded_data_length);
- EXPECT_EQ(expected_total_encoded_length,
+ EXPECT_EQ(expected_total_encoded_data_length,
peer_context.total_encoded_data_length);
}
@@ -845,7 +845,7 @@ TEST_F(ResourceDispatcherTest, DownloadToFile) {
EXPECT_EQ(0u, queued_messages());
EXPECT_EQ(expected_total_downloaded_length,
peer_context.total_downloaded_data_length);
- EXPECT_EQ(expected_total_encoded_length,
+ EXPECT_EQ(expected_total_encoded_data_length,
peer_context.total_encoded_data_length);
}

Powered by Google App Engine
This is Rietveld 408576698