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

Unified Diff: net/url_request/url_request_context_unittest.cc

Issue 2560593002: Make HttpNetworkSession::DumpMemoryStats attribute memory usage correctly (Closed)
Patch Set: self review Created 4 years 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 | « net/http/http_network_session.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_unittest.cc
diff --git a/net/url_request/url_request_context_unittest.cc b/net/url_request/url_request_context_unittest.cc
index 43d67fd31701811e19acdbec2049f5f01e73eb28..30d15079404c2183a45d20b7881dd989e0aff30c 100644
--- a/net/url_request/url_request_context_unittest.cc
+++ b/net/url_request/url_request_context_unittest.cc
@@ -32,18 +32,26 @@ TEST(URLRequestContextTest, MemoryDumpProvider) {
bool did_dump_http_network_session = false;
bool did_dump_ssl_client_session_cache = false;
bool did_dump_url_request_context = false;
+ bool did_dump_url_request_context_http_network_session = false;
for (const auto& it : allocator_dumps) {
const std::string& dump_name = it.first;
if (dump_name.find("net/http_network_session") != std::string::npos)
did_dump_http_network_session = true;
if (dump_name.find("net/ssl_session_cache") != std::string::npos)
did_dump_ssl_client_session_cache = true;
- if (dump_name.find("net/url_request_context") != std::string::npos)
- did_dump_url_request_context = true;
+ if (dump_name.find("net/url_request_context") != std::string::npos) {
+ // A sub allocator dump to take into account of the sharing relationship.
+ if (dump_name.find("http_network_session") != std::string::npos) {
+ did_dump_url_request_context_http_network_session = true;
+ } else {
+ did_dump_url_request_context = true;
+ }
+ }
}
ASSERT_TRUE(did_dump_http_network_session);
ASSERT_TRUE(did_dump_ssl_client_session_cache);
ASSERT_TRUE(did_dump_url_request_context);
+ ASSERT_TRUE(did_dump_url_request_context_http_network_session);
}
// TODO(xunjieli): Add more granular tests on the MemoryDumpProvider.
« no previous file with comments | « net/http/http_network_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698