chromium/components/safe_browsing/core/browser/db/v4_get_hash_protocol_manager_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_get_hash_protocol_manager.h"

#include <memory>
#include <vector>

#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/safe_browsing/core/browser/db/safebrowsing.pb.h"
#include "components/safe_browsing/core/browser/db/util.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 "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/platform_test.h"

Time;

namespace safe_browsing {

class V4GetHashProtocolManagerTest : public PlatformTest {};

TEST_F(V4GetHashProtocolManagerTest, TestGetHashErrorHandlingNetwork) {}

TEST_F(V4GetHashProtocolManagerTest, TestGetHashErrorHandlingResponseCode) {}

TEST_F(V4GetHashProtocolManagerTest, TestBackoffErrorHistogramCount) {}

TEST_F(V4GetHashProtocolManagerTest, TestGetHashErrorHandlingParallelRequests) {}

TEST_F(V4GetHashProtocolManagerTest, TestGetHashErrorHandlingOK) {}

TEST_F(V4GetHashProtocolManagerTest,
       TestResultsNotCachedForNegativeCacheDuration) {}

TEST_F(V4GetHashProtocolManagerTest, TestGetHashRequest) {}

TEST_F(V4GetHashProtocolManagerTest, TestParseHashResponse) {}

// Adds an entry with an ignored ThreatEntryType.
TEST_F(V4GetHashProtocolManagerTest,
       TestParseHashResponseWrongThreatEntryType) {}

// Adds entries with a ThreatPatternType metadata.
TEST_F(V4GetHashProtocolManagerTest, TestParseHashThreatPatternType) {}

TEST_F(V4GetHashProtocolManagerTest, TestParseSubresourceFilterMetadata) {}

// Adds metadata with a key value that is not "permission".
TEST_F(V4GetHashProtocolManagerTest,
       TestParseHashResponseNonPermissionMetadata) {}

TEST_F(V4GetHashProtocolManagerTest,
       TestParseHashResponseInconsistentThreatTypes) {}

// Checks that results are looked up correctly in the cache.
TEST_F(V4GetHashProtocolManagerTest, GetCachedResults) {}

TEST_F(V4GetHashProtocolManagerTest, TestUpdatesAreMerged) {}

// The server responds back with full hash information containing metadata
// information for one of the full hashes for the URL in test.
TEST_F(V4GetHashProtocolManagerTest, TestGetFullHashesWithApisMergesMetadata) {}

}  // namespace safe_browsing