# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/features.gni") import("//testing/test.gni") import("//chrome/test/base/js2gtest.gni") import("//chrome/browser/resources/chromeos/chromevox/run_jsbundler.gni") import("//third_party/closure_compiler/compile_js.gni") assert(is_chromeos) switch_access_dir = "$root_out_dir/resources/chromeos/switch_access" group("build") { deps = [ ":switch_access_copied_files", ":switch_access_guest_manifest", ":switch_access_manifest", ] } # Instead of setting up one copy target for each subdirectory, use a script # to copy all files. run_jsbundler("switch_access_copied_files") { mode = "copy" dest_dir = switch_access_dir sources = [ "../chromevox/cvox2/background/constants.js", "../chromevox/cvox2/background/tree_walker.js", "../select_to_speak/closure_shim.js", "auto_scan_manager.js", "automation_manager.js", "background.js", "commands.js", "keyboard_handler.js", "options.css", "options.html", "options.js", "prefs.js", "switch_access.js", "switch_access_predicate.js", ] rewrite_rules = [ rebase_path(".", root_build_dir) + ":", rebase_path(closure_library_dir, root_build_dir) + ":closure", rebase_path("../chromevox/cvox2/background", root_build_dir) + ":", rebase_path("../select_to_speak", root_build_dir) + ":", ] } test("switch_access_tests") { deps = [ ":switch_access_webuijs_tests", "//chrome/test:browser_tests_runner", ] } js2gtest("switch_access_webuijs_tests") { test_type = "webui" sources = [ "auto_scan_manager_unittest.gtestjs", "switch_access_predicate_unittest.gtestjs", ] extra_js_files = [ "auto_scan_manager.js", "switch_access_predicate.js", "test_support.js", ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] } # TODO: refactor this into another file like generate_manifest.gni # to share with other extensions. template("manifest") { version_file = "//chrome/VERSION" version_script = "//build/util/version.py" template_file = "manifest.json.jinja2" output_file = invoker.output_file key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDVWTYdXNGhIG6FJKIhaohRRrYYGwg9cR2jea2NRBSEg+T7E3EvUyFy0ouez0N0omeSAL/xlvQtCjZJ72eCqDBgON/49SRtUdLS5TQ2U9c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y+YVfxqhcnwflwfWofLjFaT8Q/2EbAoGANkdtr+5iRYhfr1BKmKwvRqDHtNtGGNlJZecCWAwC1p7C0I5FsyK3m9AyJlPcmxE2MSA/jv3qLWdG2JeH9ODcLuzy6C7hgB1X07H6lJBeANXd0Uz6ba96kdeZHGlzkY7xI0MbQl4kKkXiUvVijzgs8y5HfVi8SgHm7HxGCDASehcCgYEAnw1yu4eaWqsq7ECyjEBM7sQcMVGypiG3VupzLKA75iPkg/E+peUZyDRg7LPCiX/UcW22bliUw1ASRzY+thuVlGWC2CPah95Z4m+H4cJVSEEqKUbYRGfsDlDIJNxPihGvhoTniKZwvpUacbAhop7rbiAVGx+RJ+tFG8P56AbvBVE=" action(target_name) { script = "//chrome/browser/resources/chromeos/chromevox/tools/generate_manifest.py" inputs = [ version_file, version_script, ] sources = [ template_file, ] outputs = [ output_file, ] args = [ "--key=$key", "--version_file=" + rebase_path(version_file, root_build_dir), "--output_manifest=" + rebase_path(output_file, root_build_dir), ] if (defined(invoker.is_guest_manifest) && invoker.is_guest_manifest) { args += [ "--is_guest_manifest=1" ] } args += rebase_path(sources, root_build_dir) } } manifest("switch_access_manifest") { output_file = "$switch_access_dir/manifest.json" } manifest("switch_access_guest_manifest") { output_file = "$switch_access_dir/manifest_guest.json" is_guest_manifest = true } js_type_check("closure_compile") { deps = [ ":auto_scan_manager", ":automation_manager", ":background", ":commands", ":keyboard_handler", ":options", ":prefs", ":switch_access_predicate", "../chromevox:constants", "../chromevox:tree_walker", "../select_to_speak:closure_shim", # ":switch_access", ":switch_access_interface", ] } js_library("auto_scan_manager") { deps = [ ":switch_access_interface", ] } js_library("automation_manager") { deps = [ ":switch_access_predicate", "../chromevox:constants", "../chromevox:tree_walker", ] externs_list = [ "$externs_path/accessibility_private.js", "$externs_path/automation.js", ] } js_library("switch_access_predicate") { externs_list = [ "$externs_path/automation.js" ] } js_library("background") { deps = [ ":switch_access", ] externs_list = [ "$externs_path/chrome_extensions.js" ] } js_library("commands") { deps = [ ":switch_access_interface", ] } js_library("keyboard_handler") { deps = [ ":switch_access_interface", ] externs_list = [ "$externs_path/accessibility_private.js" ] } js_library("options") { deps = [ ":background", ":switch_access", ] externs_list = [ "$externs_path/chrome_extensions.js" ] } js_library("prefs") { deps = [ ":switch_access_interface", ] externs_list = [ "$externs_path/chrome_extensions.js" ] } js_library("switch_access") { deps = [ ":auto_scan_manager", ":automation_manager", ":commands", ":keyboard_handler", ":prefs", ] externs_list = [ "$externs_path/automation.js", "$externs_path/chrome_extensions.js", ] } js_library("switch_access_interface") { }