summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider_test.cc
blob: bd590dd3bd533a340ca0fbae230e92e062de2877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider.h"

#include "base/trace_event/process_memory_dump.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/wtf/threading.h"

namespace blink {

TEST(BlinkGCDumpProviderTest, MemoryDump) {
  base::trace_event::MemoryDumpArgs args = {
      base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
  std::unique_ptr<base::trace_event::ProcessMemoryDump> dump(
      new base::trace_event::ProcessMemoryDump(args));
  BlinkGCMemoryDumpProvider::Instance()->OnMemoryDump(args, dump.get());
  DCHECK(dump->GetAllocatorDump("blink_gc"));
  DCHECK(dump->GetAllocatorDump("blink_gc/allocated_objects"));
}

}  // namespace blink