chromium/components/performance_manager/performance_manager_registry_impl_unittest.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/performance_manager/performance_manager_registry_impl.h"

#include "base/memory/ptr_util.h"
#include "base/test/gtest_util.h"
#include "components/performance_manager/graph/process_node_impl.h"
#include "components/performance_manager/public/performance_manager_main_thread_mechanism.h"
#include "components/performance_manager/public/performance_manager_main_thread_observer.h"
#include "components/performance_manager/public/performance_manager_owned.h"
#include "components/performance_manager/public/performance_manager_registered.h"
#include "components/performance_manager/test_support/performance_manager_test_harness.h"
#include "components/performance_manager/test_support/run_in_graph.h"
#include "components/performance_manager/test_support/test_browser_child_process.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/common/process_type.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/test_navigation_throttle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace performance_manager {

namespace {

PerformanceManagerRegistryImplTest;
PerformanceManagerRegistryImplDeathTest;

class LenientMockObserver : public PerformanceManagerMainThreadObserver {};

MockObserver;

class LenientMockMechanism : public PerformanceManagerMainThreadMechanism {};

MockMechanism;

}  // namespace

TEST_F(PerformanceManagerRegistryImplTest, ObserverWorks) {}

TEST_F(PerformanceManagerRegistryImplTest,
       MechanismCreateThrottlesForNavigation) {}

namespace {

class LenientOwned : public PerformanceManagerOwned {};

Owned;

}  // namespace

TEST_F(PerformanceManagerRegistryImplTest, PerformanceManagerOwned) {}

namespace {

class Foo : public PerformanceManagerRegisteredImpl<Foo> {};

class Bar : public PerformanceManagerRegisteredImpl<Bar> {};

}  // namespace

TEST_F(PerformanceManagerRegistryImplTest, RegistrationWorks) {}

// Tests that accessors for browser and utility ProcessNodes work. Renderer
// ProcessNodes are handled by RenderProcessUserData.

TEST_F(PerformanceManagerRegistryImplDeathTest, BrowserProcessNode) {}

TEST_F(PerformanceManagerRegistryImplDeathTest, BrowserChildProcessNodes) {}

}  // namespace performance_manager