BUILD.gn 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 2014 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/ui.gni")
  5. import("//testing/test.gni")
  6. component("snapshot") {
  7. sources = [
  8. "screenshot_grabber.cc",
  9. "screenshot_grabber.h",
  10. "snapshot.cc",
  11. "snapshot.h",
  12. ]
  13. if (is_android) {
  14. sources += [ "snapshot_android.cc" ]
  15. }
  16. if (is_mac) {
  17. sources += [ "snapshot_mac.mm" ]
  18. }
  19. if (is_win) {
  20. sources += [
  21. "snapshot_win.cc",
  22. "snapshot_win.h",
  23. ]
  24. }
  25. if (is_ios) {
  26. sources += [ "snapshot_ios.mm" ]
  27. }
  28. defines = [ "SNAPSHOT_IMPLEMENTATION" ]
  29. deps = [
  30. ":snapshot_export",
  31. "//base",
  32. "//components/viz/common",
  33. "//skia",
  34. "//ui/base",
  35. "//ui/display",
  36. "//ui/gfx",
  37. "//ui/gfx/geometry",
  38. ]
  39. if (is_android) {
  40. deps += [ "//ui/android" ]
  41. }
  42. if (use_aura || is_android) {
  43. sources += [
  44. "snapshot_async.cc",
  45. "snapshot_async.h",
  46. ]
  47. deps += [
  48. "//cc",
  49. "//gpu/command_buffer/common",
  50. ]
  51. }
  52. if (use_aura) {
  53. sources += [
  54. "snapshot_aura.cc",
  55. "snapshot_aura.h",
  56. ]
  57. deps += [
  58. "//ui/aura",
  59. "//ui/compositor",
  60. ]
  61. }
  62. if (is_mac) {
  63. frameworks = [
  64. "AppKit.framework",
  65. "CoreGraphics.framework",
  66. ]
  67. }
  68. }
  69. source_set("snapshot_export") {
  70. sources = [ "snapshot_export.h" ]
  71. visibility = [ ":*" ]
  72. }
  73. test("snapshot_unittests") {
  74. use_xvfb = use_xvfb_in_this_config
  75. sources = [ "test/run_all_unittests.cc" ]
  76. if (is_mac) {
  77. sources += [ "snapshot_mac_unittest.mm" ]
  78. }
  79. deps = [
  80. ":snapshot",
  81. "//base",
  82. "//base/test:test_support",
  83. "//mojo/core/embedder",
  84. "//skia",
  85. "//testing/gtest",
  86. "//ui/base",
  87. "//ui/base:test_support",
  88. "//ui/compositor:test_support",
  89. "//ui/gfx",
  90. "//ui/gfx/geometry",
  91. "//ui/gl",
  92. ]
  93. data_deps = [ "//testing/buildbot/filters:snapshot_unittests_filters" ]
  94. if (use_aura) {
  95. sources += [ "snapshot_aura_unittest.cc" ]
  96. deps += [
  97. "//ui/aura:test_support",
  98. "//ui/compositor",
  99. "//ui/compositor:test_support",
  100. "//ui/wm",
  101. ]
  102. }
  103. if (is_fuchsia) {
  104. use_cfv1 = false
  105. # TODO(https://crbug.com/1185811): Investigate removing the requirement for
  106. # job_policy_ambient_mark_vmo_exec for the sake of V8's allocator in tests.
  107. test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml"
  108. additional_manifest_fragments = [
  109. "//build/config/fuchsia/test/present_view.shard.test-cml",
  110. "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
  111. ]
  112. }
  113. }