# 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("//third_party/cast_core/public/src/proto/proto.gni") static_library("test_support") { testonly = true sources = [ "client_storage.cc", "client_storage.h", "embedded_policy_test_server.cc", "embedded_policy_test_server.h", "policy_storage.cc", "policy_storage.h", "remote_commands_result_waiter.cc", "remote_commands_result_waiter.h", "remote_commands_state.cc", "remote_commands_state.h", "request_handler_for_api_authorization.cc", "request_handler_for_api_authorization.h", "request_handler_for_auto_enrollment.cc", "request_handler_for_auto_enrollment.h", "request_handler_for_browser_public_key_upload.cc", "request_handler_for_browser_public_key_upload.h", "request_handler_for_cert_upload.cc", "request_handler_for_cert_upload.h", "request_handler_for_check_android_management.cc", "request_handler_for_check_android_management.h", "request_handler_for_check_user_account.cc", "request_handler_for_check_user_account.h", "request_handler_for_chrome_desktop_report.cc", "request_handler_for_chrome_desktop_report.h", "request_handler_for_client_cert_provisioning.cc", "request_handler_for_client_cert_provisioning.h", "request_handler_for_determine_promotion_eligibility.cc", "request_handler_for_determine_promotion_eligibility.h", "request_handler_for_device_attribute_update.cc", "request_handler_for_device_attribute_update.h", "request_handler_for_device_attribute_update_permission.cc", "request_handler_for_device_attribute_update_permission.h", "request_handler_for_device_initial_enrollment_state.cc", "request_handler_for_device_initial_enrollment_state.h", "request_handler_for_device_state_retrieval.cc", "request_handler_for_device_state_retrieval.h", "request_handler_for_policy.cc", "request_handler_for_policy.h", "request_handler_for_register_browser.cc", "request_handler_for_register_browser.h", "request_handler_for_register_cert_based.cc", "request_handler_for_register_cert_based.h", "request_handler_for_register_device_and_user.cc", "request_handler_for_register_device_and_user.h", "request_handler_for_remote_commands.cc", "request_handler_for_remote_commands.h", "request_handler_for_status_upload.cc", "request_handler_for_status_upload.h", "request_handler_for_unregister.cc", "request_handler_for_unregister.h", "request_handler_for_upload_euicc_info.cc", "request_handler_for_upload_euicc_info.h", "signature_provider.cc", "signature_provider.h", "test_server_helpers.cc", "test_server_helpers.h", ] if (is_chromeos || (is_linux && !is_cfi)) { sources += [ "fake_dmserver.cc", "fake_dmserver.h", ] } if (is_chromeos) { sources += [ "request_handler_for_psm_auto_enrollment.cc", "request_handler_for_psm_auto_enrollment.h", ] } public_deps = [ "//net:test_support" ] deps = [ "//base", "//components/policy/core/common:common_constants", "//components/policy/core/common:test_support", "//components/policy/proto", "//crypto", "//crypto:test_support", "//google_apis", "//net", "//net:test_support", "//third_party/re2", ] if (is_chromeos || (is_linux && !is_cfi)) { public_deps += [ ":remote_commands_service_castcore" ] deps += [ "//components/policy:generated_testonly" ] } if (is_chromeos) { public_deps += [ "//third_party/private_membership" ] data = [ # TODO(crbug.com/40248354): Script should create binarypb from textpb. # Required for policy/enrollment/psm/rlwe_test_support.cc "//third_party/private_membership/src/internal/testing/regression_test_data/test_data.binarypb", ] deps += [ "//third_party/private_membership:private_membership_proto" ] } # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and # enable the diagnostic by removing this line. configs += [ "//build/config/compiler:no_exit_time_destructors" ] } if (is_chromeos || (is_linux && !is_cfi)) { cast_core_grpc_library("remote_commands_service") { testonly = true sources = [ "remote_commands_service.proto" ] deps = [ "//components/policy/proto:proto_internal", "//third_party/private_membership:private_membership_proto", ] extra_configs = [ "//third_party/private_membership:private_membership_config" ] import_dirs = [ "//components/policy/proto", "//third_party/private_membership/src", "//third_party/shell-encryption/src", ] generate_castcore_stubs = true } executable("fake_dmserver") { testonly = true output_name = "fake_dmserver" sources = [ "fake_dmserver_main.cc" ] deps = [ ":test_support", "//base", "//third_party/abseil-cpp:absl", ] # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and # enable the diagnostic by removing this line. configs += [ "//build/config/compiler:no_exit_time_destructors" ] } } source_set("unittests") { testonly = true sources = [ "client_storage_unittest.cc", "embedded_policy_test_server_test_base.cc", "embedded_policy_test_server_test_base.h", "embedded_policy_test_server_unittest.cc", "policy_storage_unittest.cc", "remote_commands_state_unittest.cc", "request_handler_for_api_authorization_unittest.cc", "request_handler_for_auto_enrollment_unittest.cc", "request_handler_for_browser_public_key_upload_unittest.cc", "request_handler_for_cert_upload_unittest.cc", "request_handler_for_check_android_management_unittest.cc", "request_handler_for_check_user_account_unittest.cc", "request_handler_for_chrome_desktop_report_unittest.cc", "request_handler_for_client_cert_provisioning_unittest.cc", "request_handler_for_determine_promotion_eligibility_unittest.cc", "request_handler_for_device_attribute_update_permission_unittest.cc", "request_handler_for_device_attribute_update_unittest.cc", "request_handler_for_device_initial_enrollment_state_unittest.cc", "request_handler_for_device_state_retrieval_unittest.cc", "request_handler_for_policy_unittest.cc", "request_handler_for_register_browser_unittest.cc", "request_handler_for_register_cert_based_unittest.cc", "request_handler_for_register_device_and_user_unittest.cc", "request_handler_for_remote_commands_unittest.cc", "request_handler_for_status_upload_unittest.cc", "request_handler_for_unregister_unittest.cc", "request_handler_for_upload_euicc_info_unittest.cc", "signature_provider_unittest.cc", ] if (is_chromeos || (is_linux && !is_cfi)) { sources += [ "fake_dmserver_unittest.cc" ] } if (is_chromeos) { sources += [ "request_handler_for_psm_auto_enrollment_unittest.cc" ] } deps = [ ":test_support", "//components/policy/core/common:common_constants", "//components/policy/core/common:test_support", "//components/policy/proto", "//crypto:test_support", "//services/network:test_support", "//services/network/public/cpp", "//services/network/public/mojom", "//third_party/abseil-cpp:absl", ] # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and # enable the diagnostic by removing this line. configs += [ "//build/config/compiler:no_exit_time_destructors" ] }