From 2771ebf805aed81c95bf1d8dc9ee404b603df025 Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Wed, 13 Jun 2018 20:14:43 -0700 Subject: [PATCH] fuchsia: Package test cert and key when running in Fuchsia tree Bug: crashpad:196 Change-Id: I18f7686a9b5127143501c2b21663d80aae3d1f54 Reviewed-on: https://chromium-review.googlesource.com/1100494 Commit-Queue: Scott Graham Reviewed-by: Scott Graham --- BUILD.gn | 12 ++++++++++++ test/test_paths.cc | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index e09f72dd..065a5e1f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -45,6 +45,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { "snapshot:crashpad_snapshot_test_module_large", "snapshot:crashpad_snapshot_test_module_small", "test:crashpad_test_test_multiprocess_exec_test_child", + "util:generate_test_server_key", "util:http_transport_test_server", ] @@ -60,6 +61,17 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { name = "http_transport_test_server" dest = "crashpad_test_data/http_transport_test_server" }, + + # These aren't actually tests, but that seems to be the only way to + # convince package() to get them from the output directory. + { + name = "crashpad_util_test_cert.pem" + dest = "crashpad_test_data/crashpad_util_test_cert.pem" + }, + { + name = "crashpad_util_test_key.pem" + dest = "crashpad_test_data/crashpad_util_test_key.pem" + }, ] loadable_modules = [ diff --git a/test/test_paths.cc b/test/test_paths.cc index 7bfc5de0..50165e43 100644 --- a/test/test_paths.cc +++ b/test/test_paths.cc @@ -232,6 +232,14 @@ base::FilePath TestPaths::BuildArtifact( break; case FileType::kCertificate: +#if defined(CRASHPAD_IS_IN_FUCHSIA) + // When running in the Fuchsia tree, the .pem files are packaged as assets + // into the test data folder. This will need to be rationalized when + // things are actually run from a package. + // https://crashpad.chromium.org/bug/196. + directory = + base::FilePath(FILE_PATH_LITERAL("/system/test/crashpad_test_data")); +#endif extension = FILE_PATH_LITERAL(".pem"); break; }