BUILD.gn 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # Copyright 2016 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/buildflag_header.gni")
  5. _inspector_protocol = "//third_party/inspector_protocol"
  6. import("$_inspector_protocol/inspector_protocol.gni")
  7. _protocol_generated = [
  8. "css.cc",
  9. "css.h",
  10. "dom.cc",
  11. "dom.h",
  12. "forward.h",
  13. "overlay.cc",
  14. "overlay.h",
  15. "page.cc",
  16. "page.h",
  17. "protocol.h",
  18. "tracing.h",
  19. "tracing.cc",
  20. ]
  21. action("protocol_compatibility") {
  22. visibility = [ ":*" ] # Only targets in this file can depend on this.
  23. script = "$_inspector_protocol/check_protocol_compatibility.py"
  24. inputs = [ "protocol.json" ]
  25. _stamp = "$target_gen_dir/protocol.stamp"
  26. outputs = [ _stamp ]
  27. args = [
  28. "--stamp",
  29. rebase_path(_stamp, root_build_dir),
  30. rebase_path("protocol.json", root_build_dir),
  31. ]
  32. }
  33. inspector_protocol_generate("protocol_generated_sources") {
  34. inspector_protocol_dir = _inspector_protocol
  35. visibility = [ ":*" ] # Only targets in this file can depend on this.
  36. deps = [ ":protocol_compatibility" ]
  37. out_dir = target_gen_dir
  38. config_file = "inspector_protocol_config.json"
  39. inputs = [
  40. "protocol.json",
  41. "inspector_protocol_config.json",
  42. ]
  43. use_embedder_types = true
  44. outputs = _protocol_generated
  45. }
  46. component("ui_devtools") {
  47. sources = rebase_path(_protocol_generated, ".", target_gen_dir)
  48. sources += [
  49. "agent_util.cc",
  50. "agent_util.h",
  51. "connector_delegate.h",
  52. "css_agent.cc",
  53. "css_agent.h",
  54. "devtools_base_agent.h",
  55. "devtools_client.cc",
  56. "devtools_client.h",
  57. "devtools_export.h",
  58. "devtools_server.cc",
  59. "devtools_server.h",
  60. "dom_agent.cc",
  61. "dom_agent.h",
  62. "overlay_agent.cc",
  63. "overlay_agent.h",
  64. "page_agent.cc",
  65. "page_agent.h",
  66. "root_element.cc",
  67. "root_element.h",
  68. "switches.cc",
  69. "switches.h",
  70. "tracing_agent.cc",
  71. "tracing_agent.h",
  72. "ui_element.cc",
  73. "ui_element.h",
  74. "ui_element_delegate.h",
  75. ]
  76. defines = [ "UI_DEVTOOLS_IMPLEMENTATION" ]
  77. deps = [
  78. ":features",
  79. ":protocol_generated_sources",
  80. "//base",
  81. "//mojo/public/cpp/bindings",
  82. "//mojo/public/cpp/system",
  83. "//net",
  84. "//third_party/inspector_protocol:crdtp",
  85. "//ui/base:base",
  86. "//ui/gfx",
  87. ]
  88. public_deps = [
  89. "//services/network/public/cpp",
  90. "//services/network/public/mojom",
  91. "//services/service_manager/public/cpp",
  92. "//services/tracing/public/cpp",
  93. "//services/tracing/public/mojom",
  94. ]
  95. }
  96. component("features") {
  97. output_name = "ui_devtools_features"
  98. defines = [ "IS_UI_DEVTOOLS_FEATURES_IMPL" ]
  99. sources = [
  100. "ui_devtools_features.cc",
  101. "ui_devtools_features.h",
  102. ]
  103. deps = [ "//base" ]
  104. }
  105. static_library("test_support") {
  106. testonly = true
  107. sources = [
  108. "ui_devtools_unittest_utils.cc",
  109. "ui_devtools_unittest_utils.h",
  110. ]
  111. public_deps = [
  112. ":ui_devtools",
  113. "//testing/gmock",
  114. "//third_party/inspector_protocol:crdtp",
  115. ]
  116. }
  117. source_set("unit_tests") {
  118. testonly = true
  119. cflags = []
  120. if (is_win) {
  121. cflags += [ "/wd4800" ] # Value forced to bool.
  122. }
  123. sources = [
  124. "css_agent_unittest.cc",
  125. "devtools_server_unittest.cc",
  126. ]
  127. data = [ "//components/test/data/ui_devtools/test_file.cc" ]
  128. deps = [
  129. ":test_support",
  130. "//base/test:test_support",
  131. "//net:test_support",
  132. "//services/network:network_service",
  133. "//services/network:test_support",
  134. "//testing/gtest",
  135. ]
  136. configs += [ "//build/config:precompiled_headers" ]
  137. }