blob: 1c6173077c676707464975d65c5cde7dbd0a0af0 [file] [log] [blame]
# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import(
"//chrome/browser/resources/chromeos/accessibility/tools/run_jsbundler.gni")
import("//chrome/common/features.gni")
import("//chrome/test/base/js2gtest.gni")
import("//testing/test.gni")
import("//third_party/closure_compiler/compile_js.gni")
assert(is_chromeos_ash)
select_to_speak_out_dir =
"$root_out_dir/resources/chromeos/accessibility/select_to_speak"
group("build") {
deps = [ ":select_to_speak_copied_files" ]
}
# Instead of setting up one copy target for each subdirectory, use a script
# to copy all files.
run_jsbundler("select_to_speak_copied_files") {
mode = "copy"
dest_dir = select_to_speak_out_dir
sources = [
"background.html",
"checked.png",
"earcons/null_selection.ogg",
"input_handler.js",
"metrics_utils.js",
"options.css",
"options.html",
"prefs_manager.js",
"select_to_speak-2x.svg",
"select_to_speak.js",
"select_to_speak_constants.js",
"select_to_speak_main.js",
"select_to_speak_options.js",
"sts-icon-128.png",
"sts-icon-16.png",
"sts-icon-48.png",
"tts_manager.js",
"ui_manager.js",
"unchecked.png",
]
rewrite_rules = [
rebase_path(".", root_build_dir) + ":",
rebase_path(closure_library_dir, root_build_dir) + ":closure",
]
}
source_set("browser_tests") {
testonly = true
assert(enable_extensions)
deps = [ ":select_to_speak_extjs_tests" ]
# TODO(jamescook): Figure out which of these are really necessary.
data = [
"$root_out_dir/chrome_100_percent.pak",
"$root_out_dir/chrome_200_percent.pak",
"$root_out_dir/locales/en-US.pak",
"$root_out_dir/resources.pak",
"$root_out_dir/resources/chromeos/accessibility/select_to_speak/",
"$root_out_dir/test_data/chrome/browser/resources/chromeos/accessibility/select_to_speak/",
# The test uses data from the original location, not the copied one.
"//chrome/browser/resources/chromeos/accessibility/common/",
"//chrome/browser/resources/chromeos/accessibility/select_to_speak/",
]
data += js2gtest_js_libraries
}
js2gtest("select_to_speak_extjs_tests") {
test_type = "extension"
sources = [
# These are end-to-end tests.
"select_to_speak_context_menu_tests.js",
"select_to_speak_enhanced_voices_test.js",
"select_to_speak_keystroke_selection_test.js",
"select_to_speak_mouse_selection_test.js",
"select_to_speak_navigation_control_test.js",
"select_to_speak_options_test.js",
"select_to_speak_prefs_test.js",
]
# These are unit tests run under an extension environment to get ES6 module support.
sources += [
"select_to_speak_unittest.js",
"tts_manager_unittest.js",
"ui_manager_unittest.js",
]
gen_include_files = [
"../common/testing/accessibility_test_base.js",
"../common/testing/callback_helper.js",
"../common/testing/e2e_test_base.js",
"../common/testing/fake_chrome_event.js",
"../common/testing/fake_settings_private.js",
"../common/testing/mock_storage.js",
"../common/testing/mock_tts.js",
"select_to_speak_e2e_test_base.js",
"pipe.jpg",
]
# The test base classes generate C++ code with these deps.
deps = [
"//ash",
"//ash/keyboard/ui",
"//base",
"//chrome/browser/ash",
"//chrome/browser/ash/crosapi",
"//chrome/common",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}
js_type_check("closure_compile") {
deps = [
":input_handler",
":metrics_utils",
":prefs_manager",
":select_to_speak",
":select_to_speak_constants",
":select_to_speak_options",
":tts_manager",
":ui_manager",
"../common:automation_predicate",
"../common:automation_util",
"../common:closure_shim",
"../common:constants",
"../common:key_code",
"../common:node_navigation_utils",
"../common:node_utils",
"../common:paragraph_utils",
"../common:rect_util",
"../common:sentence_utils",
"../common:tree_walker",
"../common:word_utils",
]
}
js_library("select_to_speak") {
deps = [
":input_handler",
":metrics_utils",
":prefs_manager",
":tts_manager",
":ui_manager",
"../common:automation_util",
"../common:constants",
"../common:node_navigation_utils",
"../common:node_utils",
"../common:paragraph_utils",
"../common:rect_util",
"../common:sentence_utils",
"../common:word_utils",
]
externs_list = [
"$externs_path/accessibility_private.js",
"$externs_path/automation.js",
"$externs_path/clipboard.js",
"$externs_path/command_line_private.js",
"$externs_path/pending.js",
"$externs_path/tts.js",
]
}
js_library("select_to_speak_options") {
deps = [ ":prefs_manager" ]
externs_list = [
"$externs_path/accessibility_private.js",
"$externs_path/automation.js",
"$externs_path/metrics_private.js",
"$externs_path/tts.js",
]
}
js_library("input_handler") {
deps = [ "../common:rect_util" ]
}
js_library("prefs_manager") {
externs_list = [ "$externs_path/settings_private.js" ]
}
js_library("metrics_utils") {
deps = [ ":prefs_manager" ]
externs_list = [
"$externs_path/metrics_private.js",
"$externs_path/tts.js",
]
}
js_library("select_to_speak_constants") {
}
js_library("ui_manager") {
deps = [
":prefs_manager",
"../common:paragraph_utils",
]
externs_list = [ "$externs_path/accessibility_private.js" ]
}
js_library("tts_manager") {
externs_list = [ "$externs_path/tts.js" ]
}