chromium/chrome/services/file_util/public/cpp/BUILD.gn

# 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.

import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//components/safe_browsing/buildflags.gni")
import("//printing/buildflags/buildflags.gni")

source_set("cpp") {
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  deps = [ "//chrome/common/safe_browsing:archive_analyzer_results" ]
  public_deps = [ "//chrome/services/file_util/public/mojom" ]

  if (safe_browsing_mode == 1) {
    sources = [
      "sandboxed_rar_analyzer.cc",
      "sandboxed_rar_analyzer.h",
      "sandboxed_seven_zip_analyzer.cc",
      "sandboxed_seven_zip_analyzer.h",
      "sandboxed_zip_analyzer.cc",
      "sandboxed_zip_analyzer.h",
      "temporary_file_getter.cc",
      "temporary_file_getter.h",
    ]
    if (is_mac) {
      sources += [
        "sandboxed_dmg_analyzer_mac.cc",
        "sandboxed_dmg_analyzer_mac.h",
      ]
    }
    if (is_chromeos_ash) {
      sources += [
        "zip_file_creator.cc",
        "zip_file_creator.h",
      ]
    }

    deps += [
      "//components/services/filesystem:lib",
      "//content/public/browser",
    ]

    public_deps += [ "//chrome/common/safe_browsing" ]
  }
}

if (safe_browsing_mode == 1) {
  source_set("unit_tests") {
    testonly = true

    sources = [
      "sandboxed_rar_analyzer_unittest.cc",
      "sandboxed_seven_zip_analyzer_unittest.cc",
      "sandboxed_zip_analyzer_unittest.cc",
      "temporary_file_getter_unittest.cc",
    ]
    if (is_mac) {
      sources += [ "sandboxed_dmg_analyzer_mac_unittest.cc" ]
    }

    deps = [
      ":cpp",
      "//base/test:test_support",
      "//chrome/common:constants",
      "//chrome/common/safe_browsing:archive_analyzer_results",
      "//chrome/services/file_util",
      "//chrome/services/file_util:test_support",
      "//components/safe_browsing/content/common:file_type_policies",
      "//components/safe_browsing/core/common",
      "//content/test:test_support",
      "//skia",
      "//testing/gmock",
      "//testing/gtest",
    ]
  }
}

if (is_chromeos_ash) {
  source_set("browser_tests") {
    testonly = true

    sources = [ "zip_file_creator_browsertest.cc" ]
    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    deps = [
      ":cpp",
      "//base",
      "//chrome/test:test_support",
      "//chrome/test:test_support_ui",
      "//content/public/browser",
      "//content/public/common",
      "//content/test:test_support",
      "//testing/gtest",
      "//third_party/zlib",
    ]
  }
}