BUILD.gn 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. # Copyright 2019 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("//ios/build/config.gni")
  5. import("//ios/web/public/js_messaging/optimize_js.gni")
  6. source_set("js_messaging") {
  7. configs += [ "//build/config/compiler:enable_arc" ]
  8. deps = [
  9. ":frame_listeners_js",
  10. ":java_script_content_world_header",
  11. ":java_script_feature_manager_header",
  12. ":scoped_wk_script_message_handler",
  13. ":setup_frame_js",
  14. ":web_frames_manager_impl_header",
  15. "//base",
  16. "//ios/web/common:features",
  17. "//ios/web/navigation:wk_navigation_util",
  18. "//ios/web/public",
  19. "//ios/web/public/deprecated",
  20. "//ios/web/public/js_messaging",
  21. "//ios/web/web_state:web_state_impl_header",
  22. "//ios/web/web_state/ui:web_controller_header",
  23. "//ios/web/web_view:util",
  24. "//url",
  25. ]
  26. sources = [
  27. "crw_js_window_id_manager.h",
  28. "crw_js_window_id_manager.mm",
  29. "page_script_util.h",
  30. "page_script_util.mm",
  31. "script_command_java_script_feature.h",
  32. "script_command_java_script_feature.mm",
  33. "web_frame_impl.h",
  34. "web_frame_impl.mm",
  35. "web_frame_internal.h",
  36. "web_frame_util.mm",
  37. "web_frames_manager_impl.mm",
  38. "web_frames_manager_java_script_feature.h",
  39. "web_frames_manager_java_script_feature.mm",
  40. "web_view_js_utils.h",
  41. "web_view_js_utils.mm",
  42. "web_view_web_state_map.h",
  43. "web_view_web_state_map.mm",
  44. ]
  45. }
  46. source_set("web_frames_manager_impl_header") {
  47. configs += [ "//build/config/compiler:enable_arc" ]
  48. deps = [
  49. "//base",
  50. "//ios/web/public/js_messaging",
  51. ]
  52. sources = [ "web_frames_manager_impl.h" ]
  53. }
  54. source_set("java_script_feature") {
  55. configs += [ "//build/config/compiler:enable_arc" ]
  56. public_deps = [
  57. ":java_script_content_world_header",
  58. ":java_script_feature_manager_header",
  59. ]
  60. deps = [
  61. ":js_messaging",
  62. ":scoped_wk_script_message_handler",
  63. "//base",
  64. "//ios/web/public",
  65. "//ios/web/public/js_messaging",
  66. "//ios/web/web_state:web_state_impl_header",
  67. "//ios/web/web_state/ui:web_controller_header",
  68. "//ios/web/web_state/ui:wk_web_view_configuration_provider_header",
  69. ]
  70. sources = [
  71. "java_script_content_world.mm",
  72. "java_script_feature.mm",
  73. "java_script_feature_manager.mm",
  74. "script_message.mm",
  75. ]
  76. }
  77. source_set("java_script_content_world_header") {
  78. configs += [ "//build/config/compiler:enable_arc" ]
  79. deps = [
  80. ":scoped_wk_script_message_handler",
  81. "//base",
  82. "//ios/web/public/js_messaging",
  83. ]
  84. sources = [ "java_script_content_world.h" ]
  85. }
  86. source_set("java_script_feature_manager_header") {
  87. configs += [ "//build/config/compiler:enable_arc" ]
  88. deps = [
  89. ":java_script_content_world_header",
  90. "//base",
  91. ]
  92. sources = [ "java_script_feature_manager.h" ]
  93. }
  94. source_set("java_script_feature_util") {
  95. configs += [ "//build/config/compiler:enable_arc" ]
  96. deps = [
  97. ":js_messaging",
  98. "//base",
  99. "//ios/web/favicon",
  100. "//ios/web/find_in_page",
  101. "//ios/web/js_features/context_menu",
  102. "//ios/web/js_features/scroll_helper",
  103. "//ios/web/js_features/window_error",
  104. "//ios/web/navigation:navigation_feature",
  105. "//ios/web/navigation:session_restore_feature",
  106. "//ios/web/public",
  107. "//ios/web/public/js_messaging",
  108. "//ios/web/text_fragments",
  109. ]
  110. sources = [
  111. "java_script_feature_util_impl.h",
  112. "java_script_feature_util_impl.mm",
  113. ]
  114. }
  115. source_set("scoped_wk_script_message_handler") {
  116. configs += [ "//build/config/compiler:enable_arc" ]
  117. deps = [ "//base" ]
  118. sources = [
  119. "scoped_wk_script_message_handler.h",
  120. "scoped_wk_script_message_handler.mm",
  121. ]
  122. }
  123. optimize_js("setup_frame_js") {
  124. visibility = [ ":js_messaging" ]
  125. primary_script = "resources/setup_frame.js"
  126. sources = [ "resources/setup_frame.js" ]
  127. }
  128. optimize_js("frame_listeners_js") {
  129. visibility = [ ":js_messaging" ]
  130. primary_script = "resources/frame_listeners.js"
  131. sources = [ "resources/frame_listeners.js" ]
  132. }
  133. source_set("unittests") {
  134. configs += [ "//build/config/compiler:enable_arc" ]
  135. testonly = true
  136. deps = [
  137. ":java_script_feature",
  138. ":java_script_feature_util",
  139. ":js_messaging",
  140. ":scoped_wk_script_message_handler",
  141. ":web_frames_manager_impl_header",
  142. "//base",
  143. "//base/test:test_support",
  144. "//ios/web/common:web_view_creation_util",
  145. "//ios/web/public/js_messaging",
  146. "//ios/web/public/test",
  147. "//ios/web/public/test:test_fixture",
  148. "//ios/web/public/test/fakes",
  149. "//ios/web/test:js_test_util_internal",
  150. "//ios/web/test/fakes",
  151. "//ios/web/web_state:web_state_impl_header",
  152. "//ios/web/web_state/ui:web_controller_header",
  153. "//ios/web/web_state/ui:wk_web_view_configuration_provider",
  154. "//testing/gtest",
  155. "//third_party/ocmock",
  156. ]
  157. sources = [
  158. "crw_js_window_id_manager_unittest.mm",
  159. "java_script_content_world_unittest.mm",
  160. "java_script_feature_manager_unittest.mm",
  161. "java_script_feature_unittest.mm",
  162. "page_script_util_unittest.mm",
  163. "scoped_wk_script_message_handler_unittest.mm",
  164. "web_frame_impl_unittest.mm",
  165. "web_frame_util_unittest.mm",
  166. "web_frames_manager_impl_unittest.mm",
  167. "web_frames_manager_java_script_feature_unittest.mm",
  168. "web_view_js_utils_unittest.mm",
  169. "web_view_web_state_map_unittest.mm",
  170. ]
  171. }
  172. source_set("inttests") {
  173. configs += [ "//build/config/compiler:enable_arc" ]
  174. testonly = true
  175. deps = [
  176. ":java_script_content_world_header",
  177. ":java_script_feature",
  178. ":js_messaging",
  179. "//base",
  180. "//base/test:test_support",
  181. "//ios/testing:embedded_test_server_support",
  182. "//ios/web/common",
  183. "//ios/web/js_messaging:java_script_feature",
  184. "//ios/web/public",
  185. "//ios/web/public/js_messaging",
  186. "//ios/web/public/test",
  187. "//ios/web/public/test:test_fixture",
  188. "//ios/web/public/test:util",
  189. "//ios/web/public/test/fakes",
  190. "//ios/web/test:js_test_util_internal",
  191. "//ios/web/test:test_support",
  192. "//ios/web/test/fakes",
  193. "//ios/web/web_state/ui:web_controller_header",
  194. "//ios/web/web_state/ui:wk_web_view_configuration_provider_header",
  195. "//net:test_support",
  196. "//testing/gmock",
  197. "//testing/gtest",
  198. "//third_party/ocmock",
  199. ]
  200. sources = [
  201. "java_script_feature_inttest.mm",
  202. "java_script_feature_manager_inttest.mm",
  203. "web_frame_impl_inttest.mm",
  204. "web_frame_web_state_observer_inttest.mm",
  205. "web_frames_manager_inttest.mm",
  206. ]
  207. }