summaryrefslogtreecommitdiffstats
path: root/base/trace_event/winheap_dump_provider_win_unittest.cc
blob: c74a7b7bc82d41da134f29ec1392103169bdb4b7 (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
25
26
27
28
// 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 "base/trace_event/winheap_dump_provider_win.h"

#include <windows.h>

#include "base/trace_event/memory_dump_session_state.h"
#include "base/trace_event/process_memory_dump.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace trace_event {

TEST(WinHeapDumpProviderTest, OnMemoryDump) {
  ProcessMemoryDump pmd(new MemoryDumpSessionState(nullptr, nullptr));
  MemoryDumpArgs dump_args = {MemoryDumpLevelOfDetail::DETAILED};

  WinHeapDumpProvider* winheap_dump_provider =
      WinHeapDumpProvider::GetInstance();
  ASSERT_NE(static_cast<WinHeapDumpProvider*>(nullptr), winheap_dump_provider);

  ASSERT_NO_FATAL_FAILURE(winheap_dump_provider->OnMemoryDump(dump_args, &pmd));
}

}  // namespace trace_event
}  // namespace base