chromium/components/safe_browsing/core/browser/db/v4_store_unittest.cc

// Copyright 2016 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/safe_browsing/core/browser/db/v4_store.h"

#include "base/base64.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "components/safe_browsing/core/browser/db/v4_store.pb.h"
#include "components/safe_browsing/core/common/features.h"
#include "crypto/sha2.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/platform_test.h"

namespace safe_browsing {

int32;
RepeatedField;
RepeatedPtrField;
Pair;
UnorderedElementsAre;

class V4StoreTest : public PlatformTest {};

TEST_F(V4StoreTest, TestReadFromEmptyFile) {}

TEST_F(V4StoreTest, TestReadFromAbsentFile) {}

TEST_F(V4StoreTest, TestReadFromInvalidContentsFile) {}

TEST_F(V4StoreTest, TestReadFromFileWithUnknownProto) {}

TEST_F(V4StoreTest, TestReadFromUnexpectedMagicFile) {}

TEST_F(V4StoreTest, TestReadFromLowVersionFile) {}

TEST_F(V4StoreTest, TestReadFromNoHashPrefixInfoFile) {}

TEST_F(V4StoreTest, TestReadFromNoHashPrefixesFile) {}

TEST_F(V4StoreTest, TestAddUnlumpedHashesWithInvalidAddition) {}

TEST_F(V4StoreTest, TestAddUnlumpedHashesWithEmptyString) {}

TEST_F(V4StoreTest, TestAddUnlumpedHashes) {}

TEST_F(V4StoreTest, TestGetNextSmallestUnmergedPrefixWithEmptyPrefixMap) {}

TEST_F(V4StoreTest, TestGetNextSmallestUnmergedPrefix) {}

TEST_F(V4StoreTest, TestMergeUpdatesWithSameSizesInEachMap) {}

TEST_F(V4StoreTest, TestMergeUpdatesWithDifferentSizesInEachMap) {}

TEST_F(V4StoreTest, TestMergeUpdatesOldMapRunsOutFirst) {}

TEST_F(V4StoreTest, TestMergeUpdatesAdditionsMapRunsOutFirst) {}

TEST_F(V4StoreTest, TestMergeUpdatesFailsForRepeatedHashPrefix) {}

TEST_F(V4StoreTest, TestMergeUpdatesFailsWhenRemovalsIndexTooLarge) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesOnlyElement) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesFirstElement) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesMiddleElement) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesLastElement) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesWhenOldHasDifferentSizes) {}

TEST_F(V4StoreTest, TestMergeUpdatesRemovesMultipleAcrossDifferentSizes) {}

TEST_F(V4StoreTest, TestReadFullResponseWithValidHashPrefixMap) {}

// This tests fails to read the prefix map from the disk because the file on
// disk is invalid. The hash prefixes string is 6 bytes long, but the prefix
// size is 5 so the parser isn't able to split the hash prefixes list
// completely.
TEST_F(V4StoreTest, TestReadFullResponseWithInvalidHashPrefixMap) {}

TEST_F(V4StoreTest, TestWriteFullResponseWithInvalidHashPrefixMap) {}

TEST_F(V4StoreTest, TestHashPrefixExistsAtTheBeginning) {}

TEST_F(V4StoreTest, TestHashPrefixExistsInTheMiddle) {}

TEST_F(V4StoreTest, TestHashPrefixExistsAtTheEnd) {}

TEST_F(V4StoreTest, TestHashPrefixExistsAtTheBeginningOfEven) {}

TEST_F(V4StoreTest, TestHashPrefixExistsAtTheEndOfEven) {}

TEST_F(V4StoreTest, TestHashPrefixDoesNotExistInConcatenatedList) {}

TEST_F(V4StoreTest, TestFullHashExistsInMapWithSingleSize) {}

TEST_F(V4StoreTest, TestFullHashExistsInMapWithDifferentSizes) {}

TEST_F(V4StoreTest, TestHashPrefixExistsInMapWithSingleSize) {}

TEST_F(V4StoreTest, TestHashPrefixExistsInMapWithDifferentSizes) {}

TEST_F(V4StoreTest, TestHashPrefixDoesNotExistInMapWithDifferentSizes) {}

TEST_F(V4StoreTest, GetMatchingHashPrefixSize32Or21) {}

TEST_F(V4StoreTest, TestAdditionsWithRiceEncodingFailsWithInvalidInput) {}

TEST_F(V4StoreTest, TestAdditionsWithRiceEncodingSucceeds) {}

TEST_F(V4StoreTest, TestRemovalsWithRiceEncodingSucceeds) {}

TEST_F(V4StoreTest, TestMergeUpdatesFailsChecksum) {}

TEST_F(V4StoreTest, TestChecksumErrorOnStartup) {}

TEST_F(V4StoreTest, WriteToDiskFails) {}

TEST_F(V4StoreTest, FullUpdateFailsChecksumSynchronously) {}

TEST_F(V4StoreTest, VerifyChecksumMmapFile) {}

TEST_F(V4StoreTest, FailedMmapOnRead) {}

TEST_F(V4StoreTest, MigrateToMmap) {}

TEST_F(V4StoreTest, MigrateFileOffsets) {}

TEST_F(V4StoreTest, CleanUpOldFiles) {}

TEST_F(V4StoreTest, FileSizeIncludesHashFiles) {}

TEST_F(V4StoreTest, ReserveSpaceInPrefixMap) {}

TEST_F(V4StoreTest, MergeUpdatesWithHashPrefixMap) {}

}  // namespace safe_browsing