chromium/chrome/browser/metrics/family_link_user_metrics_provider_unittest.cc

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

#include "chrome/browser/metrics/family_link_user_metrics_provider.h"

#include <string>

#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/identity_test_environment_profile_adaptor.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/browser/supervised_user/supervised_user_test_util.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/test/content_settings_mock_provider.h"
#include "components/content_settings/core/test/content_settings_test_utils.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/account_capabilities_test_mutator.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
#include "components/supervised_user/core/browser/supervised_user_service.h"
#include "components/supervised_user/core/browser/supervised_user_url_filter.h"
#include "components/supervised_user/core/browser/supervised_user_utils.h"
#include "components/supervised_user/core/common/features.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {
constexpr char kTestEmail[] =;
constexpr char kTestEmail1[] =;
constexpr char kTestEmail2[] =;
constexpr char kTestProfile[] =;
constexpr char kTestProfile1[] =;
constexpr char kTestProfile2[] =;

}  // namespace
class FamilyLinkUserMetricsProviderTest : public testing::Test {};

TEST_F(FamilyLinkUserMetricsProviderTest,
       ProfileWithUnknownCapabilitiesDoesNotOutputHistogram) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       ProfileWithRequiredSupervisionLoggedAsSupervisionEnabledByPolicy) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       ProfileWithOptionalSupervisionLoggedSupervisionEnabledByUser) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       ProfileWithAdultUserLoggedAsUnsupervised) {}

TEST_F(
    FamilyLinkUserMetricsProviderTest,
    ProfilesWithMixedSupervisedUsersLoggedAsMixedProfileWithDefaultWebFilter) {}

TEST_F(
    FamilyLinkUserMetricsProviderTest,
    ProfilesWithMixedSupervisedAndAdultUsersLoggedAsMixedProfileWithDefaultWebFilter) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       ProfilesWithMixedSupervisedFiltersLoggedAsMixed) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       AdultProfileDoesNotHavePermissionLogged) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       SupervisedProfileWithBlockedGeolocationLoggedAsPermissionsDisabled) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       SupervisedProfileWithAllowedGeolocationLoggedAsPermissionsEnabled) {}

#if BUILDFLAG(ENABLE_EXTENSIONS)
class FamilyLinkUserMetricsProviderTestWithExtensionsPermissionsEnabled
    : public FamilyLinkUserMetricsProviderTest {};

TEST_F(FamilyLinkUserMetricsProviderTestWithExtensionsPermissionsEnabled,
       ProfileWithExtensionToggleStateUnsetLoggedAsDisabled) {}

TEST_F(FamilyLinkUserMetricsProviderTestWithExtensionsPermissionsEnabled,
       ProfileWithExtensionToggleStateOffLoggedAsDisabled) {}

TEST_F(FamilyLinkUserMetricsProviderTestWithExtensionsPermissionsEnabled,
       ProfileWithExtensionToggleStateOnLoggedAsEnabled) {}

TEST_F(FamilyLinkUserMetricsProviderTestWithExtensionsPermissionsEnabled,
       ProfilesWithMixedExtensionToggleStateLoggedAsMixed) {}
#endif  // BUILDFLAG(ENABLE_EXTENSIONS)

TEST_F(FamilyLinkUserMetricsProviderTest,
       NoProfilesAddedShouldNotLogHistogram) {}

TEST_F(FamilyLinkUserMetricsProviderTest,
       SignedOutProfileLoggedAsUnsupervised) {}