910e62b5创建于 1月15日历史提交
# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source_set("lib") {
  sources = [
    "file_patcher_impl.cc",
    "file_patcher_impl.h",
  ]

  deps = [
    "//components/services/filesystem/public/mojom",
    "//mojo/public/cpp/bindings",
    "//third_party/puffin:libpuffpatch",
  ]

  include_dirs = [ "//third_party/puffin/src/include" ]

  public_deps = [
    "//base",
    "//components/services/patch/public/mojom",
    "//components/zucchini:zucchini_io",
  ]
}

source_set("in_process") {
  # NOTE: In-process file patching is unsafe! Unfortunately on iOS we have no
  # other choice. On all other platforms, this target is restricted to tests.
  testonly = !is_ios

  sources = [
    "in_process_file_patcher.cc",
    "in_process_file_patcher.h",
  ]

  deps = [ ":lib" ]

  public_deps = [
    "//components/services/patch/public/mojom",
    "//mojo/public/cpp/bindings",
  ]
}

bundle_data("unit_tests_bundle_data") {
  visibility = [ ":unit_tests" ]
  testonly = true
  sources = [
    "//components/test/data/patch_service/new_file",
    "//components/test/data/patch_service/old_file",
    "//components/test/data/patch_service/patch_file",
  ]
  outputs = [ "{{bundle_resources_dir}}/" +
              "{{source_root_relative_dir}}/{{source_file_part}}" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "file_patcher_unittest.cc" ]
  deps = [
    ":in_process",
    ":lib",
    ":unit_tests_bundle_data",
    "//base",
    "//base/test:test_support",
    "//components/services/patch/public/cpp",
    "//testing/gtest",
  ]
}