summaryrefslogtreecommitdiff
path: root/chromium/ios/web/js_messaging/BUILD.gn
blob: c23465144a8aeb1662855301afce4347f94f6ac8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//ios/build/config.gni")
import("//ios/web/public/js_messaging/optimize_js.gni")

source_set("js_messaging") {
  configs += [ "//build/config/compiler:enable_arc" ]
  deps = [
    ":frame_listeners_js",
    ":java_script_content_world_header",
    ":java_script_feature_manager_header",
    ":scoped_wk_script_message_handler",
    ":setup_frame_js",
    ":web_frames_manager_impl_header",
    "//base",
    "//ios/web/common:features",
    "//ios/web/navigation:wk_navigation_util",
    "//ios/web/public",
    "//ios/web/public/deprecated",
    "//ios/web/public/js_messaging",
    "//ios/web/web_state:web_state_impl_header",
    "//ios/web/web_state/ui:web_controller_header",
    "//ios/web/web_view:util",
    "//url",
  ]

  sources = [
    "crw_js_window_id_manager.h",
    "crw_js_window_id_manager.mm",
    "page_script_util.h",
    "page_script_util.mm",
    "script_command_java_script_feature.h",
    "script_command_java_script_feature.mm",
    "web_frame_impl.h",
    "web_frame_impl.mm",
    "web_frame_internal.h",
    "web_frame_util.mm",
    "web_frames_manager_impl.mm",
    "web_frames_manager_java_script_feature.h",
    "web_frames_manager_java_script_feature.mm",
    "web_view_js_utils.h",
    "web_view_js_utils.mm",
    "web_view_web_state_map.h",
    "web_view_web_state_map.mm",
  ]
}

source_set("web_frames_manager_impl_header") {
  configs += [ "//build/config/compiler:enable_arc" ]
  deps = [
    "//base",
    "//ios/web/public/js_messaging",
  ]
  sources = [ "web_frames_manager_impl.h" ]
}

source_set("java_script_feature") {
  configs += [ "//build/config/compiler:enable_arc" ]
  public_deps = [
    ":java_script_content_world_header",
    ":java_script_feature_manager_header",
  ]
  deps = [
    ":js_messaging",
    ":scoped_wk_script_message_handler",
    "//base",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
    "//ios/web/web_state:web_state_impl_header",
    "//ios/web/web_state/ui:web_controller_header",
    "//ios/web/web_state/ui:wk_web_view_configuration_provider_header",
  ]

  sources = [
    "java_script_content_world.mm",
    "java_script_feature.mm",
    "java_script_feature_manager.mm",
    "script_message.mm",
  ]
}

source_set("java_script_content_world_header") {
  configs += [ "//build/config/compiler:enable_arc" ]

  deps = [
    ":scoped_wk_script_message_handler",
    "//base",
    "//ios/web/public/js_messaging",
  ]

  sources = [ "java_script_content_world.h" ]
}

source_set("java_script_feature_manager_header") {
  configs += [ "//build/config/compiler:enable_arc" ]

  deps = [
    ":java_script_content_world_header",
    "//base",
  ]

  sources = [ "java_script_feature_manager.h" ]
}

source_set("java_script_feature_util") {
  configs += [ "//build/config/compiler:enable_arc" ]

  deps = [
    ":js_messaging",
    "//base",
    "//ios/web/annotations",
    "//ios/web/common:features",
    "//ios/web/favicon",
    "//ios/web/find_in_page",
    "//ios/web/js_features/context_menu",
    "//ios/web/js_features/scroll_helper",
    "//ios/web/js_features/window_error",
    "//ios/web/navigation:navigation_feature",
    "//ios/web/navigation:session_restore_feature",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
    "//ios/web/text_fragments",
  ]

  sources = [
    "java_script_feature_util_impl.h",
    "java_script_feature_util_impl.mm",
  ]
}

source_set("scoped_wk_script_message_handler") {
  configs += [ "//build/config/compiler:enable_arc" ]

  deps = [ "//base" ]

  sources = [
    "scoped_wk_script_message_handler.h",
    "scoped_wk_script_message_handler.mm",
  ]
}

optimize_js("setup_frame_js") {
  visibility = [ ":js_messaging" ]

  primary_script = "resources/setup_frame.js"
  sources = [ "resources/setup_frame.js" ]
}

optimize_js("frame_listeners_js") {
  visibility = [ ":js_messaging" ]

  primary_script = "resources/frame_listeners.js"
  sources = [ "resources/frame_listeners.js" ]
}

source_set("unittests") {
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true
  deps = [
    ":java_script_feature",
    ":java_script_feature_util",
    ":js_messaging",
    ":scoped_wk_script_message_handler",
    ":web_frames_manager_impl_header",
    "//base",
    "//base/test:test_support",
    "//ios/web/common:web_view_creation_util",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test",
    "//ios/web/public/test:test_fixture",
    "//ios/web/public/test/fakes",
    "//ios/web/test:js_test_util_internal",
    "//ios/web/test/fakes",
    "//ios/web/web_state:web_state_impl_header",
    "//ios/web/web_state/ui:web_controller_header",
    "//ios/web/web_state/ui:wk_web_view_configuration_provider",
    "//testing/gtest",
    "//third_party/ocmock",
  ]

  sources = [
    "crw_js_window_id_manager_unittest.mm",
    "java_script_content_world_unittest.mm",
    "java_script_feature_manager_unittest.mm",
    "java_script_feature_unittest.mm",
    "page_script_util_unittest.mm",
    "scoped_wk_script_message_handler_unittest.mm",
    "web_frame_impl_unittest.mm",
    "web_frame_util_unittest.mm",
    "web_frames_manager_impl_unittest.mm",
    "web_frames_manager_java_script_feature_unittest.mm",
    "web_view_js_utils_unittest.mm",
    "web_view_web_state_map_unittest.mm",
  ]
}

source_set("inttests") {
  configs += [ "//build/config/compiler:enable_arc" ]
  testonly = true
  deps = [
    ":java_script_content_world_header",
    ":java_script_feature",
    ":js_messaging",
    "//base",
    "//base/test:test_support",
    "//ios/testing:embedded_test_server_support",
    "//ios/web/common",
    "//ios/web/js_messaging:java_script_feature",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test",
    "//ios/web/public/test:test_fixture",
    "//ios/web/public/test:util",
    "//ios/web/public/test/fakes",
    "//ios/web/test:js_test_util_internal",
    "//ios/web/test:test_support",
    "//ios/web/test/fakes",
    "//ios/web/web_state/ui:web_controller_header",
    "//ios/web/web_state/ui:wk_web_view_configuration_provider_header",
    "//net:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/ocmock",
  ]
  sources = [
    "java_script_feature_inttest.mm",
    "java_script_feature_manager_inttest.mm",
    "web_frame_impl_inttest.mm",
    "web_frame_web_state_observer_inttest.mm",
    "web_frames_manager_inttest.mm",
  ]
}