#include "chrome/browser/dips/dips_service.h"
#include <optional>
#include "base/files/file_util.h"
#include "base/functional/callback_forward.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/test/test_file_util.h"
#include "base/time/default_clock.h"
#include "base/types/pass_key.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/dips/dips_redirect_info.h"
#include "chrome/browser/dips/dips_service_factory.h"
#include "chrome/browser/dips/dips_state.h"
#include "chrome/browser/dips/dips_test_utils.h"
#include "chrome/browser/dips/dips_utils.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_browsing_data_remover_delegate.h"
#include "net/base/schemeful_site.h"
#include "net/cookies/cookie_partition_key.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features_generated.h"
#include "url/gurl.h"
AllOf;
ElementsAre;
IsEmpty;
Pair;
class DIPSServiceTest : public testing::Test { … };
TEST_F(DIPSServiceTest, CreateServiceIfFeatureEnabled) { … }
TEST_F(DIPSServiceTest, DontCreateServiceIfFeatureDisabled) { … }
TEST_F(DIPSServiceTest, NoPrepopulation) { … }
TEST_F(DIPSServiceTest, DeleteDbFilesIfPersistenceDisabled) { … }
TEST_F(DIPSServiceTest, PreserveRegularProfileDbFiles) { … }
TEST_F(DIPSServiceTest, EmptySiteEventsIgnored) { … }
class DIPSServiceStateRemovalTest : public testing::Test { … };
TEST_F(DIPSServiceStateRemovalTest,
CompleteChain_NotifiesRedirectChainObservers) { … }
TEST_F(DIPSServiceStateRemovalTest,
PartialChain_DoesNotNotifyRedirectChainObservers) { … }
TEST_F(DIPSServiceStateRemovalTest, BrowsingDataDeletion_Enabled) { … }
TEST_F(DIPSServiceStateRemovalTest, BrowsingDataDeletion_Disabled) { … }
TEST_F(DIPSServiceStateRemovalTest,
BrowsingDataDeletion_Respects3PExceptionsFor3PC) { … }
TEST_F(DIPSServiceStateRemovalTest,
BrowsingDataDeletion_Respects1PExceptionsFor3PC) { … }
TEST_F(DIPSServiceStateRemovalTest,
BrowsingDataDeletion_RespectsStorageAccessGrantExceptions) { … }
TEST_F(
DIPSServiceStateRemovalTest,
BrowsingDataDeletion_Respects1PExceptionsForBlocking3PCWhenDefaultAllowed) { … }
TEST_F(DIPSServiceStateRemovalTest, ImmediateEnforcement) { … }
class DIPSServiceHistogramTest : public DIPSServiceStateRemovalTest { … };
TEST_F(DIPSServiceHistogramTest, DeletionLatency) { … }
TEST_F(DIPSServiceHistogramTest, Deletion_Disallowed) { … }
TEST_F(DIPSServiceHistogramTest, Deletion_ExceptedAs1P) { … }
TEST_F(DIPSServiceHistogramTest, Deletion_ExceptedAs3P) { … }
TEST_F(DIPSServiceHistogramTest, Deletion_Enforced) { … }
MATCHER_P(HasSourceId, id, "") { … }
MATCHER_P(HasMetrics, matcher, "") { … }
DIPSServiceUkmTest;
TEST_F(DIPSServiceUkmTest, BothChainBeginAndChainEnd) { … }
TEST_F(DIPSServiceUkmTest, InitialAndFinalSitesSame_True) { … }
TEST_F(DIPSServiceUkmTest, DontReportEmptyChainsAtAll) { … }
TEST_F(DIPSServiceUkmTest, DontReportChainBeginIfInvalidSourceId) { … }
TEST_F(DIPSServiceUkmTest, DontReportChainEndIfInvalidSourceId) { … }