Add more tests for App Bound encryption.
In preparation for adding more protection levels, this CL adds
a new testing capability where app-bound encryption can be
called from a specified child process.
In a new test, the child process name is configured in order
to test ProtectionLevel::PATH_VALIDATION, but future CLs will
add additional capabilities to configure other attributes of
the test executable.
This CL also moves the tests into the os_crypt namespace.
It continues to run them as interactive_ui_tests rather than
in a unit test or normal browser test, because the service
management requires the tests to be run sequentially and never
concurrently, which interactive_ui_tests guarantees.
BUG=1333461
Change-Id: I9ed45f3495aa0ec553d5b878eb2432f276dd3dc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5239158
Commit-Queue: Will Harris <[email protected]>
Reviewed-by: Alex Gough <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1252913}
diff --git a/chrome/browser/os_crypt/BUILD.gn b/chrome/browser/os_crypt/BUILD.gn
index 8097a4b..e6ad6b4 100644
--- a/chrome/browser/os_crypt/BUILD.gn
+++ b/chrome/browser/os_crypt/BUILD.gn
@@ -30,11 +30,40 @@
deps = [
":os_crypt",
+ ":test_support",
"//base",
+ "//chrome/test:test_support",
+ "//content/test:test_support",
+ ]
+
+ data_deps = [ ":app_binary" ]
+}
+
+source_set("test_support") {
+ testonly = true
+ sources = [
+ "test_support.cc",
+ "test_support.h",
+ ]
+ deps = [
+ "//base",
+ "//chrome/elevation_service:public_headers",
+ "//chrome/install_static:install_static_util",
"//chrome/install_static/test:test_support",
"//chrome/installer/util:constants",
- "//chrome/test:test_support",
- "//components/version_info:version_info",
- "//content/test:test_support",
+ "//chrome/installer/util:work_item",
+ ]
+}
+
+# This binary is launched by the browser tests and makes calls to the app-bound
+# service to test the functionality for various executable callers.
+executable("app_binary") {
+ testonly = true
+ sources = [ "app_bound_encryption_test_main.cc" ]
+ deps = [
+ ":os_crypt",
+ ":test_support",
+ "//base",
+ "//chrome/install_static/test:test_support",
]
}