chromium/chrome/browser/tpcd/experiment/eligibility_service_unittest.cc

// Copyright 2023 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/tpcd/experiment/eligibility_service.h"

#include <memory>
#include <optional>
#include <utility>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h"
#include "chrome/browser/privacy_sandbox/tracking_protection_onboarding_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tpcd/experiment/eligibility_service_factory.h"
#include "chrome/browser/tpcd/experiment/mock_experiment_manager.h"
#include "chrome/browser/tpcd/experiment/tpcd_experiment_features.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/privacy_sandbox/privacy_sandbox_settings.h"
#include "components/privacy_sandbox/privacy_sandbox_test_util.h"
#include "components/privacy_sandbox/tpcd_experiment_eligibility.h"
#include "components/privacy_sandbox/tracking_protection_onboarding.h"
#include "components/privacy_sandbox/tracking_protection_prefs.h"
#include "components/version_info/channel.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace tpcd::experiment {

namespace {

_;
Return;
TpcdExperimentEligibility;

constexpr char kReasonForEligibilityStoredInPrefsHistogram[] =;

constexpr char kReasonForComputedEligibilityForProfileHistogram[] =;

}  // namespace

class EligibilityServiceTestBase : public testing::Test {};

class EligibilityServiceTest : public EligibilityServiceTestBase {};

TEST_F(EligibilityServiceTest, ClientEligibilityKnown_ClientEligibilityNotSet) {}

TEST_F(EligibilityServiceTest,
       ClientEligibilityUnknownProfileIneligible_ClientEligibilitySet) {}

TEST_F(EligibilityServiceTest,
       ClientEligibilityUnknownProfileEligible_ClientEligibilitySet) {}

class EligibilityServiceOTRProfileTest
    : public EligibilityServiceTestBase,
      public testing::WithParamInterface<bool> {};

TEST_P(EligibilityServiceOTRProfileTest, Creation) {}

INSTANTIATE_TEST_SUITE_P();

struct EligibilityServiceHistogramTestCase {};

const EligibilityServiceHistogramTestCase kTestCases[] =;

class EligibilityServiceHistogramTest
    : public EligibilityServiceTest,
      public testing::WithParamInterface<EligibilityServiceHistogramTestCase> {};

TEST_P(EligibilityServiceHistogramTest, ProfileEligibilityMismatch) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace tpcd::experiment