chromium/chrome/browser/tpcd/support/validity_service_browsertest.cc

// Copyright 2024 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/support/validity_service.h"

#include "base/strings/strcat.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tpcd/support/top_level_trial_service.h"
#include "chrome/browser/tpcd/support/top_level_trial_service_factory.h"
#include "chrome/browser/tpcd/support/tpcd_support_service.h"
#include "chrome/browser/tpcd/support/tpcd_support_service_factory.h"
#include "chrome/browser/tpcd/support/trial_test_utils.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/content_settings/core/browser/content_settings_observer.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/content_settings_types.h"
#include "components/content_settings/core/common/features.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/network_session_configurator/common/network_switches.h"
#include "components/prefs/pref_service.h"
#include "components/privacy_sandbox/tracking_protection_prefs.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/url_loader_interceptor.h"
#include "net/base/features.h"
#include "net/cookies/cookie_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"

URLLoaderInterceptor;
WebContents;

namespace tpcd::trial {

class ValidityServiceBrowserTestBase : public PlatformBrowserTest {};

class ValidityService3pTrialBrowserTest
    : public ValidityServiceBrowserTestBase {};

IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest,
                       RemovesInvalidSettingOnJsCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest,
                       RemoveInvalidSubdomainMatchingSettingOnJsCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest,
                       RemoveInvalidSettingOnNavigationCookieAccess) {}

IN_PROC_BROWSER_TEST_F(
    ValidityService3pTrialBrowserTest,
    RemoveInvalidSubdomainMatchingSettingOnNavigationCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest,
                       RemoveAllSettingsCreatedUsingAffectedToken) {}

IN_PROC_BROWSER_TEST_F(
    ValidityService3pTrialBrowserTest,
    RemoveAllSettingsCreatedUsingAffectedSubdomainMatchingToken) {}

IN_PROC_BROWSER_TEST_F(ValidityService3pTrialBrowserTest,
                       PreserveValidSettings) {}

class ValidityService1pTrialBrowserTest
    : public ValidityServiceBrowserTestBase {};

IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest,
                       RemovesInvalidSettingOnJsCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest,
                       RemoveInvalidSettingOnNavigationCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest,
                       RemoveInvalidSubdomainMatchingSettingOnCookieAccess) {}

IN_PROC_BROWSER_TEST_F(ValidityService1pTrialBrowserTest,
                       PreserveValidSettings) {}
}  // namespace tpcd::trial