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