chromium/components/facilitated_payments/core/util/BUILD.gn

# Copyright 2024 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//testing/test.gni")

static_library("util") {
  sources = [
    "payment_link_validator.cc",
    "payment_link_validator.h",
    "pix_code_validator.cc",
    "pix_code_validator.h",
  ]

  public_deps = [
    "//components/facilitated_payments/core/mojom:pix_code_validator_mojom",
  ]

  deps = [
    "//base",
    "//third_party/re2",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "payment_link_validator_unittest.cc",
    "pix_code_validator_fuzzer_util_unittest.cc",
    "pix_code_validator_unittest.cc",
  ]

  deps = [
    ":fuzzer_util",
    ":util",
    "//testing/gtest",
    "//third_party/re2",
  ]
}

static_library("fuzzer_util") {
  testonly = true
  sources = [
    "pix_code_validator_fuzzer_util.cc",
    "pix_code_validator_fuzzer_util.h",
  ]
}

test("pix_code_validator_fuzzer") {
  sources = [ "pix_code_validator_fuzzer.cc" ]

  testonly = true
  fuzztests = [ "IsValidPixCodeTest.IsValidPixCodeCanParseAnyString" ]

  deps = [
    ":fuzzer_util",
    ":util",
    "//third_party/fuzztest:fuzztest_gtest_main",
  ]
}