chromium/components/supervised_user/core/browser/supervised_user_metrics_service_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 "components/supervised_user/core/browser/supervised_user_metrics_service.h"

#include <memory>

#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "components/signin/public/identity_manager/identity_test_environment.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_settings_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/pref_names.h"
#include "components/supervised_user/test_support/supervised_user_url_filter_test_utils.h"
#include "components/sync/test/mock_sync_service.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace supervised_user {

class MockSupervisedUserMetricsServiceExtensionDelegateImpl
    : public SupervisedUserMetricsService::
          SupervisedUserMetricsServiceExtensionDelegate {};

// Tests for family user metrics service.
class SupervisedUserMetricsServiceTest : public testing::Test {};

// Tests that the recorded day is updated after more than one day passes.
TEST_F(SupervisedUserMetricsServiceTest, NewDayAfterMultipleDays) {}

// Tests that the recorded day is updated after metrics service is created.
TEST_F(SupervisedUserMetricsServiceTest, NewDayAfterServiceCreation) {}

// Tests that the recorded day is updated only after a supervised user is
// detected.
TEST_F(SupervisedUserMetricsServiceTest, NewDayAfterSupervisedUserDetected) {}

// Tests that metrics are not recorded for unsupervised users.
TEST_F(SupervisedUserMetricsServiceTest,
       MetricsNotRecordedForSignedOutSupervisedUser) {}

// Tests that default metrics are recorded for supervised users whose parent has
// not changed the initial configuration.
TEST_F(SupervisedUserMetricsServiceTest, RecordDefaultMetrics) {}

}  // namespace supervised_user