OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
6 import("//headless/headless.gni") | 6 import("//headless/headless.gni") |
7 import("//build/util/process_version.gni") | 7 import("//build/util/process_version.gni") |
8 import("//mojo/public/tools/bindings/mojom.gni") | 8 import("//mojo/public/tools/bindings/mojom.gni") |
9 import("//printing/features/features.gni") | 9 import("//printing/features/features.gni") |
10 import("//testing/test.gni") | 10 import("//testing/test.gni") |
11 import("//tools/grit/grit_rule.gni") | 11 import("//tools/grit/grit_rule.gni") |
12 import("//tools/grit/repack.gni") | 12 import("//tools/grit/repack.gni") |
13 | 13 |
14 config("headless_implementation") { | 14 config("headless_implementation") { |
15 defines = [ "HEADLESS_IMPLEMENTATION" ] | 15 defines = [ "HEADLESS_IMPLEMENTATION" ] |
16 | 16 |
17 if (headless_use_embedded_resources) { | 17 if (headless_use_embedded_resources) { |
18 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] | 18 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 group("headless") { | 22 group("headless") { |
23 deps = [ | 23 deps = [ |
24 "//headless:headless_lib", | 24 "//headless:headless_lib", |
25 ] | 25 ] |
26 } | 26 } |
27 | 27 |
28 repack_locales("locale_pak") { | |
29 input_locales = [ "en-US" ] | |
30 | |
31 if (!is_mac) { | |
32 output_locales = [ "en-US" ] | |
33 } else { | |
34 output_locales = [ "locale" ] | |
35 } | |
36 | |
37 source_patterns = [ | |
38 "$root_gen_dir/ui/strings/app_locale_settings_", | |
39 "$root_gen_dir/ui/strings/ui_strings_", | |
40 ] | |
41 | |
42 deps = [ | |
43 "//ui/strings", | |
44 ] | |
45 | |
46 output_dir = "$root_out_dir/headless_locales" | |
47 } | |
48 | |
28 repack("pak") { | 49 repack("pak") { |
29 sources = [ | 50 sources = [ |
30 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak" , | 51 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak" , |
31 "$root_gen_dir/blink/public/resources/blink_resources.pak", | 52 "$root_gen_dir/blink/public/resources/blink_resources.pak", |
53 "$root_gen_dir/components/components_resources.pak", | |
32 "$root_gen_dir/components/strings/components_strings_en-US.pak", | 54 "$root_gen_dir/components/strings/components_strings_en-US.pak", |
33 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", | 55 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", |
34 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", | 56 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", |
35 "$root_gen_dir/content/browser/devtools/devtools_resources.pak", | 57 "$root_gen_dir/content/browser/devtools/devtools_resources.pak", |
36 "$root_gen_dir/content/browser/tracing/tracing_resources.pak", | 58 "$root_gen_dir/content/browser/tracing/tracing_resources.pak", |
37 "$root_gen_dir/content/content_resources.pak", | 59 "$root_gen_dir/content/content_resources.pak", |
38 "$root_gen_dir/headless/headless_lib_resources.pak", | 60 "$root_gen_dir/headless/headless_lib_resources.pak", |
39 "$root_gen_dir/net/net_resources.pak", | 61 "$root_gen_dir/net/net_resources.pak", |
40 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", | 62 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", |
41 "$root_gen_dir/ui/resources/webui_resources.pak", | 63 "$root_gen_dir/ui/resources/webui_resources.pak", |
42 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", | 64 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", |
43 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", | 65 "$root_gen_dir/ui/strings/ui_strings_en-US.pak", |
44 ] | 66 ] |
45 | 67 |
46 if (is_chrome_branded) { | 68 if (is_chrome_branded) { |
47 sources += [ "${root_gen_dir}/components/strings/components_google_chrome_st rings_en-US.pak" ] | 69 sources += [ "${root_gen_dir}/components/strings/components_google_chrome_st rings_en-US.pak" ] |
48 } else { | 70 } else { |
49 sources += [ "${root_gen_dir}/components/strings/components_chromium_strings _en-US.pak" ] | 71 sources += [ "${root_gen_dir}/components/strings/components_chromium_strings _en-US.pak" ] |
50 } | 72 } |
51 | 73 |
52 deps = [ | 74 deps = [ |
53 ":resources", | 75 ":resources", |
76 "//components/resources:components_resources", | |
54 "//components/strings", | 77 "//components/strings", |
55 "//content:resources", | 78 "//content:resources", |
56 "//content/app/resources", | 79 "//content/app/resources", |
57 "//content/app/strings", | 80 "//content/app/strings", |
58 "//content/browser/devtools:resources", | 81 "//content/browser/devtools:resources", |
59 "//content/browser/tracing:resources", | 82 "//content/browser/tracing:resources", |
60 "//net:net_resources", | 83 "//net:net_resources", |
61 "//third_party/WebKit/public:image_resources", | 84 "//third_party/WebKit/public:image_resources", |
62 "//third_party/WebKit/public:resources", | 85 "//third_party/WebKit/public:resources", |
63 "//ui/resources", | 86 "//ui/resources", |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 | 218 |
196 args = [ | 219 args = [ |
197 "--protocol", | 220 "--protocol", |
198 rebase_path(inputs[0], root_build_dir), | 221 rebase_path(inputs[0], root_build_dir), |
199 "--output_dir", | 222 "--output_dir", |
200 rebase_path(target_gen_dir) + "/public", | 223 rebase_path(target_gen_dir) + "/public", |
201 ] | 224 ] |
202 } | 225 } |
203 | 226 |
204 static_library("headless_lib") { | 227 static_library("headless_lib") { |
228 if (enable_basic_printing) { | |
229 defines = [ "PRINTING_IMPLEMENTATION" ] | |
Lei Zhang
2017/04/27 22:17:46
This doesn't look right. This is not printing/.
jzfeng
2017/05/02 07:50:56
Done. For some reason, I added this for unittest.
| |
230 } | |
205 sources = generated_devtools_api + [ | 231 sources = generated_devtools_api + [ |
206 "app/headless_shell_switches.cc", | 232 "app/headless_shell_switches.cc", |
207 "app/headless_shell_switches.h", | 233 "app/headless_shell_switches.h", |
208 "lib/browser/headless_browser_context_impl.cc", | 234 "lib/browser/headless_browser_context_impl.cc", |
209 "lib/browser/headless_browser_context_impl.h", | 235 "lib/browser/headless_browser_context_impl.h", |
210 "lib/browser/headless_browser_context_options.cc", | 236 "lib/browser/headless_browser_context_options.cc", |
211 "lib/browser/headless_browser_context_options.h", | 237 "lib/browser/headless_browser_context_options.h", |
212 "lib/browser/headless_browser_impl.cc", | 238 "lib/browser/headless_browser_impl.cc", |
213 "lib/browser/headless_browser_impl.h", | 239 "lib/browser/headless_browser_impl.h", |
214 "lib/browser/headless_browser_impl_mac.mm", | 240 "lib/browser/headless_browser_impl_mac.mm", |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 ] | 343 ] |
318 } | 344 } |
319 | 345 |
320 public_deps = [ | 346 public_deps = [ |
321 "//base", | 347 "//base", |
322 "//net", | 348 "//net", |
323 ] | 349 ] |
324 | 350 |
325 deps = [ | 351 deps = [ |
326 ":gen_devtools_client_api", | 352 ":gen_devtools_client_api", |
353 ":locale_pak", | |
327 ":tab_socket", | 354 ":tab_socket", |
328 ":version_header", | 355 ":version_header", |
329 "//components/crash/content/browser", | 356 "//components/crash/content/browser", |
330 "//components/security_state/content", | 357 "//components/security_state/content", |
331 "//components/security_state/core", | 358 "//components/security_state/core", |
332 "//content/public/app:both", | 359 "//content/public/app:both", |
333 "//content/public/browser", | 360 "//content/public/browser", |
334 "//content/public/child:child", | 361 "//content/public/child:child", |
335 "//content/public/common", | 362 "//content/public/common", |
336 "//content/public/common:service_names", | 363 "//content/public/common:service_names", |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 } | 401 } |
375 | 402 |
376 group("headless_tests") { | 403 group("headless_tests") { |
377 testonly = true | 404 testonly = true |
378 | 405 |
379 deps = [ | 406 deps = [ |
380 ":headless_browsertests", | 407 ":headless_browsertests", |
381 ":headless_example", | 408 ":headless_example", |
382 ":headless_unittests", | 409 ":headless_unittests", |
383 ] | 410 ] |
411 | |
412 if (enable_basic_printing) { | |
413 deps += [ ":headless_printing_unittests" ] | |
414 } | |
384 } | 415 } |
385 | 416 |
386 test("headless_unittests") { | 417 test("headless_unittests") { |
387 sources = [ | 418 sources = [ |
388 "public/domains/types_unittest.cc", | 419 "public/domains/types_unittest.cc", |
389 "public/util/deterministic_dispatcher_test.cc", | 420 "public/util/deterministic_dispatcher_test.cc", |
390 "public/util/error_reporter_unittest.cc", | 421 "public/util/error_reporter_unittest.cc", |
391 "public/util/expedited_dispatcher_test.cc", | 422 "public/util/expedited_dispatcher_test.cc", |
392 "public/util/generic_url_request_job_test.cc", | 423 "public/util/generic_url_request_job_test.cc", |
393 "public/util/testing/fake_managed_dispatch_url_request_job.cc", | 424 "public/util/testing/fake_managed_dispatch_url_request_job.cc", |
394 "public/util/testing/fake_managed_dispatch_url_request_job.h", | 425 "public/util/testing/fake_managed_dispatch_url_request_job.h", |
395 ] | 426 ] |
396 | 427 |
397 deps = [ | 428 deps = [ |
398 ":headless_lib", | 429 ":headless_lib", |
399 "//base/test:run_all_unittests", | 430 "//base/test:run_all_unittests", |
400 "//base/test:test_support", | 431 "//base/test:test_support", |
401 "//testing/gmock", | 432 "//testing/gmock", |
402 "//testing/gtest", | 433 "//testing/gtest", |
403 ] | 434 ] |
404 } | 435 } |
405 | 436 |
437 if (enable_basic_printing) { | |
438 test("headless_printing_unittests") { | |
Lei Zhang
2017/04/27 22:17:46
I think you just want to add your test to headless
jzfeng
2017/05/02 07:50:56
Done.
| |
439 sources = [ | |
440 "lib/browser/headless_printing_unittest.cc", | |
441 ] | |
442 | |
443 deps = [ | |
444 ":headless_lib", | |
445 "//base/test:run_all_unittests", | |
446 "//content/public/common", | |
447 "//testing/gtest", | |
448 ] | |
449 } | |
450 } | |
451 | |
406 mojom("embedder_mojo_for_testing") { | 452 mojom("embedder_mojo_for_testing") { |
407 sources = [ | 453 sources = [ |
408 "lib/embedder_test.mojom", | 454 "lib/embedder_test.mojom", |
409 ] | 455 ] |
410 } | 456 } |
411 | 457 |
412 grit("headless_browsertest_resources_grit") { | 458 grit("headless_browsertest_resources_grit") { |
413 source = "lib/headless_browsertest_resources.grd" | 459 source = "lib/headless_browsertest_resources.grd" |
414 outputs = [ | 460 outputs = [ |
415 "grit/headless_browsertest_resources.h", | 461 "grit/headless_browsertest_resources.h", |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 | 592 |
547 executable("headless_example") { | 593 executable("headless_example") { |
548 sources = [ | 594 sources = [ |
549 "app/headless_example.cc", | 595 "app/headless_example.cc", |
550 ] | 596 ] |
551 | 597 |
552 deps = [ | 598 deps = [ |
553 "//headless:headless_shell_lib", | 599 "//headless:headless_shell_lib", |
554 ] | 600 ] |
555 } | 601 } |
OLD | NEW |