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

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

Issue 2503713004: Avoid string copies when determining approximate memory usage in RDHI (Closed)
Patch Set: rdsmith review and fix unit tests 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_unittest.cc
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 1d4435b0419b32557f1bf795a97c952286f133f1..d0e142ab915f9eb9856e8b7e754f05ca057c4055 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -2194,15 +2194,13 @@ TEST_P(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) {
net::URLRequestContext context;
std::unique_ptr<net::URLRequest> req(context.CreateRequest(
GURL("http://www.google.com"), net::DEFAULT_PRIORITY, NULL));
- EXPECT_EQ(
- 4427,
- ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get()));
+ EXPECT_EQ(4425, ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(
+ req.get()));
// Add 9 bytes of referrer.
req->SetReferrer("123456789");
- EXPECT_EQ(
- 4436,
- ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get()));
+ EXPECT_EQ(4434, ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(
+ req.get()));
// Add 33 bytes of upload content.
std::string upload_content;
@@ -2215,9 +2213,8 @@ TEST_P(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) {
net::ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
// Since the upload throttling is disabled, this has no effect on the cost.
- EXPECT_EQ(
- 4436,
- ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(req.get()));
+ EXPECT_EQ(4434, ResourceDispatcherHostImpl::CalculateApproximateMemoryCost(
+ req.get()));
}
// Test that too much memory for outstanding requests for a particular
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698