#include "content/browser/browsing_data/clear_site_data_handler.h"
#include <memory>
#include <optional>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "content/public/browser/storage_partition_config.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "net/base/load_flags.h"
#include "net/cookies/cookie_partition_key.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features_generated.h"
_;
namespace content {
ConsoleMessagesDelegate;
Message;
namespace {
const char kClearCookiesHeader[] = …;
const StoragePartitionConfig kTestStoragePartitionConfig;
class TestHandler : public ClearSiteDataHandler { … };
class VectorConsoleMessagesDelegate : public ConsoleMessagesDelegate { … };
class StringConsoleMessagesDelegate : public ConsoleMessagesDelegate { … };
}
class ClearSiteDataHandlerTest : public testing::Test,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ClearSiteDataHandlerTest, ParseHeaderAndExecuteClearingTask) { … }
TEST_F(ClearSiteDataHandlerTest, InvalidHeader) { … }
TEST_F(ClearSiteDataHandlerTest, ClearCookieSuccess) { … }
TEST_F(ClearSiteDataHandlerTest, LoadDoNotSaveCookies) { … }
TEST_F(ClearSiteDataHandlerTest, InvalidOrigin) { … }
TEST_F(ClearSiteDataHandlerTest, FormattedConsoleOutput) { … }
TEST_F(ClearSiteDataHandlerTest, CookiePartitionKey) { … }
TEST_F(ClearSiteDataHandlerTest, StorageKey) { … }
TEST_F(ClearSiteDataHandlerTest, ThirdPartyCookieBlockingEnabled) { … }
TEST_F(ClearSiteDataHandlerTest, CorrectStoragePartition) { … }
}