| OLD | NEW |
| 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 "base/memory/scoped_ptr.h" |
| 5 #include "base/trace_event/process_memory_dump.h" | 6 #include "base/trace_event/process_memory_dump.h" |
| 6 #include "skia/ext/skia_memory_dump_provider.h" | 7 #include "skia/ext/skia_memory_dump_provider.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 9 |
| 9 namespace skia { | 10 namespace skia { |
| 10 | 11 |
| 11 // Tests if the skia dump provider dumps without crashing. | 12 // Tests if the skia dump provider dumps without crashing. |
| 12 TEST(SkiaMemoryDumpProviderTest, OnMemoryDump) { | 13 TEST(SkiaMemoryDumpProviderTest, OnMemoryDump) { |
| 13 scoped_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump( | 14 scoped_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump( |
| 14 new base::trace_event::ProcessMemoryDump(nullptr)); | 15 new base::trace_event::ProcessMemoryDump(nullptr)); |
| 15 base::trace_event::MemoryDumpArgs dump_args = { | 16 base::trace_event::MemoryDumpArgs dump_args = { |
| 16 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; | 17 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; |
| 17 SkiaMemoryDumpProvider::GetInstance()->OnMemoryDump( | 18 SkiaMemoryDumpProvider::GetInstance()->OnMemoryDump( |
| 18 dump_args, process_memory_dump.get()); | 19 dump_args, process_memory_dump.get()); |
| 19 | 20 |
| 20 ASSERT_TRUE(process_memory_dump->GetAllocatorDump("skia/sk_glyph_cache")); | 21 ASSERT_TRUE(process_memory_dump->GetAllocatorDump("skia/sk_glyph_cache")); |
| 21 } | 22 } |
| 22 | 23 |
| 23 } // namespace skia | 24 } // namespace skia |
| OLD | NEW |