| # Copyright 2018 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/web/public/js_messaging/optimize_js.gni") |
| import("//ios/web/public/js_messaging/optimize_ts.gni") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//testing/test.gni") |
| |
| source_set("form_util") { |
| sources = [ |
| "form_activity_observer.h", |
| "form_activity_observer_bridge.h", |
| "form_activity_observer_bridge.mm", |
| "form_activity_params.h", |
| "form_activity_params.mm", |
| "form_activity_tab_helper.h", |
| "form_activity_tab_helper.mm", |
| ] |
| deps = [ |
| ":child_frame_registrar", |
| ":form_util_feature", |
| "//base", |
| "//components/autofill/core/common", |
| "//components/autofill/ios/browser:util", |
| "//components/autofill/ios/common", |
| "//ios/web/public", |
| "//ios/web/public/js_messaging", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| source_set("form_util_feature") { |
| sources = [ |
| "form_util_java_script_feature.h", |
| "form_util_java_script_feature.mm", |
| ] |
| deps = [ |
| ":autofill_form_features", |
| ":fill_js", |
| ":form_js", |
| "//base", |
| "//components/autofill/ios/common", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging:content_world_header", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| source_set("form_handler_feature") { |
| sources = [ |
| "form_handlers_java_script_feature.h", |
| "form_handlers_java_script_feature.mm", |
| ] |
| deps = [ |
| ":autofill_form_features", |
| ":autofill_renderer_id_feature", |
| ":form_handlers_js", |
| ":form_util", |
| ":form_util_feature", |
| ":frame_registration_feature", |
| ":register_remote_frame_token_js", |
| "//base", |
| "//components/autofill/core/common:features", |
| "//components/autofill/ios/common", |
| "//ios/web/public/js_messaging", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| # For inclusion by other TS/JS files, so they can check feature state |
| compile_ts("autofill_form_features_ts") { |
| sources = [ "resources/autofill_form_features.ts" ] |
| deps = [ "//ios/web/public/js_messaging:gcrweb" ] |
| } |
| |
| # For bundling with autofill_form_features, which enables/disables features |
| optimize_js("autofill_form_features_ts_bundling") { |
| deps = [ |
| ":autofill_form_features_ts", |
| "//ios/web/public/js_messaging:gcrweb", |
| ] |
| |
| _script = filter_include(get_target_outputs(":autofill_form_features_ts"), |
| [ "*autofill_form_features.js" ]) |
| primary_script = _script[0] |
| sources = _script |
| } |
| |
| source_set("frame_registration_feature") { |
| sources = [ |
| "remote_frame_registration_java_script_feature.h", |
| "remote_frame_registration_java_script_feature.mm", |
| ] |
| deps = [ |
| ":autofill_form_features", |
| ":child_frame_registrar", |
| ":child_frame_registration_ts", |
| "//base", |
| "//components/autofill/core/common:features", |
| "//components/autofill/ios/common", |
| "//ios/web/public", |
| "//ios/web/public/js_messaging", |
| ] |
| } |
| |
| optimize_ts("child_frame_registration_ts") { |
| sources = [ "resources/child_frame_registration_lib.ts" ] |
| deps = [ |
| ":autofill_form_features_ts", |
| ":fill_js_namespace", |
| "//ios/web/public/js_messaging:gcrweb", |
| "//ios/web/public/js_messaging:util_scripts", |
| ] |
| } |
| |
| optimize_ts("child_frame_registration_test_ts") { |
| sources = [ "resources/child_frame_registration_test.ts" ] |
| deps = [ "//ios/web/public/js_messaging:gcrweb" ] |
| } |
| |
| compile_ts("fill_js_dependencies") { |
| sources = [ |
| "resources/fill_element_inference.ts", |
| "resources/fill_element_inference_util.ts", |
| "resources/fill_util.ts", |
| "resources/form_utils.ts", |
| ] |
| |
| deps = [ |
| ":autofill_form_features_ts", |
| ":fill_js_namespace", |
| "//ios/web/public/js_messaging:gcrweb", |
| "//ios/web/public/js_messaging:util_scripts", |
| ] |
| } |
| |
| compile_ts("fill_js_namespace") { |
| sources = [ |
| "resources/create_fill_namespace.ts", |
| "resources/fill_constants.ts", |
| ] |
| |
| deps = [ "//ios/web/public/js_messaging:gcrweb" ] |
| } |
| |
| optimize_ts("fill_js") { |
| sources = [ "resources/fill.ts" ] |
| |
| deps = [ |
| ":fill_js_dependencies", |
| ":fill_js_namespace", |
| "//ios/web/public/js_messaging:gcrweb", |
| ] |
| } |
| |
| optimize_ts("fill_util_test_js") { |
| sources = [ "resources/fill_util_test.ts" ] |
| |
| deps = [ |
| ":fill_js_dependencies", |
| "//ios/web/public/js_messaging:gcrweb", |
| ] |
| } |
| |
| optimize_ts("form_js") { |
| sources = [ "resources/form.ts" ] |
| |
| deps = [ |
| ":fill_js_dependencies", |
| ":fill_js_namespace", |
| "//ios/web/public/js_messaging:gcrweb", |
| "//ios/web/public/js_messaging:util_scripts", |
| ] |
| } |
| |
| optimize_ts("form_handlers_js") { |
| sources = [ "resources/form_handlers.ts" ] |
| deps = [ |
| ":fill_js_dependencies", |
| "//ios/web/public/js_messaging:gcrweb", |
| "//ios/web/public/js_messaging:util_scripts", |
| ] |
| } |
| |
| optimize_ts("register_remote_frame_token_js") { |
| sources = [ "resources/register_remote_frame_token.ts" ] |
| |
| deps = [ |
| ":fill_js_dependencies", |
| "//ios/web/public/js_messaging:gcrweb", |
| "//ios/web/public/js_messaging:util_scripts", |
| ] |
| } |
| |
| source_set("autofill_renderer_id_feature") { |
| sources = [ |
| "autofill_renderer_id_java_script_feature.h", |
| "autofill_renderer_id_java_script_feature.mm", |
| ] |
| |
| deps = [ |
| ":autofill_renderer_id_js", |
| "//base", |
| "//components/autofill/ios/common", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging:content_world_header", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| optimize_ts("autofill_renderer_id_js") { |
| sources = [ "resources/renderer_id.ts" ] |
| |
| deps = [ |
| ":fill_js_namespace", |
| "//ios/web/public/js_messaging:gcrweb", |
| ] |
| } |
| |
| source_set("programmatic_form_submission_handler_feature") { |
| sources = [ |
| "programmatic_form_submission_handler_java_script_feature.h", |
| "programmatic_form_submission_handler_java_script_feature.mm", |
| ] |
| |
| deps = [ |
| ":autofill_form_features", |
| ":form_util", |
| ":form_util_feature", |
| ":programatic_form_submission_js", |
| "//base", |
| "//components/autofill/ios/common", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging:content_world_header", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| optimize_ts("programatic_form_submission_js") { |
| sources = [ "resources/programmatic_form_submission_handler.ts" ] |
| |
| deps = [ "//ios/web/public/js_messaging:gcrweb" ] |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| sources = [ |
| "autofill_test_with_web_state.h", |
| "autofill_test_with_web_state.mm", |
| "test_form_activity_observer.h", |
| "test_form_activity_observer.mm", |
| "test_form_activity_tab_helper.h", |
| "test_form_activity_tab_helper.mm", |
| ] |
| deps = [ |
| ":form_handler_feature", |
| ":form_util", |
| ":form_util_feature", |
| "//base", |
| "//base/test:test_support", |
| "//components/autofill/core/common", |
| "//ios/web/public", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/test", |
| "//ios/web/public/test:test_fixture", |
| "//testing/gtest", |
| ] |
| } |
| |
| source_set("child_frame_registrar") { |
| sources = [ |
| "child_frame_registrar.h", |
| "child_frame_registrar.mm", |
| ] |
| deps = [ |
| "//base", |
| "//components/autofill/core/common", |
| "//components/autofill/ios/browser:util", |
| "//components/autofill/ios/common", |
| "//ios/web/public", |
| "//ios/web/public/js_messaging", |
| ] |
| } |
| |
| source_set("autofill_form_features") { |
| sources = [ |
| "autofill_form_features_java_script_feature.h", |
| "autofill_form_features_java_script_feature.mm", |
| ] |
| deps = [ |
| ":autofill_form_features_ts_bundling", |
| "//base", |
| "//ios/web/public/js_messaging", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| source_set("autofill_form_features_injector") { |
| sources = [ |
| "autofill_form_features_injector.h", |
| "autofill_form_features_injector.mm", |
| ] |
| deps = [ |
| ":autofill_form_features", |
| "//base", |
| "//components/autofill/core/common:features", |
| "//components/autofill/ios/common", |
| "//ios/web/public", |
| "//ios/web/public:web_state_observer", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging:content_world_header", |
| ] |
| configs += [ "//build/config/compiler:wexit_time_destructors" ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "autofill_form_features_injector_unittest.mm", |
| "child_frame_registrar_unittest.mm", |
| "fill_js_unittest.mm", |
| "form_activity_observer_bridge_unittest.mm", |
| "form_activity_tab_helper_unittest.mm", |
| "form_unittest.mm", |
| "remote_frame_token_registration_unittest.mm", |
| ] |
| deps = [ |
| ":autofill_form_features", |
| ":autofill_form_features_injector", |
| ":autofill_renderer_id_feature", |
| ":child_frame_registrar", |
| ":fill_js", |
| ":fill_util_test_js", |
| ":form_handler_feature", |
| ":form_js", |
| ":form_util", |
| ":form_util_feature", |
| ":programmatic_form_submission_handler_feature", |
| ":test_support", |
| "//base", |
| "//base/test:test_support", |
| "//components/autofill/core/common", |
| "//components/autofill/ios/browser", |
| "//components/autofill/ios/browser:test_support", |
| "//components/autofill/ios/browser:util", |
| "//components/autofill/ios/common", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging:content_world_header", |
| "//ios/web/public/js_messaging:web_view_js_utils", |
| "//ios/web/public/test:javascript_test", |
| "//ios/web/public/test:test_fixture", |
| "//ios/web/public/test:util", |
| "//ios/web/public/test/fakes", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//url", |
| ] |
| } |
| if (is_ios) { |
| fuzzer_test("form_activity_tab_helper_fuzzer") { |
| additional_configs = [ "//testing/libfuzzer:build_for_ios_clusterfuzz_job" ] |
| sources = [ "form_activity_tab_helper_fuzzer.mm" ] |
| deps = [ |
| ":form_util", |
| "//base/test:test_support", |
| "//ios/web/public", |
| "//ios/web/public/js_messaging", |
| "//ios/web/public/js_messaging/fuzzer_support", |
| "//ios/web/public/js_messaging/fuzzer_support:js_message_proto", |
| "//ios/web/public/test", |
| "//ios/web/public/test:fuzzer_support", |
| "//ios/web/public/test:test_fixture", |
| "//third_party/libprotobuf-mutator", |
| ] |
| } |
| } |