summaryrefslogtreecommitdiff
path: root/chromium/components/services/unzip/BUILD.gn
blob: d2648aecb43223fc2ce06b7bc0db19110b483e28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

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

  deps = [
    "//base",
    "//mojo/public/cpp/bindings",
    "//third_party/zlib/google:zip",
  ]

  public_deps = [
    "//components/services/filesystem/public/mojom",
    "//components/services/unzip/public/mojom",
  ]
}

source_set("in_process") {
  # NOTE: In-process unzipping 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_unzipper.cc",
    "in_process_unzipper.h",
  ]

  deps = [
    ":lib",
    "//base",
  ]

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

bundle_data("unit_tests_bundle_data") {
  visibility = [ ":unit_tests" ]
  testonly = true
  sources = [
    "//components/test/data/unzip_service/bad_archive.zip",
    "//components/test/data/unzip_service/good_archive.zip",
  ]
  outputs = [ "{{bundle_resources_dir}}/" +
              "{{source_root_relative_dir}}/{{source_file_part}}" ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "public/cpp/unzip_unittest.cc" ]

  deps = [
    ":lib",
    ":unit_tests_bundle_data",
    "//base",
    "//base/test:test_support",
    "//components/services/unzip/public/cpp",
    "//testing/gtest",
  ]
}