#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 {
class FakeSafeBrowsingUIManager
: public safe_browsing::TestSafeBrowsingUIManager { … };
}
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) { … }