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

Unified Diff: net/base/sdch_manager_unittest.cc

Issue 2699163002: Whitelist net/ MemoryDumpProvider (Closed)
Patch Set: fix test Created 3 years, 10 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: net/base/sdch_manager_unittest.cc
diff --git a/net/base/sdch_manager_unittest.cc b/net/base/sdch_manager_unittest.cc
index 31162841b6c90495ed201818d9e1b042beee2e1a..b1ef45fa6aaa787a5b1757d8f283bbe1583278bc 100644
--- a/net/base/sdch_manager_unittest.cc
+++ b/net/base/sdch_manager_unittest.cc
@@ -640,7 +640,18 @@ TEST_F(SdchManagerTest, AddRemoveNotifications) {
sdch_manager()->RemoveObserver(&observer);
}
-TEST_F(SdchManagerTest, DumpMemoryStats) {
+class SdchManagerMemoryDumpTest
+ : public SdchManagerTest,
+ public testing::WithParamInterface<
+ base::trace_event::MemoryDumpLevelOfDetail> {};
+
+INSTANTIATE_TEST_CASE_P(
+ /* no prefix */,
+ SdchManagerMemoryDumpTest,
+ ::testing::Values(base::trace_event::MemoryDumpLevelOfDetail::DETAILED,
+ base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND));
+
+TEST_P(SdchManagerMemoryDumpTest, DumpMemoryStats) {
MockSdchObserver observer;
sdch_manager()->AddObserver(&observer);
@@ -655,17 +666,16 @@ TEST_F(SdchManagerTest, DumpMemoryStats) {
EXPECT_EQ(target_gurl, observer.last_dictionary_url());
EXPECT_EQ(server_hash, observer.last_server_hash());
- base::trace_event::MemoryDumpArgs dump_args = {
- base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
+ base::trace_event::MemoryDumpArgs dump_args = {GetParam()};
std::unique_ptr<base::trace_event::ProcessMemoryDump> pmd(
new base::trace_event::ProcessMemoryDump(nullptr, dump_args));
base::trace_event::MemoryAllocatorDump* parent =
- pmd->CreateAllocatorDump("parent");
+ pmd->CreateAllocatorDump("net/url_request_context_0x123");
sdch_manager()->DumpMemoryStats(pmd.get(), parent->absolute_name());
const base::trace_event::MemoryAllocatorDump* sub_dump =
- pmd->GetAllocatorDump("parent/sdch_manager");
+ pmd->GetAllocatorDump("net/url_request_context_0x123/sdch_manager");
ASSERT_NE(nullptr, sub_dump);
const base::trace_event::MemoryAllocatorDump* dump = pmd->GetAllocatorDump(
base::StringPrintf("net/sdch_manager_%p", sdch_manager()));

Powered by Google App Engine
This is Rietveld 408576698