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

Side by Side Diff: skia/ext/skia_memory_dump_provider_unittest.cc

Issue 2006943003: [tracing] Sanitize process memory dumps for background mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@whitelist_mdp
Patch Set: Fix stripping. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « gin/v8_isolate_memory_dump_provider_unittest.cc ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "skia/ext/skia_memory_dump_provider.h" 5 #include "skia/ext/skia_memory_dump_provider.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/trace_event/process_memory_dump.h" 9 #include "base/trace_event/process_memory_dump.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace skia { 12 namespace skia {
13 13
14 // Tests if the skia dump provider dumps without crashing. 14 // Tests if the skia dump provider dumps without crashing.
15 TEST(SkiaMemoryDumpProviderTest, OnMemoryDump) { 15 TEST(SkiaMemoryDumpProviderTest, OnMemoryDump) {
16 std::unique_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump(
17 new base::trace_event::ProcessMemoryDump(nullptr));
18 base::trace_event::MemoryDumpArgs dump_args = { 16 base::trace_event::MemoryDumpArgs dump_args = {
19 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; 17 base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
18 std::unique_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump(
19 new base::trace_event::ProcessMemoryDump(nullptr, dump_args));
20 SkiaMemoryDumpProvider::GetInstance()->OnMemoryDump( 20 SkiaMemoryDumpProvider::GetInstance()->OnMemoryDump(
21 dump_args, process_memory_dump.get()); 21 dump_args, process_memory_dump.get());
22 22
23 ASSERT_TRUE(process_memory_dump->GetAllocatorDump("skia/sk_glyph_cache")); 23 ASSERT_TRUE(process_memory_dump->GetAllocatorDump("skia/sk_glyph_cache"));
24 } 24 }
25 25
26 } // namespace skia 26 } // namespace skia
OLDNEW
« no previous file with comments | « gin/v8_isolate_memory_dump_provider_unittest.cc ('k') | sql/connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698