blob: 088d33731e6250a6652e275d4e4e9cc34db52223 [file] [log] [blame]
altimin168fe2a2015-12-02 15:35:211# Copyright 2015 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
skyostilfe116162016-02-26 20:53:335import("//testing/test.gni")
skyostil85c6b562016-03-02 16:13:056import("//tools/grit/grit_rule.gni")
skyostilfe116162016-02-26 20:53:337import("//tools/grit/repack.gni")
8
altimin168fe2a2015-12-02 15:35:219group("headless") {
10 deps = [
11 "//headless:headless_lib",
12 ]
13}
14
skyostilfe116162016-02-26 20:53:3315repack("pak") {
altimin168fe2a2015-12-02 15:35:2116 sources = [
skyostilfe116162016-02-26 20:53:3317 "$root_gen_dir/blink/devtools_resources.pak",
18 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
19 "$root_gen_dir/blink/public/resources/blink_resources.pak",
20 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
21 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
22 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
23 "$root_gen_dir/content/content_resources.pak",
skyostil85c6b562016-03-02 16:13:0524 "$root_gen_dir/headless/headless_lib_resources.pak",
skyostilfe116162016-02-26 20:53:3325 "$root_gen_dir/net/net_resources.pak",
26 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
27 "$root_gen_dir/ui/resources/webui_resources.pak",
28 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
29 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
altimin168fe2a2015-12-02 15:35:2130 ]
31
32 deps = [
skyostil85c6b562016-03-02 16:13:0533 ":headless_lib_resources_grit",
skyostilfe116162016-02-26 20:53:3334 "//content:resources",
35 "//content/app/resources",
36 "//content/app/strings",
37 "//content/browser/devtools:resources",
38 "//content/browser/tracing:resources",
39 "//net:net_resources",
40 "//third_party/WebKit/public:image_resources",
41 "//third_party/WebKit/public:resources",
42 "//ui/resources",
43 "//ui/strings",
44 ]
45
46 output = "$root_out_dir/headless_lib.pak"
47}
48
skyostil85c6b562016-03-02 16:13:0549grit("headless_lib_resources_grit") {
50 source = "lib/resources/headless_lib_resources.grd"
51 outputs = [
52 "grit/headless_lib_resources.h",
53 "$root_gen_dir/headless/headless_lib_resources.pak",
54 ]
55}
56
skyostilfe116162016-02-26 20:53:3357static_library("headless_lib") {
58 sources = [
59 "lib/browser/headless_browser_context.cc",
60 "lib/browser/headless_browser_context.h",
61 "lib/browser/headless_browser_impl.cc",
62 "lib/browser/headless_browser_impl.h",
63 "lib/browser/headless_browser_main_parts.cc",
64 "lib/browser/headless_browser_main_parts.h",
65 "lib/browser/headless_content_browser_client.cc",
66 "lib/browser/headless_content_browser_client.h",
67 "lib/browser/headless_devtools.cc",
68 "lib/browser/headless_devtools.h",
69 "lib/browser/headless_screen.cc",
70 "lib/browser/headless_screen.h",
71 "lib/browser/headless_url_request_context_getter.cc",
72 "lib/browser/headless_url_request_context_getter.h",
73 "lib/browser/headless_web_contents_impl.cc",
74 "lib/browser/headless_web_contents_impl.h",
75 "lib/headless_content_client.cc",
76 "lib/headless_content_client.h",
77 "lib/headless_content_main_delegate.cc",
78 "lib/headless_content_main_delegate.h",
79 "lib/renderer/headless_content_renderer_client.cc",
80 "lib/renderer/headless_content_renderer_client.h",
81 "lib/utility/headless_content_utility_client.cc",
82 "lib/utility/headless_content_utility_client.h",
83 "public/headless_browser.cc",
84 "public/headless_browser.h",
85 "public/headless_export.h",
86 "public/headless_web_contents.h",
skyostil8ad264e2016-04-11 16:23:0687 "public/util/error_reporter.cc",
88 "public/util/error_reporter.h",
skyostild79e1512016-04-07 17:50:5889 "public/util/maybe.h",
skyostilfe116162016-02-26 20:53:3390 ]
91
92 deps = [
93 ":pak",
altimin168fe2a2015-12-02 15:35:2194 "//base",
skyostilfe116162016-02-26 20:53:3395 "//components/devtools_http_handler",
skyostil185d8aa2016-04-05 11:36:3296 "//content/public/app:both",
skyostilfe116162016-02-26 20:53:3397 "//content/public/browser",
skyostil185d8aa2016-04-05 11:36:3298 "//content/public/child",
skyostilfe116162016-02-26 20:53:3399 "//content/public/common",
100 "//content/public/renderer",
101 "//content/public/utility",
102 "//net",
103 "//ui/aura",
104 "//ui/base",
105 "//ui/compositor",
106 "//ui/ozone",
107 "//url",
108 ]
109}
110
111group("headless_tests") {
112 testonly = true
113
114 deps = [
115 ":headless_browsertests",
skyostild79e1512016-04-07 17:50:58116 ":headless_unittests",
117 ]
118}
119
120test("headless_unittests") {
121 sources = [
skyostil8ad264e2016-04-11 16:23:06122 "public/util/error_reporter_unittest.cc",
skyostild79e1512016-04-07 17:50:58123 "public/util/maybe_unittest.cc",
124 ]
125
126 deps = [
skyostil8ad264e2016-04-11 16:23:06127 ":headless_lib",
skyostild79e1512016-04-07 17:50:58128 "//base/test:run_all_unittests",
129 "//base/test:test_support",
130 "//testing/gtest",
skyostilfe116162016-02-26 20:53:33131 ]
132}
133
134test("headless_browsertests") {
135 sources = [
136 "lib/headless_browser_browsertest.cc",
137 "lib/headless_web_contents_browsertest.cc",
138 "test/headless_browser_test.cc",
139 "test/headless_browser_test.h",
140 "test/headless_test_launcher.cc",
141 ]
142
143 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
144
145 deps = [
146 "//base",
147 "//content/test:browsertest_base",
148 "//content/test:test_support",
149 "//headless:headless_lib",
150 "//testing/gmock",
151 "//testing/gtest",
152 ]
153}
154
155executable("headless_shell") {
156 testonly = true
157
158 sources = [
159 "app/headless_shell.cc",
skyostilf52fa5b2016-03-15 11:38:45160 "app/headless_shell_switches.cc",
161 "app/headless_shell_switches.h",
skyostilfe116162016-02-26 20:53:33162 ]
163
164 deps = [
165 "//headless:headless_lib",
altimin168fe2a2015-12-02 15:35:21166 ]
167}