[iOS] Add proxy_resolver:tests to services_unittests
This CL adds proxy_resolver:tests to services_unittests and creates
test_bundle_data for proxy_resolver:tests.
Bug: 1421221
Change-Id: Id18ea74c76a3365ea6d97a06cbb028eeb5f1209d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575629
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1151772}
diff --git a/services/BUILD.gn b/services/BUILD.gn
index ac135dd..f5ef280 100644
--- a/services/BUILD.gn
+++ b/services/BUILD.gn
@@ -42,6 +42,7 @@
"//services/media_session:tests",
"//services/media_session/public/cpp:tests",
"//services/preferences/tracked:unit_tests",
+ "//services/proxy_resolver:tests",
"//services/resource_coordinator:tests",
"//services/shape_detection:tests",
"//services/viz/privileged/mojom:unit_tests",
@@ -55,7 +56,6 @@
if (!is_ios) {
deps += [
"//services/data_decoder:tests",
- "//services/proxy_resolver:tests",
"//services/tracing:tests",
]
if (is_android && (current_cpu == "arm" || current_cpu == "arm64")) {
diff --git a/services/proxy_resolver/BUILD.gn b/services/proxy_resolver/BUILD.gn
index fda5685..c5ef3e9a 100644
--- a/services/proxy_resolver/BUILD.gn
+++ b/services/proxy_resolver/BUILD.gn
@@ -77,5 +77,9 @@
configs += [ "//v8:external_startup_data" ]
- data = [ "test/data/" ]
+ if (is_ios) {
+ deps += [ "test:test_bundle_data" ]
+ } else {
+ data = [ "test/data/" ]
+ }
}
diff --git a/services/proxy_resolver/test/BUILD.gn b/services/proxy_resolver/test/BUILD.gn
new file mode 100644
index 0000000..c074d842
--- /dev/null
+++ b/services/proxy_resolver/test/BUILD.gn
@@ -0,0 +1,12 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ios/bundle_data_from_filelist.gni")
+
+if (is_ios) {
+ bundle_data_from_filelist("test_bundle_data") {
+ testonly = true
+ filelist_name = "test_bundle_data.filelist"
+ }
+}
diff --git a/services/proxy_resolver/test/OWNERS b/services/proxy_resolver/test/OWNERS
new file mode 100644
index 0000000..9067437c
--- /dev/null
+++ b/services/proxy_resolver/test/OWNERS
@@ -0,0 +1,3 @@
+# Anyone can update the unit test bundle data filelist.
+per-file test_bundle_data.filelist=*
+
diff --git a/services/proxy_resolver/test/PRESUBMIT.py b/services/proxy_resolver/test/PRESUBMIT.py
new file mode 100644
index 0000000..aacf225
--- /dev/null
+++ b/services/proxy_resolver/test/PRESUBMIT.py
@@ -0,0 +1,24 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+"""Presubmit checks for services/proxy_resolver/test
+See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts
+for more details about the presubmit API built into depot_tools.
+"""
+PRESUBMIT_VERSION = '2.0.0'
+USE_PYTHON3 = True
+def CheckChange(input_api, output_api):
+ import sys
+ old_sys_path = sys.path[:]
+ results = []
+ try:
+ sys.path.append(input_api.change.RepositoryRoot())
+ from build.ios import presubmit_support
+ results += presubmit_support.CheckBundleData(input_api,
+ output_api,
+ 'test_bundle_data',
+ globroot='.')
+ finally:
+ sys.path = old_sys_path
+ return results
+
diff --git a/services/proxy_resolver/test/test_bundle_data.filelist b/services/proxy_resolver/test/test_bundle_data.filelist
new file mode 100644
index 0000000..1e62c9d7
--- /dev/null
+++ b/services/proxy_resolver/test/test_bundle_data.filelist
@@ -0,0 +1,45 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+# NOTE: this file is generated by build/ios/update_bundle_filelist.py
+# If it requires updating, you should get a presubmit error with
+# instructions on how to regenerate. Otherwise, do not edit.
+data/proxy_resolver_v8_tracing_unittest/dns.js
+data/proxy_resolver_v8_tracing_unittest/dns_during_init.js
+data/proxy_resolver_v8_tracing_unittest/error.js
+data/proxy_resolver_v8_tracing_unittest/error_on_load.js
+data/proxy_resolver_v8_tracing_unittest/global_sideffects1.js
+data/proxy_resolver_v8_tracing_unittest/global_sideffects2.js
+data/proxy_resolver_v8_tracing_unittest/global_sideffects3.js
+data/proxy_resolver_v8_tracing_unittest/global_sideffects4.js
+data/proxy_resolver_v8_tracing_unittest/my_ip_address.js
+data/proxy_resolver_v8_tracing_unittest/simple.js
+data/proxy_resolver_v8_tracing_unittest/simple_dns.js
+data/proxy_resolver_v8_tracing_unittest/terminate.js
+data/proxy_resolver_v8_tracing_unittest/too_many_alerts.js
+data/proxy_resolver_v8_tracing_unittest/too_many_empty_alerts.js
+data/proxy_resolver_v8_unittest/binding_from_global.js
+data/proxy_resolver_v8_unittest/bindings.js
+data/proxy_resolver_v8_unittest/direct.js
+data/proxy_resolver_v8_unittest/dns_fail.js
+data/proxy_resolver_v8_unittest/ends_with_comment.js
+data/proxy_resolver_v8_unittest/ends_with_statement_no_semicolon.js
+data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_init.js
+data/proxy_resolver_v8_unittest/exception_findproxyforurl_during_resolve.js
+data/proxy_resolver_v8_unittest/international_domain_names.js
+data/proxy_resolver_v8_unittest/missing_close_brace.js
+data/proxy_resolver_v8_unittest/no_entrypoint.js
+data/proxy_resolver_v8_unittest/pac_library_unittest.js
+data/proxy_resolver_v8_unittest/passthrough.js
+data/proxy_resolver_v8_unittest/resolve_host.js
+data/proxy_resolver_v8_unittest/return_empty_string.js
+data/proxy_resolver_v8_unittest/return_function.js
+data/proxy_resolver_v8_unittest/return_integer.js
+data/proxy_resolver_v8_unittest/return_null.js
+data/proxy_resolver_v8_unittest/return_object.js
+data/proxy_resolver_v8_unittest/return_undefined.js
+data/proxy_resolver_v8_unittest/return_unicode.js
+data/proxy_resolver_v8_unittest/side_effects.js
+data/proxy_resolver_v8_unittest/simple.js
+data/proxy_resolver_v8_unittest/terminate.js
+data/proxy_resolver_v8_unittest/unhandled_exception.js
diff --git a/services/proxy_resolver/test/test_bundle_data.globlist b/services/proxy_resolver/test/test_bundle_data.globlist
new file mode 100644
index 0000000..f3e4cb7
--- /dev/null
+++ b/services/proxy_resolver/test/test_bundle_data.globlist
@@ -0,0 +1,10 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# See build/ios/update_bundle_filelist.py for details on how .globlist
+# files are used to update their .filelist counterparts.
+
+data/proxy_resolver_v8_unittest/*
+data/proxy_resolver_v8_tracing_unittest/*
+