chromium/components/metrics/content/content_stability_metrics_provider_unittest.cc

// Copyright 2015 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/metrics/content/content_stability_metrics_provider.h"

#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "components/metrics/content/extensions_helper.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/prefs/testing_pref_service.h"
#include "components/variations/hashing.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/child_process_termination_info.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/common/process_type.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "extensions/buildflags/buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/system_profile.pb.h"

namespace metrics {

namespace {

const char kTestUtilityProcessName[] =;

class MockExtensionsHelper : public ExtensionsHelper {};

}  // namespace

class ContentStabilityMetricsProviderTest : public testing::Test {};

TEST_F(ContentStabilityMetricsProviderTest,
       BrowserChildProcessObserverUtility) {}

#if !BUILDFLAG(IS_ANDROID)
TEST_F(ContentStabilityMetricsProviderTest, RenderProcessObserver) {}

TEST_F(ContentStabilityMetricsProviderTest,
       MetricsServicesWebContentsObserver) {}

#endif  // !BUILDFLAG(IS_ANDROID)

// Assertions for an extension related crash.
// This test only works if extensions are enabled as there is a DCHECK in
// StabilityMetricsHelper that it is only called with a value of true for
// extension process if extensions are enabled.
#if BUILDFLAG(ENABLE_EXTENSIONS)
TEST_F(ContentStabilityMetricsProviderTest, ExtensionsNotificationObserver) {}
#endif

}  // namespace metrics