#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#include <limits>
#include <string>
#include <tuple>
#include <utility>
#include "base/files/file_path.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "components/crash/core/common/crash_buildflags.h"
#include "components/crash/core/common/crash_key.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace safe_browsing {
namespace {
constexpr BinaryUploadService::Result kAllBinaryUploadServiceResults[]{ … };
#if !BUILDFLAG(USE_CRASH_KEY_STUBS)
constexpr std::pair<ScanningCrashKey, const char*> kAllCrashKeys[] = …;
#endif
constexpr int64_t kTotalBytes = …;
constexpr base::TimeDelta kDuration = …;
constexpr base::TimeDelta kInvalidDuration = …;
}
class DeepScanningUtilsUMATest
: public testing::TestWithParam<
std::tuple<bool, DeepScanAccessPoint, BinaryUploadService::Result>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(DeepScanningUtilsUMATest, SuccessfulScanVerdicts) { … }
TEST_P(DeepScanningUtilsUMATest, UnsuccessfulDlpScanVerdicts) { … }
TEST_P(DeepScanningUtilsUMATest, UnsuccessfulMalwareScanVerdict) { … }
TEST_P(DeepScanningUtilsUMATest, BypassScanVerdict) { … }
TEST_P(DeepScanningUtilsUMATest, CancelledByUser) { … }
TEST_P(DeepScanningUtilsUMATest, InvalidDuration) { … }
#if !BUILDFLAG(USE_CRASH_KEY_STUBS)
class DeepScanningUtilsCrashKeysTest
: public testing::TestWithParam<std::pair<ScanningCrashKey, const char*>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(DeepScanningUtilsCrashKeysTest, SmallModifications) { … }
TEST_P(DeepScanningUtilsCrashKeysTest, LargeModifications) { … }
TEST_P(DeepScanningUtilsCrashKeysTest, InvalidModifications) { … }
#endif
}