File: BUILD.gn

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (138 lines) | stat: -rw-r--r-- 2,848 bytes parent folder | download | duplicates (5)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright 2014 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/ui.gni")
import("//testing/test.gni")

component("snapshot") {
  sources = [
    "screenshot_grabber.cc",
    "screenshot_grabber.h",
    "snapshot.cc",
    "snapshot.h",
  ]

  if (is_android) {
    sources += [ "snapshot_android.cc" ]
  }

  if (is_mac) {
    sources += [
      "snapshot_mac.h",
      "snapshot_mac.mm",
    ]
  }

  if (is_win) {
    sources += [ "snapshot_win.cc" ]
  }

  if (is_ios) {
    sources += [ "snapshot_ios.mm" ]
  }

  defines = [ "SNAPSHOT_IMPLEMENTATION" ]

  deps = [
    ":snapshot_export",
    "//base",
    "//components/viz/common",
    "//skia",
    "//ui/base",
    "//ui/display",
    "//ui/gfx",
    "//ui/gfx/geometry",
  ]

  if (is_android) {
    deps += [ "//ui/android" ]
  }

  if (use_aura || is_android) {
    sources += [
      "snapshot_async.cc",
      "snapshot_async.h",
    ]
    deps += [
      "//cc",
      "//gpu/command_buffer/common",
    ]
  }

  if (use_aura) {
    sources += [
      "snapshot_aura.cc",
      "snapshot_aura.h",
    ]
    deps += [
      "//ui/aura",
      "//ui/compositor",
    ]
  }

  if (is_mac) {
    frameworks = [
      "AppKit.framework",
      "CoreGraphics.framework",
    ]
    weak_frameworks = [ "ScreenCaptureKit.framework" ]  # macOS 14.4
  }
}

source_set("snapshot_export") {
  sources = [ "snapshot_export.h" ]
  visibility = [ ":*" ]
}

test("snapshot_unittests") {
  use_xvfb = use_xvfb_in_this_config

  sources = [ "test/run_all_unittests.cc" ]

  if (is_mac) {
    sources += [ "snapshot_mac_unittest.mm" ]
  }

  deps = [
    ":snapshot",
    "//base",
    "//base/test:test_support",
    "//mojo/core/embedder",
    "//skia",
    "//testing/gtest",
    "//ui/base",
    "//ui/base:test_support",
    "//ui/compositor:test_support",
    "//ui/gfx",
    "//ui/gfx:test_support",
    "//ui/gfx/geometry",
    "//ui/gl",
  ]

  data_deps = [ "//testing/buildbot/filters:snapshot_unittests_filters" ]

  if (use_aura) {
    sources += [ "snapshot_aura_unittest.cc" ]
    deps += [
      "//ui/aura:test_support",
      "//ui/compositor",
      "//ui/compositor:test_support",
      "//ui/wm",
    ]
  }

  if (is_fuchsia) {
    # TODO(crbug.com/42050042): Some of these tests use SwiftShader,
    # which requires ambient VMEX.
    test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"

    additional_manifest_fragments = [
      # TODO(crbug.com/40055105): Investigate removing the requirement
      # for VmexResource.
      "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
      "//build/config/fuchsia/test/present_view.shard.test-cml",
      "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
    ]
  }
}