chromium/chrome/browser/safe_browsing/test_safe_browsing_database_helper.cc

// Copyright 2017 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/browser/safe_browsing/test_safe_browsing_database_helper.h"

#include <utility>

#include "base/containers/contains.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/safe_browsing/test_safe_browsing_service.h"
#include "components/safe_browsing/core/browser/db/v4_database.h"
#include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/core/browser/db/v4_test_util.h"
#include "components/security_interstitials/core/unsafe_resource.h"
#include "content/public/test/test_utils.h"

namespace {

// UI manager that never actually shows any interstitials, but emulates as if
// the user chose to proceed through them.
class FakeSafeBrowsingUIManager
    : public safe_browsing::TestSafeBrowsingUIManager {};

}  // namespace

// This class automatically inserts lists into the store map when initializing
// the test database.
class InsertingDatabaseFactory : public safe_browsing::TestV4DatabaseFactory {};

TestSafeBrowsingDatabaseHelper::TestSafeBrowsingDatabaseHelper()
    :{}

TestSafeBrowsingDatabaseHelper::TestSafeBrowsingDatabaseHelper(
    std::unique_ptr<safe_browsing::TestV4GetHashProtocolManagerFactory>
        v4_get_hash_factory,
    std::vector<safe_browsing::ListIdentifier> lists_to_insert)
    :{}

TestSafeBrowsingDatabaseHelper::~TestSafeBrowsingDatabaseHelper() {}

void TestSafeBrowsingDatabaseHelper::AddFullHashToDbAndFullHashCache(
    const GURL& bad_url,
    const safe_browsing::ListIdentifier& list_id,
    const safe_browsing::ThreatMetadata& threat_metadata) {}

void TestSafeBrowsingDatabaseHelper::LocallyMarkPrefixAsBad(
    const GURL& url,
    const safe_browsing::ListIdentifier& list_id) {}

bool TestSafeBrowsingDatabaseHelper::HasListSynced(
    const safe_browsing::ListIdentifier& list_id) {}