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/features.gni") | 5 import("//build/config/features.gni") |
6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
7 import("//chrome/test/base/js2gtest.gni") | 7 import("//chrome/test/base/js2gtest.gni") |
8 | 8 |
9 assert(is_chromeos) | 9 assert(is_chromeos) |
10 | 10 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 foreach(rule, rewrite_rules) { | 327 foreach(rule, rewrite_rules) { |
328 args += [ | 328 args += [ |
329 "-w", | 329 "-w", |
330 rule, | 330 rule, |
331 ] | 331 ] |
332 } | 332 } |
333 args += rebase_path(sources, root_build_dir) | 333 args += rebase_path(sources, root_build_dir) |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 chromevox_assets_gypi_values = | 337 chromevox_background_script_loader_file = "cvox2/background/loader.js" |
338 exec_script("//build/gypi_to_gn.py", | 338 chromevox_content_script_loader_file = "chromevox/injected/loader.js" |
339 [ rebase_path("chromevox_assets.gypi") ], | 339 chromevox_kbexplorer_loader_file = "chromevox/background/kbexplorer_loader.js" |
340 "scope", | 340 chromevox_min_content_script_loader_file = "cvox2/injected/loader.js" |
341 [ "chromevox_assets.gypi" ]) | 341 chromevox_options_script_loader_file = "chromevox/background/options_loader.js" |
342 | 342 chromevox_panel_script_loader_file = "cvox2/background/panel_loader.js" |
343 chromevox_vars_gypi_values = exec_script("//build/gypi_to_gn.py", | |
344 [ rebase_path("chromevox_vars.gypi") ], | |
345 "scope", | |
346 [ "chromevox_vars.gypi" ]) | |
347 | 343 |
348 # Instead of setting up one copy target for each subdirectory, use a script | 344 # Instead of setting up one copy target for each subdirectory, use a script |
349 # to copy all files. | 345 # to copy all files. |
350 run_jsbundler("chromevox_copied_files") { | 346 run_jsbundler("chromevox_copied_files") { |
351 mode = "copy" | 347 mode = "copy" |
352 dest_dir = chromevox_out_dir | 348 dest_dir = chromevox_out_dir |
353 sources = chromevox_assets_gypi_values.chromevox_assets_images | 349 sources = [ |
354 sources += | |
355 chromevox_assets_gypi_values.chromevox_assets_chromevox_background_earcons | |
356 sources += | |
357 chromevox_assets_gypi_values.chromevox_assets_chromevox_background_keymaps | |
358 sources += chromevox_assets_gypi_values.chromevox_assets_chromevox_background_
mathmaps_functions | |
359 sources += chromevox_assets_gypi_values.chromevox_assets_chromevox_background_
mathmaps_symbols | |
360 sources += | |
361 chromevox_assets_gypi_values.chromevox_assets_cvox2_background_earcons | |
362 sources += [ | |
363 "chromevox/background/background.html", | 350 "chromevox/background/background.html", |
| 351 "chromevox/background/earcons/alert_modal.ogg", |
| 352 "chromevox/background/earcons/alert_nonmodal.ogg", |
| 353 "chromevox/background/earcons/button.ogg", |
| 354 "chromevox/background/earcons/check_off.ogg", |
| 355 "chromevox/background/earcons/check_on.ogg", |
| 356 "chromevox/background/earcons/editable_text.ogg", |
| 357 "chromevox/background/earcons/invalid_keypress.ogg", |
| 358 "chromevox/background/earcons/link.ogg", |
| 359 "chromevox/background/earcons/list_item.ogg", |
| 360 "chromevox/background/earcons/listbox.ogg", |
| 361 "chromevox/background/earcons/long_desc.ogg", |
| 362 "chromevox/background/earcons/math.ogg", |
| 363 "chromevox/background/earcons/object_close.ogg", |
| 364 "chromevox/background/earcons/object_enter.ogg", |
| 365 "chromevox/background/earcons/object_exit.ogg", |
| 366 "chromevox/background/earcons/object_open.ogg", |
| 367 "chromevox/background/earcons/object_select.ogg", |
| 368 "chromevox/background/earcons/page_finish_loading.ogg", |
| 369 "chromevox/background/earcons/page_start_loading.ogg", |
| 370 "chromevox/background/earcons/recover_focus.ogg", |
| 371 "chromevox/background/earcons/selection.ogg", |
| 372 "chromevox/background/earcons/selection_reverse.ogg", |
| 373 "chromevox/background/earcons/skip.ogg", |
| 374 "chromevox/background/earcons/wrap.ogg", |
| 375 "chromevox/background/earcons/wrap_edge.ogg", |
364 "chromevox/background/kbexplorer.html", | 376 "chromevox/background/kbexplorer.html", |
| 377 "chromevox/background/keymaps/classic_keymap.json", |
| 378 "chromevox/background/keymaps/experimental.json", |
| 379 "chromevox/background/keymaps/flat_keymap.json", |
| 380 "chromevox/background/keymaps/next_keymap.json", |
| 381 "chromevox/background/mathmaps/functions/algebra.json", |
| 382 "chromevox/background/mathmaps/functions/elementary.json", |
| 383 "chromevox/background/mathmaps/functions/hyperbolic.json", |
| 384 "chromevox/background/mathmaps/functions/trigonometry.json", |
| 385 "chromevox/background/mathmaps/symbols/greek-capital.json", |
| 386 "chromevox/background/mathmaps/symbols/greek-mathfonts.json", |
| 387 "chromevox/background/mathmaps/symbols/greek-scripts.json", |
| 388 "chromevox/background/mathmaps/symbols/greek-small.json", |
| 389 "chromevox/background/mathmaps/symbols/greek-symbols.json", |
| 390 "chromevox/background/mathmaps/symbols/hebrew_letters.json", |
| 391 "chromevox/background/mathmaps/symbols/latin-lower-double-accent.json", |
| 392 "chromevox/background/mathmaps/symbols/latin-lower-normal.json", |
| 393 "chromevox/background/mathmaps/symbols/latin-lower-phonetic.json", |
| 394 "chromevox/background/mathmaps/symbols/latin-lower-single-accent.json", |
| 395 "chromevox/background/mathmaps/symbols/latin-mathfonts.json", |
| 396 "chromevox/background/mathmaps/symbols/latin-rest.json", |
| 397 "chromevox/background/mathmaps/symbols/latin-upper-double-accent.json", |
| 398 "chromevox/background/mathmaps/symbols/latin-upper-normal.json", |
| 399 "chromevox/background/mathmaps/symbols/latin-upper-single-accent.json", |
| 400 "chromevox/background/mathmaps/symbols/math_angles.json", |
| 401 "chromevox/background/mathmaps/symbols/math_arrows.json", |
| 402 "chromevox/background/mathmaps/symbols/math_characters.json", |
| 403 "chromevox/background/mathmaps/symbols/math_delimiters.json", |
| 404 "chromevox/background/mathmaps/symbols/math_digits.json", |
| 405 "chromevox/background/mathmaps/symbols/math_geometry.json", |
| 406 "chromevox/background/mathmaps/symbols/math_harpoons.json", |
| 407 "chromevox/background/mathmaps/symbols/math_non_characters.json", |
| 408 "chromevox/background/mathmaps/symbols/math_symbols.json", |
| 409 "chromevox/background/mathmaps/symbols/math_whitespace.json", |
| 410 "chromevox/background/mathmaps/symbols/other_stars.json", |
365 "chromevox/background/options.html", | 411 "chromevox/background/options.html", |
366 "chromevox/injected/api.js", | 412 "chromevox/injected/api.js", |
367 "cvox2/background/background.html", | 413 "cvox2/background/background.html", |
| 414 "cvox2/background/earcons/control.wav", |
| 415 "cvox2/background/earcons/selection.wav", |
| 416 "cvox2/background/earcons/selection_reverse.wav", |
| 417 "cvox2/background/earcons/skim.wav", |
| 418 "cvox2/background/earcons/small_room_2.wav", |
| 419 "cvox2/background/earcons/static.wav", |
368 "cvox2/background/panel.css", | 420 "cvox2/background/panel.css", |
369 "cvox2/background/panel.html", | 421 "cvox2/background/panel.html", |
| 422 "images/chromevox-128.png", |
| 423 "images/chromevox-16.png", |
| 424 "images/chromevox-19.png", |
| 425 "images/chromevox-48.png", |
| 426 "images/chromevox.svg", |
| 427 "images/close-19.png", |
| 428 "images/close-hover-19.png", |
| 429 "images/options-19.png", |
| 430 "images/options-hover-19.png", |
| 431 "images/triangle-6.png", |
370 ] | 432 ] |
371 if (chromevox_compress_js) { | 433 if (chromevox_compress_js) { |
372 sources += [ "chromevox/injected/api_util.js" ] | 434 sources += [ "chromevox/injected/api_util.js" ] |
373 } else { | 435 } else { |
374 sources += chromevox_modules | 436 sources += chromevox_modules |
375 sources += [ | 437 sources += [ |
376 "closure/closure_preinit.js", | 438 "closure/closure_preinit.js", |
377 chromevox_vars_gypi_values.chromevox_content_script_loader_file, | 439 chromevox_background_script_loader_file, |
378 chromevox_vars_gypi_values.chromevox_kbexplorer_loader_file, | 440 chromevox_content_script_loader_file, |
379 chromevox_vars_gypi_values.chromevox_options_script_loader_file, | 441 chromevox_kbexplorer_loader_file, |
380 chromevox_vars_gypi_values.chromevox_background_script_loader_file, | 442 chromevox_min_content_script_loader_file, |
381 chromevox_vars_gypi_values.chromevox_min_content_script_loader_file, | 443 chromevox_options_script_loader_file, |
382 chromevox_vars_gypi_values.chromevox_panel_script_loader_file, | 444 chromevox_panel_script_loader_file, |
383 ] | 445 ] |
384 } | 446 } |
385 if (!chromevox_compress_js) { | 447 if (!chromevox_compress_js) { |
386 sources += closure_library_modules | 448 sources += closure_library_modules |
387 } | 449 } |
388 rewrite_rules = [ | 450 rewrite_rules = [ |
389 rebase_path(".", root_build_dir) + ":", | 451 rebase_path(".", root_build_dir) + ":", |
390 rebase_path(closure_library_dir, root_build_dir) + ":closure", | 452 rebase_path(closure_library_dir, root_build_dir) + ":closure", |
391 ] | 453 ] |
392 } | 454 } |
393 | 455 |
394 template("manifest") { | 456 template("manifest") { |
395 version_file = "//chrome/VERSION" | 457 version_file = "//chrome/VERSION" |
396 version_script = "//build/util/version.py" | 458 version_script = "//build/util/version.py" |
397 template_file = "manifest.json.jinja2" | 459 template_file = "manifest.json.jinja2" |
398 output_file = invoker.output_file | 460 output_file = invoker.output_file |
399 key = chromevox_vars_gypi_values.chromevox_extension_key | 461 key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDltVl1k15pjRzuZfMc3B69inxwm2bZeZ2
O8/zFO+NluHnBm3GJ3fzdOoFGJd+M16I8p7zxxQyHeDMfWYASyCeB8XnUEDKjqNLQfCnncsANzHsYoEb
Yj2nEUML2P13b9q+AAvpCBpAJ4cZp81e9n1y/vbSXHE4385cgkKueItzikQIDAQAB" |
400 action(target_name) { | 462 action(target_name) { |
401 script = "tools/generate_manifest.py" | 463 script = "tools/generate_manifest.py" |
402 inputs = [ | 464 inputs = [ |
403 version_file, | 465 version_file, |
404 version_script, | 466 version_script, |
405 ] | 467 ] |
406 sources = [ | 468 sources = [ |
407 template_file, | 469 template_file, |
408 ] | 470 ] |
409 outputs = [ | 471 outputs = [ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 assert(defined(invoker.output_file)) | 534 assert(defined(invoker.output_file)) |
473 mode = "compressed_bundle" | 535 mode = "compressed_bundle" |
474 modules = chromevox_modules + closure_library_modules | 536 modules = chromevox_modules + closure_library_modules |
475 sources = invoker.sources | 537 sources = invoker.sources |
476 output_file = invoker.output_file | 538 output_file = invoker.output_file |
477 } | 539 } |
478 } | 540 } |
479 | 541 |
480 compress_js("chromevox_content_script") { | 542 compress_js("chromevox_content_script") { |
481 sources = [ | 543 sources = [ |
482 chromevox_vars_gypi_values.chromevox_content_script_loader_file, | 544 chromevox_content_script_loader_file, |
483 ] | 545 ] |
484 output_file = "$chromevox_out_dir/chromeVoxChromePageScript.js" | 546 output_file = "$chromevox_out_dir/chromeVoxChromePageScript.js" |
485 } | 547 } |
486 | 548 |
487 compress_js("chromevox_kbexplorer_script") { | 549 compress_js("chromevox_kbexplorer_script") { |
488 sources = [ | 550 sources = [ |
489 chromevox_vars_gypi_values.chromevox_kbexplorer_loader_file, | 551 chromevox_kbexplorer_loader_file, |
490 ] | 552 ] |
491 output_file = "$chromevox_out_dir/chromeVoxKbExplorerScript.js" | 553 output_file = "$chromevox_out_dir/chromeVoxKbExplorerScript.js" |
492 } | 554 } |
493 | 555 |
494 compress_js("chromevox_options_script") { | 556 compress_js("chromevox_options_script") { |
495 sources = [ | 557 sources = [ |
496 chromevox_vars_gypi_values.chromevox_options_script_loader_file, | 558 chromevox_options_script_loader_file, |
497 ] | 559 ] |
498 output_file = "$chromevox_out_dir/chromeVoxChromeOptionsScript.js" | 560 output_file = "$chromevox_out_dir/chromeVoxChromeOptionsScript.js" |
499 } | 561 } |
500 | 562 |
501 compress_js("chromevox_background_script") { | 563 compress_js("chromevox_background_script") { |
502 sources = [ | 564 sources = [ |
503 chromevox_vars_gypi_values.chromevox_background_script_loader_file, | 565 chromevox_background_script_loader_file, |
504 ] | 566 ] |
505 output_file = "$chromevox_out_dir/chromeVox2ChromeBackgroundScript.js" | 567 output_file = "$chromevox_out_dir/chromeVox2ChromeBackgroundScript.js" |
506 } | 568 } |
507 | 569 |
508 compress_js("chromevox_min_content_script") { | 570 compress_js("chromevox_min_content_script") { |
509 sources = [ | 571 sources = [ |
510 chromevox_vars_gypi_values.chromevox_min_content_script_loader_file, | 572 chromevox_min_content_script_loader_file, |
511 ] | 573 ] |
512 output_file = "$chromevox_out_dir/chromeVox2ChromePageScript.js" | 574 output_file = "$chromevox_out_dir/chromeVox2ChromePageScript.js" |
513 } | 575 } |
514 | 576 |
515 compress_js("chromevox_panel_script") { | 577 compress_js("chromevox_panel_script") { |
516 sources = [ | 578 sources = [ |
517 chromevox_vars_gypi_values.chromevox_panel_script_loader_file, | 579 chromevox_panel_script_loader_file, |
518 ] | 580 ] |
519 output_file = "$chromevox_out_dir/chromeVoxPanelScript.js" | 581 output_file = "$chromevox_out_dir/chromeVoxPanelScript.js" |
520 } | 582 } |
521 } else { | 583 } else { |
522 generate_deps_js("chromevox_deps_js") { | 584 generate_deps_js("chromevox_deps_js") { |
523 sources = chromevox_modules + closure_library_modules | 585 sources = chromevox_modules + closure_library_modules |
524 output_file = "$chromevox_out_dir/deps.js" | 586 output_file = "$chromevox_out_dir/deps.js" |
525 rewrite_rules = [ | 587 rewrite_rules = [ |
526 rebase_path(".", root_build_dir) + ":..", | 588 rebase_path(".", root_build_dir) + ":..", |
527 rebase_path(closure_library_dir, root_build_dir) + ":../closure", | 589 rebase_path(closure_library_dir, root_build_dir) + ":../closure", |
528 ] | 590 ] |
529 } | 591 } |
530 } | 592 } |
531 | 593 |
532 chromevox_tests_gypi_values = | |
533 exec_script("//build/gypi_to_gn.py", | |
534 [ rebase_path("chromevox_tests.gypi") ], | |
535 "scope", | |
536 [ "chromevox_tests.gypi" ]) | |
537 | |
538 test("chromevox_tests") { | 594 test("chromevox_tests") { |
539 sources = chromevox_tests_gypi_values.chromevox_tests_sources | 595 sources = [ |
| 596 "//chrome/browser/extensions/browsertest_util.cc", |
| 597 "//chrome/browser/extensions/browsertest_util.h", |
| 598 "//chrome/browser/ui/webui/web_ui_test_handler.cc", |
| 599 "//chrome/browser/ui/webui/web_ui_test_handler.h", |
| 600 "//chrome/test/base/extension_js_browser_test.cc", |
| 601 "//chrome/test/base/extension_js_browser_test.h", |
| 602 "//chrome/test/base/extension_load_waiter_one_shot.cc", |
| 603 "//chrome/test/base/extension_load_waiter_one_shot.h", |
| 604 "//chrome/test/base/javascript_browser_test.cc", |
| 605 "//chrome/test/base/javascript_browser_test.h", |
| 606 "//chrome/test/base/test_chrome_web_ui_controller_factory.cc", |
| 607 "//chrome/test/base/test_chrome_web_ui_controller_factory.h", |
| 608 "//chrome/test/base/web_ui_browser_test.cc", |
| 609 "//chrome/test/base/web_ui_browser_test.h", |
| 610 ] |
540 | 611 |
541 deps = [ | 612 deps = [ |
542 ":chromevox_extjs_tests", | 613 ":chromevox_extjs_tests", |
543 ":chromevox_unitjs_tests", | 614 ":chromevox_unitjs_tests", |
544 "//base", | 615 "//base", |
545 "//base:i18n", | 616 "//base:i18n", |
546 "//base/test:test_support", | 617 "//base/test:test_support", |
547 "//chrome:browser_tests_pak", | 618 "//chrome:browser_tests_pak", |
548 "//chrome:packed_extra_resources", | 619 "//chrome:packed_extra_resources", |
549 "//chrome:packed_resources", | 620 "//chrome:packed_resources", |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 rebase_path("//", root_build_dir) + ":", | 688 rebase_path("//", root_build_dir) + ":", |
618 rebase_path("$root_out_dir/test_data", root_build_dir) + ":", | 689 rebase_path("$root_out_dir/test_data", root_build_dir) + ":", |
619 ] | 690 ] |
620 deps = [ | 691 deps = [ |
621 ":chromevox_test_messages_js", | 692 ":chromevox_test_messages_js", |
622 ] | 693 ] |
623 } | 694 } |
624 | 695 |
625 js2gtest("chromevox_unitjs_tests") { | 696 js2gtest("chromevox_unitjs_tests") { |
626 test_type = "webui" | 697 test_type = "webui" |
627 sources = chromevox_tests_gypi_values.chromevox_tests_unitjs_sources | 698 sources = [ |
628 gen_include_files = | 699 "braille/braille_display_manager_test.unitjs", |
629 chromevox_tests_gypi_values.chromevox_tests_unit_gen_include_sources | 700 "braille/braille_input_handler_test.unitjs", |
| 701 "braille/expanding_braille_translator_test.unitjs", |
| 702 "braille/pan_strategy_test.unitjs", |
| 703 "chromevox/injected/event_watcher_test.unitjs", |
| 704 "chromevox/injected/live_regions_test.unitjs", |
| 705 "chromevox/injected/navigation_manager_test.unitjs", |
| 706 "chromevox/injected/user_commands_test.unitjs", |
| 707 "common/aria_util_test.unitjs", |
| 708 "common/braille_text_handler_test.unitjs", |
| 709 "common/braille_util_test.unitjs", |
| 710 "common/command_store_test.unitjs", |
| 711 "common/content_editable_extractor_test.unitjs", |
| 712 "common/cursor_selection_test.unitjs", |
| 713 "common/dom_util_test.unitjs", |
| 714 "common/editable_text_area_shadow_test.unitjs", |
| 715 "common/editable_text_test.unitjs", |
| 716 "common/find_util_test.unitjs", |
| 717 "common/key_sequence_test.unitjs", |
| 718 "common/math_semantic_tree_test.unitjs", |
| 719 "common/page_selection_test.unitjs", |
| 720 "common/selection_util_test.unitjs", |
| 721 "common/spannable_test.unitjs", |
| 722 "common/string_util_test.unitjs", |
| 723 "host/chrome/braille_integration_test.unitjs", |
| 724 "testing/mock_feedback_test.unitjs", |
| 725 "walkers/character_walker_test.unitjs", |
| 726 "walkers/group_walker_test.unitjs", |
| 727 "walkers/layout_line_walker_test.unitjs", |
| 728 "walkers/math_shifter_test.unitjs", |
| 729 "walkers/object_walker_test.unitjs", |
| 730 "walkers/sentence_walker_test.unitjs", |
| 731 "walkers/structural_line_walker_test.unitjs", |
| 732 "walkers/table_walker_test.unitjs", |
| 733 "walkers/word_walker_test.unitjs", |
| 734 ] |
| 735 gen_include_files = [ |
| 736 "testing/assert_additions.js", |
| 737 "testing/callback_helper.js", |
| 738 "testing/chromevox_unittest_base.js", |
| 739 "testing/mock_feedback.js", |
| 740 ] |
630 test_deps_js_outputs = get_target_outputs(":chromevox_test_deps_js") | 741 test_deps_js_outputs = get_target_outputs(":chromevox_test_deps_js") |
631 deps_js = test_deps_js_outputs[0] | 742 deps_js = test_deps_js_outputs[0] |
632 deps = [ | 743 deps = [ |
633 ":chromevox_test_deps_js", | 744 ":chromevox_test_deps_js", |
634 ] | 745 ] |
635 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 746 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
636 } | 747 } |
637 | 748 |
638 js2gtest("chromevox_extjs_tests") { | 749 js2gtest("chromevox_extjs_tests") { |
639 test_type = "extension" | 750 test_type = "extension" |
640 sources = chromevox_tests_gypi_values.chromevox_tests_extjs_sources | 751 sources = [ |
641 gen_include_files = | 752 "braille/braille_table_test.extjs", |
642 chromevox_tests_gypi_values.chromevox_tests_ext_gen_include_sources | 753 "braille/braille_translator_manager_test.extjs", |
| 754 "braille/liblouis_test.extjs", |
| 755 "cvox2/background/automation_util_test.extjs", |
| 756 "cvox2/background/background_test.extjs", |
| 757 "cvox2/background/cursors_test.extjs", |
| 758 "cvox2/background/editing_test.extjs", |
| 759 "cvox2/background/i_search_test.extjs", |
| 760 "cvox2/background/live_regions_test.extjs", |
| 761 "cvox2/background/output_test.extjs", |
| 762 "cvox2/background/tree_walker_test.extjs", |
| 763 "host/chrome/tts_background_test.extjs", |
| 764 ] |
| 765 gen_include_files = [ |
| 766 "testing/assert_additions.js", |
| 767 "testing/callback_helper.js", |
| 768 "testing/chromevox_e2e_test_base.js", |
| 769 "testing/chromevox_next_e2e_test_base.js", |
| 770 "testing/mock_feedback.js", |
| 771 ] |
643 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] | 772 defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
644 } | 773 } |
OLD | NEW |