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

Unified Diff: third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc

Issue 1738463004: Improve test coveage of WebProcessMemoryDumpImplTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Primiano's review Created 4 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
« no previous file with comments | « third_party/WebKit/Source/platform/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
diff --git a/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc b/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
index 00505edb11f7e58aba8ef929f5814d3f6603099b..8d4ad742092561edbedb7b54e01e554274ed7e74 100644
--- a/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
+++ b/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
@@ -4,6 +4,8 @@
#include "platform/web_process_memory_dump_impl.h"
+#include "base/memory/discardable_memory.h"
+#include "base/test/test_discardable_memory_allocator.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/trace_event_argument.h"
@@ -119,6 +121,18 @@ TEST(WebProcessMemoryDumpImplTest, IntegrationTest) {
ASSERT_EQ(wmad4->guid(), allocator_dumps_edges[0].source.ToUint64());
ASSERT_EQ(guid, allocator_dumps_edges[0].target.ToUint64());
+ // Check that createDumpAdapterForSkia() works.
+ auto skia_trace_memory_dump = wpmd1->createDumpAdapterForSkia("1/skia");
+ ASSERT_TRUE(skia_trace_memory_dump);
+
+ // Check that createDiscardableMemoryAllocatorDump() works.
+ base::TestDiscardableMemoryAllocator discardable_memory_allocator;
+ auto discardable_memory =
+ discardable_memory_allocator.AllocateLockedDiscardableMemory(1024);
+ wpmd1->createDiscardableMemoryAllocatorDump("1/discardable",
+ discardable_memory.get());
+ discardable_memory->Unlock();
+
wpmd1.reset();
}
« no previous file with comments | « third_party/WebKit/Source/platform/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698