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

Unified Diff: content/child/web_url_loader_impl_unittest.cc

Issue 2163183002: Fix PerformanceResourceTiming transferSize field for sync XHR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_worker_tests
Patch Set: Rebase 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
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/test/mock_weburlloader.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 57d647b244eb997c3d57c0142551e1c0aeea6c3d..dc4baeb4e8fe650bbed33100d268996c9e0d107b 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -686,6 +686,7 @@ TEST_F(WebURLLoaderImplTest, ResponseIPAddress) {
TEST_F(WebURLLoaderImplTest, SyncLengths) {
static const char kBodyData[] = "Today is Thursday";
const int kEncodedBodyLength = 30;
+ const int kEncodedDataLength = 130;
const GURL url(kTestURL);
blink::WebURLRequest request(url);
@@ -696,14 +697,18 @@ TEST_F(WebURLLoaderImplTest, SyncLengths) {
sync_load_response.data = kBodyData;
ASSERT_EQ(17u, sync_load_response.data.size());
sync_load_response.encoded_body_length = kEncodedBodyLength;
+ sync_load_response.encoded_data_length = kEncodedDataLength;
dispatcher()->set_sync_load_response(sync_load_response);
blink::WebURLResponse response;
blink::WebURLError error;
blink::WebData data;
- client()->loader()->loadSynchronously(request, response, error, data);
+ int64_t encoded_data_length = 0;
+ client()->loader()->loadSynchronously(request, response, error, data,
+ encoded_data_length);
EXPECT_EQ(kEncodedBodyLength, response.encodedBodyLength());
+ EXPECT_EQ(kEncodedDataLength, encoded_data_length);
int expected_decoded_body_length = strlen(kBodyData);
EXPECT_EQ(expected_decoded_body_length, response.decodedBodyLength());
}
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/test/mock_weburlloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698