BUILD.gn 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. static_library("custom_handlers") {
  5. sources = [
  6. "pref_names.cc",
  7. "pref_names.h",
  8. "protocol_handler.cc",
  9. "protocol_handler.h",
  10. "protocol_handler_registry.cc",
  11. "protocol_handler_registry.h",
  12. "protocol_handler_throttle.cc",
  13. "protocol_handler_throttle.h",
  14. ]
  15. deps = [
  16. "//build:chromeos_buildflags",
  17. "//components/keyed_service/content",
  18. "//components/keyed_service/core",
  19. "//components/pref_registry",
  20. "//components/prefs",
  21. "//components/strings",
  22. "//components/user_prefs",
  23. "//content/public/browser",
  24. "//content/public/common",
  25. "//net",
  26. "//services/network/public/cpp:cpp_base",
  27. "//third_party/blink/public/common:headers",
  28. ]
  29. if (!is_android) {
  30. sources += [
  31. "register_protocol_handler_permission_request.cc",
  32. "register_protocol_handler_permission_request.h",
  33. ]
  34. deps += [
  35. "//components/permissions",
  36. "//ui/base",
  37. ]
  38. }
  39. }
  40. source_set("test_support") {
  41. testonly = true
  42. sources = [
  43. "simple_protocol_handler_registry_factory.cc",
  44. "simple_protocol_handler_registry_factory.h",
  45. "test_protocol_handler_registry_delegate.cc",
  46. "test_protocol_handler_registry_delegate.h",
  47. ]
  48. deps = [
  49. ":custom_handlers",
  50. "//base",
  51. "//components/keyed_service/content",
  52. ]
  53. }
  54. source_set("unit_tests") {
  55. testonly = true
  56. sources = [ "protocol_handler_registry_unittest.cc" ]
  57. deps = [
  58. ":custom_handlers",
  59. ":test_support",
  60. "//base/test:test_support",
  61. "//components/pref_registry",
  62. "//components/sync_preferences",
  63. "//components/sync_preferences:test_support",
  64. "//components/user_prefs",
  65. "//content/public/browser",
  66. "//content/public/common",
  67. "//content/test:test_support",
  68. "//testing/gmock",
  69. "//testing/gtest",
  70. "//third_party/blink/public/common:headers",
  71. ]
  72. }
  73. source_set("browser_tests") {
  74. testonly = true
  75. defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
  76. sources = [ "protocol_handler_registry_browsertest.cc" ]
  77. deps = [
  78. ":custom_handlers",
  79. ":test_support",
  80. "//base/test:test_support",
  81. "//components/keyed_service/content",
  82. "//content/shell:content_shell_lib",
  83. "//content/test:browsertest_support",
  84. "//content/test:test_support",
  85. "//net:test_support",
  86. "//testing/gmock",
  87. "//testing/gtest",
  88. ]
  89. }