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_lib") { | 22 group("headless") { |
23 deps = [ | 23 deps = [ |
24 "//headless:headless", | 24 "//headless:headless_lib", |
25 ] | 25 ] |
26 } | 26 } |
27 | 27 |
28 repack("pak") { | 28 repack("pak") { |
29 sources = [ | 29 sources = [ |
30 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak"
, | 30 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak"
, |
31 "$root_gen_dir/blink/public/resources/blink_resources.pak", | 31 "$root_gen_dir/blink/public/resources/blink_resources.pak", |
32 "$root_gen_dir/components/strings/components_strings_en-US.pak", | 32 "$root_gen_dir/components/strings/components_strings_en-US.pak", |
33 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", | 33 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", |
34 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", | 34 "$root_gen_dir/content/app/strings/content_strings_en-US.pak", |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 ] | 194 ] |
195 | 195 |
196 args = [ | 196 args = [ |
197 "--protocol", | 197 "--protocol", |
198 rebase_path(inputs[0], root_build_dir), | 198 rebase_path(inputs[0], root_build_dir), |
199 "--output_dir", | 199 "--output_dir", |
200 rebase_path(target_gen_dir) + "/public", | 200 rebase_path(target_gen_dir) + "/public", |
201 ] | 201 ] |
202 } | 202 } |
203 | 203 |
204 component("headless") { | 204 static_library("headless_lib") { |
205 sources = generated_devtools_api + [ | 205 sources = generated_devtools_api + [ |
206 "app/headless_shell_switches.cc", | 206 "app/headless_shell_switches.cc", |
207 "app/headless_shell_switches.h", | 207 "app/headless_shell_switches.h", |
208 "lib/browser/headless_browser_context_impl.cc", | 208 "lib/browser/headless_browser_context_impl.cc", |
209 "lib/browser/headless_browser_context_impl.h", | 209 "lib/browser/headless_browser_context_impl.h", |
210 "lib/browser/headless_browser_context_options.cc", | 210 "lib/browser/headless_browser_context_options.cc", |
211 "lib/browser/headless_browser_context_options.h", | 211 "lib/browser/headless_browser_context_options.h", |
212 "lib/browser/headless_browser_impl.cc", | 212 "lib/browser/headless_browser_impl.cc", |
213 "lib/browser/headless_browser_impl.h", | 213 "lib/browser/headless_browser_impl.h", |
214 "lib/browser/headless_browser_impl_mac.mm", | 214 "lib/browser/headless_browser_impl_mac.mm", |
(...skipping 21 matching lines...) Expand all Loading... |
236 "lib/browser/headless_tab_socket_impl.h", | 236 "lib/browser/headless_tab_socket_impl.h", |
237 "lib/browser/headless_url_request_context_getter.cc", | 237 "lib/browser/headless_url_request_context_getter.cc", |
238 "lib/browser/headless_url_request_context_getter.h", | 238 "lib/browser/headless_url_request_context_getter.h", |
239 "lib/browser/headless_web_contents_impl.cc", | 239 "lib/browser/headless_web_contents_impl.cc", |
240 "lib/browser/headless_web_contents_impl.h", | 240 "lib/browser/headless_web_contents_impl.h", |
241 "lib/browser/headless_window_tree_host.h", | 241 "lib/browser/headless_window_tree_host.h", |
242 "lib/headless_crash_reporter_client.cc", | 242 "lib/headless_crash_reporter_client.cc", |
243 "lib/headless_crash_reporter_client.h", | 243 "lib/headless_crash_reporter_client.h", |
244 "lib/headless_content_client.cc", | 244 "lib/headless_content_client.cc", |
245 "lib/headless_content_client.h", | 245 "lib/headless_content_client.h", |
| 246 "lib/headless_content_main_delegate.cc", |
| 247 "lib/headless_content_main_delegate.h", |
| 248 "lib/renderer/headless_content_renderer_client.cc", |
| 249 "lib/renderer/headless_content_renderer_client.h", |
246 "public/headless_browser.cc", | 250 "public/headless_browser.cc", |
247 "public/headless_browser.h", | 251 "public/headless_browser.h", |
248 "public/headless_browser_context.h", | 252 "public/headless_browser_context.h", |
249 "public/headless_devtools_client.h", | 253 "public/headless_devtools_client.h", |
250 "public/headless_devtools_host.h", | 254 "public/headless_devtools_host.h", |
251 "public/headless_devtools_target.h", | 255 "public/headless_devtools_target.h", |
252 "public/headless_export.h", | 256 "public/headless_export.h", |
253 "public/headless_web_contents.h", | 257 "public/headless_web_contents.h", |
254 "public/internal/message_dispatcher.h", | 258 "public/internal/message_dispatcher.h", |
255 "public/internal/value_conversions.h", | 259 "public/internal/value_conversions.h", |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 "//net", | 320 "//net", |
317 ] | 321 ] |
318 | 322 |
319 deps = [ | 323 deps = [ |
320 ":gen_devtools_client_api", | 324 ":gen_devtools_client_api", |
321 ":tab_socket", | 325 ":tab_socket", |
322 ":version_header", | 326 ":version_header", |
323 "//components/crash/content/browser", | 327 "//components/crash/content/browser", |
324 "//components/security_state/content", | 328 "//components/security_state/content", |
325 "//components/security_state/core", | 329 "//components/security_state/core", |
| 330 "//content/public/app:both", |
| 331 "//content/public/browser", |
| 332 "//content/public/child:child", |
326 "//content/public/common", | 333 "//content/public/common", |
327 "//content/public/common:service_names", | 334 "//content/public/common:service_names", |
328 "//services/service_manager/public/cpp", | 335 "//services/service_manager/public/cpp", |
329 "//third_party/mesa:osmesa", | 336 "//third_party/mesa:osmesa", |
330 "//ui/base", | 337 "//ui/base", |
331 "//ui/compositor", | 338 "//ui/compositor", |
332 "//ui/display", | 339 "//ui/display", |
333 "//ui/events/devices", | 340 "//ui/events/devices", |
334 "//url", | 341 "//url", |
335 ] | 342 ] |
336 | 343 |
337 if (is_component_build) { | |
338 sources += [ | |
339 "lib/headless_content_main_delegate.cc", | |
340 "lib/headless_content_main_delegate.h", | |
341 "lib/renderer/headless_content_renderer_client.cc", | |
342 "lib/renderer/headless_content_renderer_client.h", | |
343 ] | |
344 | |
345 if (enable_basic_printing) { | |
346 deps += [ | |
347 "//components/printing/browser", | |
348 "//components/printing/renderer", | |
349 ] | |
350 } | |
351 } | |
352 | |
353 if (is_mac) { | 344 if (is_mac) { |
354 deps += [ ":mac_helpers" ] | 345 deps += [ ":mac_helpers" ] |
355 } else { | 346 } else { |
356 deps += [ "//ui/aura" ] | 347 deps += [ "//ui/aura" ] |
357 } | 348 } |
358 | 349 |
| 350 if (enable_basic_printing) { |
| 351 deps += [ |
| 352 "//components/printing/browser", |
| 353 "//components/printing/renderer", |
| 354 ] |
| 355 } |
| 356 |
359 if (headless_use_embedded_resources) { | 357 if (headless_use_embedded_resources) { |
360 deps += [ ":embed_resources" ] | 358 deps += [ ":embed_resources" ] |
361 sources += [ | 359 sources += [ |
362 "$root_gen_dir/headless/embedded_resource_pak.cc", | 360 "$root_gen_dir/headless/embedded_resource_pak.cc", |
363 "$root_gen_dir/headless/embedded_resource_pak.h", | 361 "$root_gen_dir/headless/embedded_resource_pak.h", |
364 ] | 362 ] |
365 } else { | 363 } else { |
366 deps += [ ":pak" ] | 364 deps += [ ":pak" ] |
367 } | 365 } |
368 | 366 |
369 if (use_ozone) { | 367 if (use_ozone) { |
370 deps += [ "//ui/ozone" ] | 368 deps += [ "//ui/ozone" ] |
371 } | 369 } |
| 370 |
372 configs += [ ":headless_implementation" ] | 371 configs += [ ":headless_implementation" ] |
373 } | 372 } |
374 | 373 |
375 # Headless renderer is a convenience source set that includes headless classes | |
376 # that depend on the reenderer. These are not added in case of a component build | |
377 # since in that case they are already included in the headless component. | |
378 source_set("headless_renderer") { | |
379 deps = [ | |
380 ":headless", | |
381 ] | |
382 if (!is_component_build) { | |
383 sources = [ | |
384 "lib/headless_content_main_delegate.cc", | |
385 "lib/headless_content_main_delegate.h", | |
386 "lib/renderer/headless_content_renderer_client.cc", | |
387 "lib/renderer/headless_content_renderer_client.h", | |
388 ] | |
389 deps += [ "//ui/base" ] | |
390 if (enable_basic_printing) { | |
391 deps += [ | |
392 "//components/printing/browser", | |
393 "//components/printing/renderer", | |
394 ] | |
395 } | |
396 configs += [ ":headless_implementation" ] | |
397 } | |
398 } | |
399 | |
400 group("headless_tests") { | 374 group("headless_tests") { |
401 testonly = true | 375 testonly = true |
402 | 376 |
403 deps = [ | 377 deps = [ |
404 ":headless_browsertests", | 378 ":headless_browsertests", |
405 ":headless_example", | 379 ":headless_example", |
406 ":headless_unittests", | 380 ":headless_unittests", |
407 ] | 381 ] |
408 } | 382 } |
409 | 383 |
410 test("headless_unittests") { | 384 test("headless_unittests") { |
411 sources = [ | 385 sources = [ |
412 "public/domains/types_unittest.cc", | 386 "public/domains/types_unittest.cc", |
413 "public/util/deterministic_dispatcher_test.cc", | 387 "public/util/deterministic_dispatcher_test.cc", |
414 "public/util/error_reporter_unittest.cc", | 388 "public/util/error_reporter_unittest.cc", |
415 "public/util/expedited_dispatcher_test.cc", | 389 "public/util/expedited_dispatcher_test.cc", |
416 "public/util/generic_url_request_job_test.cc", | 390 "public/util/generic_url_request_job_test.cc", |
417 "public/util/testing/fake_managed_dispatch_url_request_job.cc", | 391 "public/util/testing/fake_managed_dispatch_url_request_job.cc", |
418 "public/util/testing/fake_managed_dispatch_url_request_job.h", | 392 "public/util/testing/fake_managed_dispatch_url_request_job.h", |
419 ] | 393 ] |
420 | 394 |
421 deps = [ | 395 deps = [ |
422 ":headless", | 396 ":headless_lib", |
423 "//base/test:run_all_unittests", | 397 "//base/test:run_all_unittests", |
424 "//base/test:test_support", | 398 "//base/test:test_support", |
425 "//testing/gmock", | 399 "//testing/gmock", |
426 "//testing/gtest", | 400 "//testing/gtest", |
427 ] | 401 ] |
428 } | 402 } |
429 | 403 |
430 mojom("embedder_mojo_for_testing") { | 404 mojom("embedder_mojo_for_testing") { |
431 sources = [ | 405 sources = [ |
432 "lib/embedder_test.mojom", | 406 "lib/embedder_test.mojom", |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 480 |
507 if (is_mac) { | 481 if (is_mac) { |
508 data += [ "$root_out_dir/Helpers/crashpad_handler" ] | 482 data += [ "$root_out_dir/Helpers/crashpad_handler" ] |
509 } | 483 } |
510 | 484 |
511 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 485 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
512 | 486 |
513 deps = [ | 487 deps = [ |
514 ":embedder_mojo_for_testing", | 488 ":embedder_mojo_for_testing", |
515 ":headless_browser_tests_pak", | 489 ":headless_browser_tests_pak", |
516 ":headless_renderer", | |
517 "//base", | 490 "//base", |
518 "//content/test:test_support", | 491 "//content/test:test_support", |
| 492 "//headless:headless_lib", |
519 "//testing/gmock", | 493 "//testing/gmock", |
520 "//testing/gtest", | 494 "//testing/gtest", |
521 ] | 495 ] |
522 } | 496 } |
523 | 497 |
524 # Headless library with only browser dependencies. This is used when no child | 498 static_library("headless_shell_lib") { |
525 # dependencies are needed in the target (e.g. chrome:main_dll). | |
526 static_library("headless_shell_browser_lib") { | |
527 if (is_multi_dll_chrome) { | |
528 defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ] | |
529 } | |
530 | |
531 sources = [ | 499 sources = [ |
532 "app/headless_shell.cc", | 500 "app/headless_shell.cc", |
533 "app/headless_shell.h", | 501 "app/headless_shell.h", |
534 "app/headless_shell_switches.cc", | |
535 "app/headless_shell_switches.h", | |
536 "app/shell_navigation_request.cc", | |
537 "app/shell_navigation_request.h", | |
538 "lib/headless_content_main_delegate.cc", | |
539 "lib/headless_content_main_delegate.h", | |
540 "public/headless_shell.h", | |
541 ] | |
542 | |
543 deps = [ | |
544 ":headless", | |
545 "//content/public/browser", | |
546 "//content/public/common", | |
547 ] | |
548 | |
549 if (is_win) { | |
550 deps += [ | |
551 "//content:sandbox_helper_win", | |
552 "//sandbox", | |
553 ] | |
554 } | |
555 | |
556 configs += [ ":headless_implementation" ] | |
557 } | |
558 | |
559 # Headless library with child specific dependencies (e.g., renderer). This | |
560 # is used when no browser depencendies are needed (e.g. chrome:child_dll). | |
561 static_library("headless_shell_child_lib") { | |
562 if (is_multi_dll_chrome) { | |
563 defines = [ "CHROME_MULTIPLE_DLL_CHILD" ] | |
564 } | |
565 | |
566 sources = [ | |
567 "app/headless_shell.cc", | |
568 "app/headless_shell.h", | |
569 "app/headless_shell_switches.cc", | 502 "app/headless_shell_switches.cc", |
570 "app/headless_shell_switches.h", | 503 "app/headless_shell_switches.h", |
571 "app/shell_navigation_request.cc", | 504 "app/shell_navigation_request.cc", |
572 "app/shell_navigation_request.h", | 505 "app/shell_navigation_request.h", |
573 "lib/headless_content_main_delegate.cc", | |
574 "lib/headless_content_main_delegate.h", | |
575 "public/headless_shell.h", | |
576 ] | |
577 | |
578 deps = [ | |
579 ":headless_renderer", | |
580 "//content/public/child:child", | |
581 "//net", | |
582 "//ui/base", | |
583 ] | |
584 | |
585 configs += [ ":headless_implementation" ] | |
586 } | |
587 | |
588 # Headless library with all included dependencies. Use this library unless you | |
589 # have browser/child dependencies restrictions. | |
590 static_library("headless_shell_lib") { | |
591 sources = [ | |
592 "app/headless_shell.cc", | |
593 "app/headless_shell.h", | |
594 "app/headless_shell_switches.cc", | |
595 "app/headless_shell_switches.h", | |
596 "app/shell_navigation_request.cc", | |
597 "app/shell_navigation_request.h", | |
598 "public/headless_shell.h", | 506 "public/headless_shell.h", |
599 ] | 507 ] |
600 | 508 |
601 deps = [ | 509 deps = [ |
602 ":headless_renderer", | 510 "//headless:headless_lib", |
603 "//content/public/app:both", | |
604 "//content/public/browser", | |
605 "//content/public/child:child", | |
606 "//content/public/common", | |
607 ] | 511 ] |
608 | 512 |
609 if (is_win) { | 513 configs += [ ":headless_implementation" ] |
610 deps += [ | |
611 "//content:sandbox_helper_win", | |
612 "//sandbox", | |
613 ] | |
614 } | |
615 } | 514 } |
616 | 515 |
617 executable("headless_shell") { | 516 executable("headless_shell") { |
618 sources = [ | 517 sources = [ |
619 "app/headless_shell_main.cc", | 518 "app/headless_shell_main.cc", |
620 ] | 519 ] |
621 | 520 |
622 deps = [ | 521 deps = [ |
623 ":headless_shell_lib", | 522 "//headless:headless_shell_lib", |
624 ] | 523 ] |
| 524 |
| 525 if (is_win) { |
| 526 deps += [ |
| 527 "//build/win:default_exe_manifest", |
| 528 "//content:sandbox_helper_win", |
| 529 "//sandbox", |
| 530 ] |
| 531 } |
| 532 |
| 533 configs += [ ":headless_implementation" ] |
625 } | 534 } |
626 | 535 |
627 process_version("version_header") { | 536 process_version("version_header") { |
628 template_file = "public/version.h.in" | 537 template_file = "public/version.h.in" |
629 sources = [ | 538 sources = [ |
630 "//build/util/LASTCHANGE", | 539 "//build/util/LASTCHANGE", |
631 "//chrome/VERSION", | 540 "//chrome/VERSION", |
632 ] | 541 ] |
633 output = "$target_gen_dir/public/version.h" | 542 output = "$target_gen_dir/public/version.h" |
634 } | 543 } |
635 | 544 |
636 executable("headless_example") { | 545 executable("headless_example") { |
637 sources = [ | 546 sources = [ |
638 "app/headless_example.cc", | 547 "app/headless_example.cc", |
639 ] | 548 ] |
640 | 549 |
641 deps = [ | 550 deps = [ |
642 ":headless_shell_lib", | 551 "//headless:headless_shell_lib", |
643 ] | 552 ] |
644 } | 553 } |
OLD | NEW |