#include "components/affiliations/core/browser/affiliation_database.h"
#include <stdint.h>
#include <memory>
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/test/metrics/histogram_tester.h"
#include "components/affiliations/core/browser/affiliation_utils.h"
#include "sql/sqlite_result_code_values.h"
#include "sql/test/scoped_error_expecter.h"
#include "sql/test/test_helpers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace affiliations {
namespace {
const char kTestFacetURI1[] = …;
const char kTestFacetURI2[] = …;
const char kTestFacetURI3[] = …;
const char kTestFacetURI4[] = …;
const char kTestFacetURI5[] = …;
const char kTestFacetURI6[] = …;
const char kTestFacetURI7[] = …;
const char kTestWebsiteName[] = …;
const char kTestMainDomain[] = …;
const char kTestAndroidFacetURI[] = …;
const char kTestAndroidPlayName[] = …;
const char kTestAndroidIconURL[] = …;
const int64_t kTestTimeUs1 = …;
const int64_t kTestTimeUs2 = …;
const int64_t kTestTimeUs3 = …;
void ExpectEquivalenceClassesIncludingBrandingInfoAreEqual(
const AffiliatedFacetsWithUpdateTime& expectation,
const AffiliatedFacetsWithUpdateTime& reality) { … }
AffiliatedFacetsWithUpdateTime TestEquivalenceClass1() { … }
AffiliatedFacetsWithUpdateTime TestEquivalenceClass2() { … }
AffiliatedFacetsWithUpdateTime TestEquivalenceClass3() { … }
}
class AffiliationDatabaseTest : public testing::Test { … };
TEST_F(AffiliationDatabaseTest, GetAllAffiliationsAndBranding) { … }
TEST_F(AffiliationDatabaseTest, GetAffiliationForFacet) { … }
TEST_F(AffiliationDatabaseTest, StoreAndRemoveConflicting) { … }
TEST_F(AffiliationDatabaseTest, DBRetainsDataAfterReopening) { … }
TEST_F(AffiliationDatabaseTest, CorruptDBIsRazedThenOpened) { … }
TEST_F(AffiliationDatabaseTest, CorruptDBGetsPoisoned) { … }
TEST_F(AffiliationDatabaseTest, Delete) { … }
TEST_F(AffiliationDatabaseTest, MigrateFromVersion1) { … }
TEST_F(AffiliationDatabaseTest, InitializeFromVersion2) { … }
TEST_F(AffiliationDatabaseTest, InitializeFromVersion3) { … }
TEST_F(AffiliationDatabaseTest, InitializeFromVersion4) { … }
TEST_F(AffiliationDatabaseTest, InitializeFromVersion5) { … }
TEST_F(AffiliationDatabaseTest, ClearUnusedCache) { … }
TEST_F(AffiliationDatabaseTest, StoreAndRemoveConflictingUpdatesGrouping) { … }
TEST_F(AffiliationDatabaseTest, GetMatchingGroupOneMatch) { … }
TEST_F(AffiliationDatabaseTest, GetMatchingGroupTwoMatches) { … }
TEST_F(AffiliationDatabaseTest, GetMatchingGroupNoMatches) { … }
}