chromium/chrome/common/safe_browsing/binary_feature_extractor_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 "chrome/common/safe_browsing/binary_feature_extractor.h"

#include <stdint.h>
#include <string.h>

#include <cstdint>
#include <memory>
#include <string_view>

#include "base/base_paths.h"
#include "base/containers/heap_array.h"
#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "crypto/sha2.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace safe_browsing {

_;

namespace {

// A mock BinaryFeatureExtractor that mocks only `ExtractImageFeaturesFromData`
// so that we can test `ExtractImageFeatures`.
class MockBinaryFeatureExtractor : public BinaryFeatureExtractor {};

}  // namespace

class BinaryFeatureExtractorTest : public testing::Test {};

TEST_F(BinaryFeatureExtractorTest, ExtractDigestNoFile) {}

// Hash a file that is less than 1 4k block.
TEST_F(BinaryFeatureExtractorTest, ExtractSmallDigest) {}

// Hash a file that is exactly 1 4k block.
TEST_F(BinaryFeatureExtractorTest, ExtractOneBlockDigest) {}

// Hash a file that is larger than 1 4k block.
TEST_F(BinaryFeatureExtractorTest, ExtractBigBlockDigest) {}

TEST_F(BinaryFeatureExtractorTest, CanRemoveFileDuringExecution) {}

}  // namespace safe_browsing