• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5import("//build/config/features.gni")
6import("//build/config/ui.gni")
7
8content_tests_gypi_values = exec_script(
9    "//build/gypi_to_gn.py",
10    [ rebase_path("../content_tests.gypi"),
11      "--replace=<(SHARED_INTERMEDIATE_DIR)=$root_gen_dir" ],
12    "scope",
13    [ "../content_tests.gypi" ])
14
15# GYP version //content/content_tests.gypi:test_support_content
16static_library("test_support") {
17  testonly = true
18  public_deps = []
19  deps = [
20    "//cc/blink",
21    "//content/public/app:both",
22    "//content/public/browser:browser_sources",
23    "//content/public/common:common_sources",
24    "//net:test_support",
25    "//skia",
26    "//storage/common",
27    "//testing/gmock",
28    "//testing/gtest",
29    "//ui/accessibility:ax_gen",
30    "//ui/base",
31    "//ui/base:test_support",
32    "//ui/events:dom4_keycode_converter",
33    "//ui/events:events_base",
34    "//ui/events:test_support",
35    "//ui/events:gesture_detection",
36    "//ui/gfx:test_support",
37    "//ui/gl",
38    "//ui/resources",
39    "//url",
40  ]
41
42  if (!is_ios) {
43    sources = rebase_path(content_tests_gypi_values.test_support_content_sources,
44                          ".", "//content")
45
46    public_deps += [
47      "//third_party/WebKit/public:blink",
48    ]
49    deps += [
50      "//content/browser/speech/proto",
51      "//content/public/child:child_sources",
52      "//content/gpu",
53      "//content/public/renderer:renderer_sources",
54      "//content/public/utility:utility_sources",
55      "//content/shell:pak",
56      "//cc",
57      "//cc:test_support",
58      "//media",
59      "//ppapi:ppapi_host",
60      "//ppapi:ppapi_proxy",
61      "//ppapi:ppapi_shared",
62      "//ppapi:ppapi_unittest_shared",
63      "//storage/browser",
64      "//storage/common",
65      "//ui/surface",
66      "//v8",
67      "//webkit/common/gpu",
68    ]
69
70    if (enable_plugins) {
71      deps += [ "//content/ppapi_plugin" ]
72    }
73
74    if (enable_webrtc) {
75      # TODO(GYP) remove this when libjingle is converted.
76      configs += [ "//third_party/libjingle:jingle_direct_dependent_configs" ]
77
78      sources += [
79        "../renderer/media/mock_media_stream_dispatcher.cc",
80        "../renderer/media/mock_media_stream_dispatcher.h",
81        "../renderer/media/mock_peer_connection_impl.cc",
82        "../renderer/media/mock_peer_connection_impl.h",
83        "../renderer/media/mock_web_rtc_peer_connection_handler_client.cc",
84        "../renderer/media/mock_web_rtc_peer_connection_handler_client.h",
85        "../renderer/media/webrtc/mock_peer_connection_dependency_factory.cc",
86        "../renderer/media/webrtc/mock_peer_connection_dependency_factory.h",
87      ]
88
89      deps += [
90        #"//third_party/libjingle:webrtc",  TODO(GYP)
91        #"//third_party/libjingle:peerconnection",  TODO(GYP)
92        "//third_party/webrtc/modules/video_capture",
93      ]
94    }
95    if (!enable_plugins) {
96      sources -= [ "ppapi_unittest.cc" ]
97    }
98
99    if (use_glib) {
100      configs += [ "//build/config/linux:glib" ]
101    }
102
103    if (use_aura) {
104      deps += [
105        "//ui/aura:test_support",
106        "//ui/resources:ui_test_pak",
107        "//ui/wm",
108      ]
109    }
110
111    if (use_aura || is_mac) {
112      deps += [ "//ui/compositor" ]
113    }
114
115    if (is_win) {
116      deps += [ "//third_party/iaccessible2" ]
117    }
118
119    if (!is_android && !is_ios) {
120      deps += [ "//third_party/libvpx" ]
121    }
122
123    if (is_android) {
124      deps += [ "//ui/shell_dialogs" ]
125    }
126
127    if (is_win) {
128      deps += [ "//sandbox" ]
129    }
130  } else { # is_ios
131    sources = [
132      "public/test/content_test_suite_base.cc",
133      "public/test/mock_notification_observer.cc",
134      "public/test/mock_resource_context.cc",
135      "public/test/test_browser_thread.cc",
136      "public/test/test_content_client_initializer.cc",
137      "public/test/test_notification_tracker.cc",
138      "public/test/test_utils.cc",
139      "public/test/unittest_test_suite.cc",
140      "test/content_test_suite.cc",
141      "test/test_content_browser_client.cc",
142      "test/test_content_client.cc",
143    ]
144  }
145}
146
147if (!is_ios) {
148
149  # GYP version //content/content_tests.gypi:layouttest_support_content
150  static_library("layouttest_support") {
151    testonly = true
152    sources = rebase_path(content_tests_gypi_values.layouttest_support_content_sources,
153                          ".", "//content")
154
155    deps = [
156      ":test_support",
157      "//cc",
158      "//cc/blink",
159      "//content/public/common",
160      "//skia",
161      "//v8",
162      "//ui/accessibility:ax_gen",
163    ]
164
165    if (is_android) {
166      deps += [ ":jni" ]
167    }
168  }
169
170  if (is_android) {
171    import("//build/config/android/rules.gni")
172
173    generate_jni("jni") {
174      sources = [ "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java" ]
175      jni_package = "content/public/test"
176    }
177  }
178}  # !is_ios
179
180# TODO(GYP): Unit test targets
181
182