#include "content/browser/browsing_topics/browsing_topics_site_data_storage.h"
#include <functional>
#include <memory>
#include <string_view>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/test/scoped_error_expecter.h"
#include "sql/test/test_helpers.h"
#include "sql/transaction.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
namespace content {
namespace {
int VersionFromMetaTable(sql::Database& db) { … }
}
class BrowsingTopicsSiteDataStorageTest : public testing::Test { … };
TEST_F(BrowsingTopicsSiteDataStorageTest,
DatabaseInitialized_TablesAndIndexesLazilyInitialized) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, LoadFromFile_CurrentVersion_Success) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest,
LoadFromFile_V1NoContextDomainsTable_Success) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, LoadFromFile_VersionTooOld_Failure) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, LoadFromFile_VersionTooNew_Failure) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, OnBrowsingTopicsApiUsed_SingleEntry) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest,
OnBrowsingTopicsApiUsed_MultipleEntries) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, GetBrowsingTopicsApiUsage) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest,
GetContextDomainsFromHashedContextDomains) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, ExpireDataBefore) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest,
ExpireDataBefore_ContextDomainBeforeAndAfterTime) { … }
TEST_F(BrowsingTopicsSiteDataStorageTest, ClearContextDomain) { … }
class BrowsingTopicsSiteDataStorageMaxEntriesToLoadTest
: public BrowsingTopicsSiteDataStorageTest { … };
TEST_F(BrowsingTopicsSiteDataStorageMaxEntriesToLoadTest, MaxEntriesToLoad) { … }
}