chromium/components/affiliations/core/browser/affiliation_database_unittest.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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() {}

}  // namespace

class AffiliationDatabaseTest : public testing::Test {};

TEST_F(AffiliationDatabaseTest, GetAllAffiliationsAndBranding) {}

TEST_F(AffiliationDatabaseTest, GetAffiliationForFacet) {}

TEST_F(AffiliationDatabaseTest, StoreAndRemoveConflicting) {}

// Verify that an existing DB can be reopened, and data is retained.
TEST_F(AffiliationDatabaseTest, DBRetainsDataAfterReopening) {}

// Verify that when it is discovered during opening that a DB is corrupt, it
// gets razed, and then an empty (but again usable) DB is produced.
TEST_F(AffiliationDatabaseTest, CorruptDBIsRazedThenOpened) {}

// Verify that when the DB becomes corrupt after it has been opened, it gets
// poisoned so that operations fail silently without side effects.
TEST_F(AffiliationDatabaseTest, CorruptDBGetsPoisoned) {}

// Verify that all files get deleted.
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 scenario when grouping info are stored for two facets, meaning they are
// grouped but aren't affiliated.
TEST_F(AffiliationDatabaseTest, GetMatchingGroupTwoMatches) {}

// Test scenario when grouping info are stored for unrelated facets.
TEST_F(AffiliationDatabaseTest, GetMatchingGroupNoMatches) {}

}  // namespace affiliations