| # 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("//build/config/chrome_build.gni") |
| import("//build/config/ui.gni") |
| import("//build/toolchain/win/midl.gni") |
| import("//chrome/process_version_rc_template.gni") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//testing/test.gni") |
| |
| midl("elevation_service_idl") { |
| sources = [ "elevation_service_idl.idl" ] |
| |
| writes_tlb = true |
| } |
| |
| executable("elevation_service") { |
| sources = [ |
| "elevation_service.cc", |
| "elevation_service.rc", |
| ] |
| |
| configs -= [ |
| "//build/config/compiler:cet_shadow_stack", |
| "//build/config/win:console", |
| ] |
| configs += [ "//build/config/win:windowed" ] |
| |
| deps = [ |
| ":lib", |
| ":service_lib", |
| ":version_resources", |
| "//build/win:default_exe_manifest", |
| "//chrome/windows_services/service_program:service_program_without_crashpad", |
| ] |
| } |
| |
| source_set("public_headers") { |
| public = [ "elevator.h" ] |
| |
| deps = [ "//base" ] |
| |
| public_deps = [ ":elevation_service_idl" ] |
| } |
| |
| source_set("lib") { |
| visibility = [ ":*" ] |
| |
| public = [ |
| "caller_validation.h", |
| "elevated_recovery_impl.h", |
| ] |
| |
| sources = [ |
| "caller_validation.cc", |
| "elevated_recovery_impl.cc", |
| "elevator.cc", |
| ] |
| |
| deps = [ |
| "//base/version_info", |
| "//chrome/common:non_code_constants", |
| "//chrome/install_static:install_static_util", |
| "//chrome/installer/util:constants", |
| "//chrome/installer/util:isolation_support", |
| "//chrome/windows_services/service_program:common", |
| "//components/crx_file", |
| "//content/public/common:static_switches", |
| "//third_party/zlib/google:zip", |
| ] |
| |
| if (is_chrome_branded) { |
| deps += [ "//chrome/elevation_service/internal" ] |
| } |
| |
| public_deps = [ |
| ":public_headers", |
| "//base", |
| ] |
| |
| libs = [ |
| "crypt32.lib", |
| "rpcrt4.lib", |
| ] |
| } |
| |
| source_set("service_lib") { |
| visibility = [ ":*" ] |
| |
| public = [ "elevation_service_delegate.h" ] |
| public_deps = [ "//chrome/windows_services/service_program:delegate" ] |
| sources = [ "elevation_service_delegate.cc" ] |
| configs -= [ "//build/config/win:winver" ] |
| configs += [ |
| "//chrome/windows_services/service_program:classic_com", |
| "//chrome/windows_services/service_program:winver", |
| ] |
| deps = [ |
| ":lib", |
| "//base", |
| "//chrome/common/win:eventlog_provider", |
| "//chrome/install_static:install_static_util", |
| ] |
| } |
| |
| process_version_rc_template("version_resources") { |
| sources = [ "elevation_service_exe.ver" ] |
| output = "$target_gen_dir/elevation_service_exe.rc" |
| } |
| |
| copy("elevation_service_unittests_files") { |
| sources = [ |
| "//components/test/data/crx_file/valid_no_publisher.crx3", |
| "//components/test/data/crx_file/valid_publisher.crx3", |
| "//components/test/data/update_client/ChromeRecovery.crx3", |
| ] |
| outputs = [ "$root_out_dir/elevated_recovery_unittest/{{source_file_part}}" ] |
| } |
| |
| test("elevation_service_unittests") { |
| use_xvfb = use_xvfb_in_this_config |
| |
| sources = [ |
| "caller_validation_unittest.cc", |
| "elevated_recovery_unittest.cc", |
| "elevation_service_unittest.cc", |
| "elevator_unittest.cc", |
| "run_all_unittests.cc", |
| "service_main_unittest.cc", |
| ] |
| |
| deps = [ |
| ":elevation_service_idl", |
| ":lib", |
| ":service_lib", |
| "//base", |
| "//base/test:test_support", |
| "//chrome/common:non_code_constants", |
| "//chrome/elevation_service:elevation_service_idl", |
| "//chrome/install_static:install_static_util", |
| "//chrome/install_static/test:test_support", |
| "//chrome/windows_services/service_program:lib", |
| "//chrome/windows_services/service_program/test_support", |
| "//components/crx_file", |
| "//testing/gtest", |
| ] |
| |
| if (is_chrome_branded) { |
| deps += [ "//chrome/elevation_service/internal:unittests" ] |
| } |
| |
| data_deps = [ |
| ":elevation_service", |
| ":elevation_service_test_child", |
| ":elevation_service_unittests_files", |
| ] |
| } |
| |
| executable("elevation_service_test_child") { |
| testonly = true |
| sources = [ "elevation_service_test_child.cc" ] |
| deps = [ |
| "//base", |
| "//base/test:test_config", |
| "//build:branding_buildflags", |
| "//chrome/common:non_code_constants", |
| "//chrome/installer/util:isolation_support", |
| ] |
| } |
| |
| fuzzer_test("caller_validation_fuzzer") { |
| deps = [ |
| ":lib", |
| "//base", |
| "//testing/libfuzzer:libfuzzer_base_wrappers", |
| ] |
| |
| dict = "fuzz.dict" |
| |
| sources = [ "caller_validation_fuzzer.cc" ] |
| } |