skia_memory_dump_provider_unittest.cc 908 B

1234567891011121314151617181920212223242526
  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
  3. // found in the LICENSE file.
  4. #include "skia/ext/skia_memory_dump_provider.h"
  5. #include <memory>
  6. #include "base/trace_event/process_memory_dump.h"
  7. #include "testing/gtest/include/gtest/gtest.h"
  8. namespace skia {
  9. // Tests if the skia dump provider dumps without crashing.
  10. TEST(SkiaMemoryDumpProviderTest, OnMemoryDump) {
  11. base::trace_event::MemoryDumpArgs dump_args = {
  12. base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
  13. std::unique_ptr<base::trace_event::ProcessMemoryDump> process_memory_dump(
  14. new base::trace_event::ProcessMemoryDump(dump_args));
  15. SkiaMemoryDumpProvider::GetInstance()->OnMemoryDump(
  16. dump_args, process_memory_dump.get());
  17. ASSERT_TRUE(process_memory_dump->GetAllocatorDump("skia/sk_glyph_cache"));
  18. }
  19. } // namespace skia