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 source_set("headless_renderer") { |
375 deps = [ | |
376 ":headless", | |
377 ] | |
378 if (!is_component_build) { | |
379 sources = [ | |
380 "lib/headless_content_main_delegate.cc", | |
381 "lib/headless_content_main_delegate.h", | |
382 "lib/renderer/headless_content_renderer_client.cc", | |
383 "lib/renderer/headless_content_renderer_client.h", | |
384 ] | |
385 deps += [ "//ui/base" ] | |
386 if (enable_basic_printing) { | |
387 deps += [ | |
388 "//components/printing/browser", | |
389 "//components/printing/renderer", | |
390 ] | |
391 } | |
392 configs += [ ":headless_implementation" ] | |
393 } | |
371 } | 394 } |
372 | 395 |
373 group("headless_tests") { | 396 group("headless_tests") { |
374 testonly = true | 397 testonly = true |
375 | 398 |
376 deps = [ | 399 deps = [ |
377 ":headless_browsertests", | 400 ":headless_browsertests", |
378 ":headless_example", | 401 ":headless_example", |
379 ":headless_unittests", | 402 ":headless_unittests", |
380 ] | 403 ] |
381 } | 404 } |
382 | 405 |
383 test("headless_unittests") { | 406 test("headless_unittests") { |
384 sources = [ | 407 sources = [ |
385 "public/domains/types_unittest.cc", | 408 "public/domains/types_unittest.cc", |
386 "public/util/deterministic_dispatcher_test.cc", | 409 "public/util/deterministic_dispatcher_test.cc", |
387 "public/util/error_reporter_unittest.cc", | 410 "public/util/error_reporter_unittest.cc", |
388 "public/util/expedited_dispatcher_test.cc", | 411 "public/util/expedited_dispatcher_test.cc", |
389 "public/util/generic_url_request_job_test.cc", | 412 "public/util/generic_url_request_job_test.cc", |
390 "public/util/testing/fake_managed_dispatch_url_request_job.cc", | 413 "public/util/testing/fake_managed_dispatch_url_request_job.cc", |
391 "public/util/testing/fake_managed_dispatch_url_request_job.h", | 414 "public/util/testing/fake_managed_dispatch_url_request_job.h", |
392 ] | 415 ] |
393 | 416 |
394 deps = [ | 417 deps = [ |
395 ":headless_lib", | 418 ":headless", |
396 "//base/test:run_all_unittests", | 419 "//base/test:run_all_unittests", |
397 "//base/test:test_support", | 420 "//base/test:test_support", |
398 "//testing/gmock", | 421 "//testing/gmock", |
399 "//testing/gtest", | 422 "//testing/gtest", |
400 ] | 423 ] |
401 } | 424 } |
402 | 425 |
403 mojom("embedder_mojo_for_testing") { | 426 mojom("embedder_mojo_for_testing") { |
404 sources = [ | 427 sources = [ |
405 "lib/embedder_test.mojom", | 428 "lib/embedder_test.mojom", |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 "//third_party/skia/", | 482 "//third_party/skia/", |
460 "//third_party/tlslite/", | 483 "//third_party/tlslite/", |
461 "test/data/", | 484 "test/data/", |
462 ] | 485 ] |
463 | 486 |
464 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 487 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
465 | 488 |
466 deps = [ | 489 deps = [ |
467 ":embedder_mojo_for_testing", | 490 ":embedder_mojo_for_testing", |
468 ":headless_browser_tests_pak", | 491 ":headless_browser_tests_pak", |
492 ":headless_renderer", | |
469 "//base", | 493 "//base", |
470 "//content/test:test_support", | 494 "//content/test:test_support", |
471 "//headless:headless_lib", | |
472 "//testing/gmock", | 495 "//testing/gmock", |
473 "//testing/gtest", | 496 "//testing/gtest", |
474 ] | 497 ] |
475 } | 498 } |
476 | 499 |
477 static_library("headless_shell_lib") { | 500 static_library("headless_shell_browser_lib") { |
501 if (is_multi_dll_chrome) { | |
502 defines = [ "CHROME_MULTIPLE_DLL_BROWSER" ] | |
503 } | |
504 | |
478 sources = [ | 505 sources = [ |
479 "app/headless_shell.cc", | 506 "app/headless_shell.cc", |
480 "app/headless_shell.h", | 507 "app/headless_shell.h", |
alex clarke (OOO till 29th)
2017/04/19 07:47:09
Please add a comment explaining why these three ta
dvallet
2017/04/20 01:05:09
Thanks Alex! I added some documentation
| |
481 "app/headless_shell_switches.cc", | 508 "app/headless_shell_switches.cc", |
482 "app/headless_shell_switches.h", | 509 "app/headless_shell_switches.h", |
483 "app/shell_navigation_request.cc", | 510 "app/shell_navigation_request.cc", |
484 "app/shell_navigation_request.h", | 511 "app/shell_navigation_request.h", |
512 "lib/headless_content_main_delegate.cc", | |
513 "lib/headless_content_main_delegate.h", | |
514 "public/headless_shell.h", | |
515 ] | |
516 | |
517 deps = [ | |
518 ":headless", | |
519 "//content/public/browser", | |
520 "//content/public/common", | |
521 ] | |
522 | |
523 if (is_win) { | |
524 deps += [ | |
525 "//content:sandbox_helper_win", | |
526 "//sandbox", | |
527 ] | |
528 } | |
529 | |
530 configs += [ ":headless_implementation" ] | |
531 } | |
532 | |
533 static_library("headless_shell_child_lib") { | |
534 if (is_multi_dll_chrome) { | |
535 defines = [ "CHROME_MULTIPLE_DLL_CHILD" ] | |
536 } | |
537 | |
538 sources = [ | |
539 "app/headless_shell.cc", | |
540 "app/headless_shell.h", | |
541 "app/headless_shell_switches.cc", | |
542 "app/headless_shell_switches.h", | |
543 "app/shell_navigation_request.cc", | |
544 "app/shell_navigation_request.h", | |
545 "lib/headless_content_main_delegate.cc", | |
546 "lib/headless_content_main_delegate.h", | |
547 "public/headless_shell.h", | |
548 ] | |
549 | |
550 deps = [ | |
551 ":headless_renderer", | |
552 "//content/public/child:child", | |
553 "//ui/base", | |
554 ] | |
555 | |
556 configs += [ ":headless_implementation" ] | |
557 } | |
558 | |
559 static_library("headless_shell_lib") { | |
560 sources = [ | |
561 "app/headless_shell.cc", | |
562 "app/headless_shell.h", | |
563 "app/headless_shell_switches.cc", | |
564 "app/headless_shell_switches.h", | |
565 "app/shell_navigation_request.cc", | |
566 "app/shell_navigation_request.h", | |
485 "public/headless_shell.h", | 567 "public/headless_shell.h", |
486 ] | 568 ] |
487 | 569 |
488 deps = [ | 570 deps = [ |
489 "//headless:headless_lib", | 571 ":headless_renderer", |
572 "//content/public/app:both", | |
573 "//content/public/browser", | |
574 "//content/public/child:child", | |
575 "//content/public/common", | |
490 ] | 576 ] |
491 | 577 |
492 configs += [ ":headless_implementation" ] | 578 if (is_win) { |
579 deps += [ | |
580 "//content:sandbox_helper_win", | |
581 "//sandbox", | |
582 ] | |
583 } | |
493 } | 584 } |
494 | 585 |
495 executable("headless_shell") { | 586 executable("headless_shell") { |
496 sources = [ | 587 sources = [ |
497 "app/headless_shell_main.cc", | 588 "app/headless_shell_main.cc", |
498 ] | 589 ] |
499 | 590 |
500 deps = [ | 591 deps = [ |
501 "//headless:headless_shell_lib", | 592 ":headless_shell_lib", |
502 ] | 593 ] |
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 } | 594 } |
514 | 595 |
515 process_version("version_header") { | 596 process_version("version_header") { |
516 template_file = "public/version.h.in" | 597 template_file = "public/version.h.in" |
517 sources = [ | 598 sources = [ |
518 "//build/util/LASTCHANGE", | 599 "//build/util/LASTCHANGE", |
519 "//chrome/VERSION", | 600 "//chrome/VERSION", |
520 ] | 601 ] |
521 output = "$target_gen_dir/public/version.h" | 602 output = "$target_gen_dir/public/version.h" |
522 } | 603 } |
523 | 604 |
524 executable("headless_example") { | 605 executable("headless_example") { |
525 sources = [ | 606 sources = [ |
526 "app/headless_example.cc", | 607 "app/headless_example.cc", |
527 ] | 608 ] |
528 | 609 |
529 deps = [ | 610 deps = [ |
530 "//headless:headless_shell_lib", | 611 ":headless_shell_lib", |
531 ] | 612 ] |
532 } | 613 } |
OLD | NEW |