BUILD.gn 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Copyright 2021 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/chromeos/ui_mode.gni")
  5. import("//testing/libfuzzer/fuzzer_test.gni")
  6. assert(is_chromeos_ash,
  7. "Quick Pair protocols (e.g. Fast Pair) are ash-chrome only")
  8. source_set("fast_pair_handshake") {
  9. sources = [
  10. "fast_pair_data_encryptor.h",
  11. "fast_pair_data_encryptor_impl.cc",
  12. "fast_pair_data_encryptor_impl.h",
  13. "fast_pair_encryption.cc",
  14. "fast_pair_encryption.h",
  15. "fast_pair_gatt_service_client.h",
  16. "fast_pair_gatt_service_client_impl.cc",
  17. "fast_pair_gatt_service_client_impl.h",
  18. "fast_pair_handshake.cc",
  19. "fast_pair_handshake.h",
  20. "fast_pair_handshake_impl.cc",
  21. "fast_pair_handshake_impl.h",
  22. "fast_pair_handshake_lookup.cc",
  23. "fast_pair_handshake_lookup.h",
  24. "fast_pair_key_pair.cc",
  25. "fast_pair_key_pair.h",
  26. ]
  27. deps = [
  28. "//ash/public/cpp",
  29. "//ash/quick_pair/common",
  30. "//ash/quick_pair/proto:fastpair_proto",
  31. "//ash/quick_pair/repository",
  32. "//ash/services/quick_pair",
  33. "//ash/services/quick_pair/public/cpp",
  34. "//base",
  35. "//crypto:crypto",
  36. "//device/bluetooth",
  37. "//third_party/protobuf:protobuf_lite",
  38. ]
  39. }
  40. static_library("test_support") {
  41. testonly = true
  42. sources = [
  43. "fake_fast_pair_data_encryptor.cc",
  44. "fake_fast_pair_data_encryptor.h",
  45. "fake_fast_pair_gatt_service_client.cc",
  46. "fake_fast_pair_gatt_service_client.h",
  47. "fake_fast_pair_handshake.cc",
  48. "fake_fast_pair_handshake.h",
  49. "fast_pair_data_encryptor.h",
  50. "fast_pair_gatt_service_client.h",
  51. "fast_pair_handshake.h",
  52. "fast_pair_handshake_lookup.h",
  53. ]
  54. deps = [
  55. "//ash/quick_pair/common",
  56. "//ash/services/quick_pair/public/cpp",
  57. "//base",
  58. "//base/test:test_support",
  59. "//device/bluetooth",
  60. "//testing/gtest",
  61. ]
  62. }
  63. source_set("unit_tests") {
  64. testonly = true
  65. sources = [
  66. "fast_pair_data_encryptor_impl_unittest.cc",
  67. "fast_pair_encryption_unittest.cc",
  68. "fast_pair_gatt_service_client_unittest.cc",
  69. "fast_pair_handshake_impl_unittest.cc",
  70. ]
  71. deps = [
  72. ":fast_pair_handshake",
  73. ":test_support",
  74. "//ash/quick_pair/common",
  75. "//ash/quick_pair/repository:test_support",
  76. "//ash/services/quick_pair",
  77. "//ash/services/quick_pair:test_support",
  78. "//ash/services/quick_pair/public/cpp",
  79. "//base",
  80. "//base/test:test_support",
  81. "//device/bluetooth",
  82. "//device/bluetooth:mocks",
  83. "//testing/gtest",
  84. ]
  85. }
  86. fuzzer_test("fast_pair_encryption_fuzzer") {
  87. sources = [ "fast_pair_encryption_fuzzer.cc" ]
  88. deps = [
  89. ":fast_pair_handshake",
  90. "//ash:test_support",
  91. "//ash/quick_pair/common",
  92. "//ash/services/quick_pair",
  93. "//base",
  94. ]
  95. }