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