#include "chrome/browser/permissions/crowd_deny_preload_data.h"
#include <string_view>
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/numerics/safe_conversions.h"
#include "base/test/task_environment.h"
#include "base/version.h"
#include "chrome/browser/permissions/crowd_deny.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace {
constexpr char kTestDomainAlpha[] = …;
constexpr char kTestDomainBeta[] = …;
constexpr char kTestDomainGamma[] = …;
constexpr char kTestDomainDelta[] = …;
constexpr char kTestSubdomainOfDelta1[] = …;
constexpr char kTestDomainEpsilon[] = …;
constexpr char kTestOriginAlpha[] = …;
constexpr char kTestOriginSubdomainOfAlpha[] = …;
constexpr char kTestOriginBeta[] = …;
constexpr char kTestOriginGamma[] = …;
constexpr char kTestOriginDelta[] = …;
constexpr char kTestOriginSubdomainOfDelta1[] = …;
constexpr char kTestOriginSubdomainOfDelta2[] = …;
constexpr char kTestOriginNotSubdomainOfDelta[] = …;
constexpr char kTestOriginEpsilon[] = …;
constexpr char kTestOriginZeta[] = …;
constexpr const char* kAllTestingOrigins[] = …;
}
class CrowdDenyPreloadDataTest : public testing::Test { … };
TEST_F(CrowdDenyPreloadDataTest, NoData) { … }
TEST_F(CrowdDenyPreloadDataTest, MissingFile) { … }
TEST_F(CrowdDenyPreloadDataTest, EmptyData) { … }
TEST_F(CrowdDenyPreloadDataTest, BadData) { … }
TEST_F(CrowdDenyPreloadDataTest, DataIntegrityAndDefaults) { … }
TEST_F(CrowdDenyPreloadDataTest, GetReputationReturnsNullForNonHttpsOrigins) { … }
TEST_F(CrowdDenyPreloadDataTest, GetReputationIgnoresPort) { … }
TEST_F(CrowdDenyPreloadDataTest, GetReputationWithSubdomainMatching) { … }
TEST_F(CrowdDenyPreloadDataTest, SubdomainSpecificOverride) { … }
TEST_F(CrowdDenyPreloadDataTest, Update) { … }
TEST_F(CrowdDenyPreloadDataTest, UpdateToMissingFileWipesInMemoryState) { … }
TEST_F(CrowdDenyPreloadDataTest, UpdateToEmptyFileWipesInMemoryState) { … }
TEST_F(CrowdDenyPreloadDataTest, UpdateToBadFileWipesInMemoryState) { … }
TEST_F(CrowdDenyPreloadDataTest, LastOneSurvivesFromUpdatesInQuickSuccession) { … }