Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: headless/BUILD.gn

Issue 2902583002: Add some closureised JS bindings for DevTools for use by headless embedder (Closed)
Patch Set: Try and fix python test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | headless/headless_browsertest_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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("//build/util/process_version.gni") 6 import("//build/util/process_version.gni")
7 import("//headless/headless.gni") 7 import("//headless/headless.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("//third_party/closure_compiler/compile_js.gni")
11 import("//tools/grit/grit_rule.gni") 12 import("//tools/grit/grit_rule.gni")
12 import("//tools/grit/repack.gni") 13 import("//tools/grit/repack.gni")
13 14
14 config("headless_implementation") { 15 config("headless_implementation") {
15 defines = [ "HEADLESS_IMPLEMENTATION" ] 16 defines = [ "HEADLESS_IMPLEMENTATION" ]
16 17
17 if (headless_use_embedded_resources) { 18 if (headless_use_embedded_resources) {
18 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ] 19 defines += [ "HEADLESS_USE_EMBEDDED_RESOURCES" ]
19 } 20 }
20 } 21 }
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 "page", 154 "page",
154 "profiler", 155 "profiler",
155 "runtime", 156 "runtime",
156 "security", 157 "security",
157 "service_worker", 158 "service_worker",
158 "target", 159 "target",
159 "tracing", 160 "tracing",
160 ] 161 ]
161 162
162 generated_devtools_api = [] 163 generated_devtools_api = []
164 generated_devtools_api_js = []
163 foreach(domain, devtools_domains) { 165 foreach(domain, devtools_domains) {
166 generated_devtools_api_js +=
167 [ "$target_gen_dir/public/devtools_js/" + domain + ".js" ]
164 generated_devtools_api += [ 168 generated_devtools_api += [
165 "$target_gen_dir/public/devtools/domains/" + domain + ".cc", 169 "$target_gen_dir/public/devtools/domains/" + domain + ".cc",
166 "$target_gen_dir/public/devtools/domains/" + domain + ".h", 170 "$target_gen_dir/public/devtools/domains/" + domain + ".h",
167 "$target_gen_dir/public/devtools/domains/types_" + domain + ".h", 171 "$target_gen_dir/public/devtools/domains/types_" + domain + ".h",
168 "$target_gen_dir/public/devtools/domains/types_" + domain + ".cc", 172 "$target_gen_dir/public/devtools/domains/types_" + domain + ".cc",
169 "$target_gen_dir/public/devtools/internal/type_conversions_" + domain + 173 "$target_gen_dir/public/devtools/internal/type_conversions_" + domain +
170 ".h", 174 ".h",
171 "$target_gen_dir/public/devtools/internal/" + 175 "$target_gen_dir/public/devtools/internal/" +
172 "types_forward_declarations_" + domain + ".h", 176 "types_forward_declarations_" + domain + ".h",
173 ] 177 ]
174 } 178 }
175 179
176 action("gen_devtools_client_api") { 180 action("gen_devtools_client_api") {
177 script = "lib/browser/devtools_api/client_api_generator.py" 181 script = "lib/browser/devtools_api/client_api_generator.py"
178 deps = [ 182 deps = [
179 "//third_party/WebKit/Source/core/inspector:protocol_version", 183 "//third_party/WebKit/Source/core/inspector:protocol_version",
180 ] 184 ]
181 inputs = [ 185 inputs = [
182 "$root_gen_dir/blink/core/inspector/protocol.json", 186 "$root_gen_dir/blink/core/inspector/protocol.json",
183 ] 187 ]
184 188
185 outputs = generated_devtools_api 189 outputs = generated_devtools_api + generated_devtools_api_js
186 190
187 sources = [ 191 sources = [
188 "lib/browser/devtools_api/domain_cc.template", 192 "lib/browser/devtools_api/domain_cc.template",
189 "lib/browser/devtools_api/domain_h.template", 193 "lib/browser/devtools_api/domain_h.template",
194 "lib/browser/devtools_api/domain_js.template",
190 "lib/browser/devtools_api/domain_type_conversions_h.template", 195 "lib/browser/devtools_api/domain_type_conversions_h.template",
191 "lib/browser/devtools_api/domain_types_cc.template", 196 "lib/browser/devtools_api/domain_types_cc.template",
192 "lib/browser/devtools_api/domain_types_forward_declarations_h.template", 197 "lib/browser/devtools_api/domain_types_forward_declarations_h.template",
193 "lib/browser/devtools_api/domain_types_h.template", 198 "lib/browser/devtools_api/domain_types_h.template",
194 ] 199 ]
195 200
196 args = [ 201 args = [
197 "--protocol", 202 "--protocol",
198 rebase_path(inputs[0], root_build_dir), 203 rebase_path(inputs[0], root_build_dir),
199 "--output_dir", 204 "--output_dir",
200 rebase_path(target_gen_dir, root_build_dir) + "/public", 205 rebase_path(target_gen_dir, root_build_dir) + "/public",
201 ] 206 ]
202 } 207 }
203 208
209 js_library("js_devtools_bindings_lib") {
210 sources = [ "lib/browser/devtools_api/devtools_connection.js" ] +
211 generated_devtools_api_js
212 deps = []
213 extra_deps = [ ":gen_devtools_client_api" ]
214 }
215
204 if (headless_fontconfig_utils) { 216 if (headless_fontconfig_utils) {
205 static_library("headless_fontconfig_utils") { 217 static_library("headless_fontconfig_utils") {
206 sources = [ 218 sources = [
207 "public/util/fontconfig.cc", 219 "public/util/fontconfig.cc",
208 "public/util/fontconfig.h", 220 "public/util/fontconfig.h",
209 ] 221 ]
210 222
211 deps = [ 223 deps = [
212 "//build/linux:fontconfig", 224 "//build/linux:fontconfig",
213 "//third_party/freetype", 225 "//third_party/freetype",
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 "//base", 512 "//base",
501 "//third_party/crashpad/crashpad/handler:crashpad_handler", 513 "//third_party/crashpad/crashpad/handler:crashpad_handler",
502 ] 514 ]
503 515
504 outputs = [ 516 outputs = [
505 "$root_out_dir/Helpers/{{source_file_part}}", 517 "$root_out_dir/Helpers/{{source_file_part}}",
506 ] 518 ]
507 } 519 }
508 } 520 }
509 521
522 if (!is_win) {
523 js_binary("js_devtools_bindings_test") {
524 sources = [
525 "test/bindings_test.js",
526 ]
527 deps = [
528 ":js_devtools_bindings_lib",
529 ]
530 externs_list = [ "lib/tab_socket_externs.js" ]
531 outputs = [
532 "$target_gen_dir/devtools_bindings_test.js",
533 ]
534 config_files = []
535 closure_flags = [
536 "jscomp_error=checkTypes",
537 "dependency_mode=STRICT",
538
539 # Currently the bindings do not support property renaming so we can't use
540 # ADVANCED_OPTIMIZATIONS here. We could add support via either moving all
541 # the types to externs, or via applying the same renaming to the json
542 # dictionaries sent between C++ and JS. The closure compiler can produce
543 # files which contain those mappings with the appropriate flag.
544 "compilation_level=SIMPLE",
545 "language_out=ES5_STRICT",
546 "entry_point=chromium.BindingsTest",
547 ]
548 }
549
550 grit("headless_browsertest_resources_grit") {
551 source = "headless_browsertest_resources.grd"
552 outputs = [
553 "grit/headless_browsertest_resources.h",
554 "$root_gen_dir/headless/headless_browsertest_resources.pak",
555 ]
556 grit_flags = [
557 "-E",
558 "gen_root=" + rebase_path(root_gen_dir),
559 ]
560 deps = [
561 ":js_devtools_bindings_test",
562 ]
563 resource_ids = "lib/headless_browsertest_resource_ids"
564 }
565
566 repack("headless_browser_tests_pak") {
567 sources = [
568 "$root_gen_dir/headless/headless_browsertest_resources.pak",
569 ]
570 output = "$root_out_dir/headless_browser_tests.pak"
571 deps = [
572 ":headless_browsertest_resources_grit",
573 ]
574 }
575 }
576
510 test("headless_browsertests") { 577 test("headless_browsertests") {
511 sources = [ 578 sources = [
512 "lib/frame_id_browsertest.cc", 579 "lib/frame_id_browsertest.cc",
513 "lib/headless_browser_browsertest.cc", 580 "lib/headless_browser_browsertest.cc",
514 "lib/headless_browser_context_browsertest.cc", 581 "lib/headless_browser_context_browsertest.cc",
515 "lib/headless_devtools_client_browsertest.cc", 582 "lib/headless_devtools_client_browsertest.cc",
516 "lib/headless_web_contents_browsertest.cc", 583 "lib/headless_web_contents_browsertest.cc",
517 "public/util/dom_tree_extractor_browsertest.cc", 584 "public/util/dom_tree_extractor_browsertest.cc",
518 "public/util/flat_dom_tree_extractor_browsertest.cc", 585 "public/util/flat_dom_tree_extractor_browsertest.cc",
519 "test/headless_browser_test.cc", 586 "test/headless_browser_test.cc",
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 deps = [ 620 deps = [
554 ":headless_renderer", 621 ":headless_renderer",
555 "//base", 622 "//base",
556 "//components/crash/content/browser", 623 "//components/crash/content/browser",
557 "//components/security_state/content", 624 "//components/security_state/content",
558 "//content/test:test_support", 625 "//content/test:test_support",
559 "//testing/gmock", 626 "//testing/gmock",
560 "//testing/gtest", 627 "//testing/gtest",
561 ] 628 ]
562 629
630 # The js_binary rule doesn't currently work on windows.
631 if (!is_win) {
632 data += [ "$root_out_dir/headless_browser_tests.pak" ]
633 sources += [ "test/headless_js_bindings_browsertest.cc" ]
634 deps += [ ":headless_browser_tests_pak" ]
635 }
636
563 if (enable_basic_printing) { 637 if (enable_basic_printing) {
564 deps += [ 638 deps += [
565 "//components/printing/browser", 639 "//components/printing/browser",
566 "//pdf", 640 "//pdf",
567 ] 641 ]
568 } 642 }
569 } 643 }
570 644
571 if (is_win) { 645 if (is_win) {
572 # Headless library with only browser dependencies. This is used when no child 646 # Headless library with only browser dependencies. This is used when no child
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 executable("headless_example") { 788 executable("headless_example") {
715 sources = [ 789 sources = [
716 "app/headless_example.cc", 790 "app/headless_example.cc",
717 ] 791 ]
718 792
719 deps = [ 793 deps = [
720 ":headless_shell_lib", 794 ":headless_shell_lib",
721 "//build/config:exe_and_shlib_deps", 795 "//build/config:exe_and_shlib_deps",
722 ] 796 ]
723 } 797 }
OLDNEW
« no previous file with comments | « no previous file | headless/headless_browsertest_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698