#ifndef COMPONENTS_PRIVACY_SANDBOX_PRIVACY_SANDBOX_TEST_UTIL_H_
#define COMPONENTS_PRIVACY_SANDBOX_PRIVACY_SANDBOX_TEST_UTIL_H_
#include <set>
#include <string>
#include "components/browsing_topics/test_util.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/test/content_settings_mock_provider.h"
#include "components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.h"
#include "components/privacy_sandbox/privacy_sandbox_prefs.h"
#include "components/privacy_sandbox/privacy_sandbox_settings.h"
#include "components/privacy_sandbox/tpcd_experiment_eligibility.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "url/origin.h"
namespace sync_preferences {
class TestingPrefServiceSyncable;
}
class HostContentSettingsMap;
namespace privacy_sandbox_test_util {
class PrivacySandboxServiceTestInterface { … };
class MockPrivacySandboxObserver
: public privacy_sandbox::PrivacySandboxSettings::Observer { … };
class MockPrivacySandboxSettingsDelegate
: public privacy_sandbox::PrivacySandboxSettings::Delegate { … };
enum class StateKey { … };
enum class InputKey { … };
enum class OutputKey { … };
MultipleKeys;
MultipleStateKeys;
MultipleInputKeys;
MultipleOutputKeys;
TestKey;
SiteDataException;
SiteDataExceptions;
TestCaseItemValue;
TestState;
TestInput;
TestOutput;
TestCase;
const ContentSetting kNoSetting = …;
struct CookieContentSettingException { … };
void RunTestCase(
content::BrowserTaskEnvironment* task_environment,
sync_preferences::TestingPrefServiceSyncable* testing_pref_service,
HostContentSettingsMap* host_content_settings_map,
MockPrivacySandboxSettingsDelegate* mock_delegate,
browsing_topics::MockBrowsingTopicsService* mock_browsing_topics_service,
privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings,
PrivacySandboxServiceTestInterface* privacy_sandbox_service,
content_settings::MockProvider* user_content_setting_provider,
content_settings::MockProvider* managed_content_setting_provider,
const TestCase& test_case);
void ApplyTestState(
StateKey key,
const TestCaseItemValue& value,
content::BrowserTaskEnvironment* task_environment,
sync_preferences::TestingPrefServiceSyncable* testing_pref_service,
HostContentSettingsMap* map,
MockPrivacySandboxSettingsDelegate* mock_delegate,
PrivacySandboxServiceTestInterface* privacy_sandbox_service,
browsing_topics::MockBrowsingTopicsService* mock_browsing_topics_service,
privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings,
content_settings::MockProvider* user_content_setting_provider,
content_settings::MockProvider* managed_content_setting_provider);
void ProvideInput(const std::pair<InputKey, TestCaseItemValue>& input,
PrivacySandboxServiceTestInterface* privacy_sandbox_service);
void CheckOutput(
const std::map<InputKey, TestCaseItemValue>& input,
const std::pair<OutputKey, TestCaseItemValue>& output,
privacy_sandbox::PrivacySandboxSettings* privacy_sandbox_settings,
PrivacySandboxServiceTestInterface* privacy_sandbox_service,
sync_preferences::TestingPrefServiceSyncable* testing_pref_service);
}
#endif