chromevox_tests.gypi revision 46d4c2bc3267f3f028f39e7e311b0f89aba2e4fd
1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6  'includes': [
7    '../../../../js_unittest_vars.gypi',
8  ],
9  'variables': {
10    'chromevox_test_deps_js_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/chromeos/chromevox/test_deps.js',
11  },
12  'targets': [
13    {
14      'target_name': 'chromevox_tests',
15      'type': 'executable',
16      'dependencies': [
17        '<(DEPTH)/base/base.gyp:base',
18        '<(DEPTH)/base/base.gyp:base_i18n',
19        '<(DEPTH)/base/base.gyp:test_support_base',
20        '<(DEPTH)/chrome/chrome.gyp:browser',
21        '<(DEPTH)/chrome/chrome.gyp:renderer',
22        '<(DEPTH)/chrome/chrome.gyp:test_support_common',
23        '<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
24        '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings',
25        '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
26        '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
27        '<(DEPTH)/testing/gmock.gyp:gmock',
28        '<(DEPTH)/testing/gtest.gyp:gtest',
29        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
30        'chromevox_test_deps_js',
31      ],
32      'defines': [
33        'HAS_OUT_OF_PROC_TEST_RUNNER',
34      ],
35      'include_dirs': [
36        '<(DEPTH)',
37        '<(SHARED_INTERMEDIATE_DIR)',
38      ],
39      'rules': [
40        {
41          # A JavaScript test that runs in an environment similar to a webui
42          # browser test.
43          'rule_name': 'js2webui',
44          'extension': 'js',
45          'msvs_external_rule': 1,
46          'inputs': [
47            '<(gypv8sh)',
48            '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
49            '<(mock_js)',
50            '<(test_api_js)',
51            '<(js2gtest)',
52            '<(chromevox_test_deps_js_file)',
53            'testing/chromevox_unittest_base.js',
54          ],
55          'outputs': [
56            '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-gen.cc',
57            '<(PRODUCT_DIR)/test_data/chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
58          ],
59          'process_outputs_as_sources': 1,
60          'action': [
61            'python',
62            '<(gypv8sh)',
63            '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
64            '--deps_js', '<(chromevox_test_deps_js_file)',
65            '<(mock_js)',
66            '<(test_api_js)',
67            '<(js2gtest)',
68            'webui',
69            '<(RULE_INPUT_PATH)',
70            'chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
71            '<@(_outputs)',
72          ],
73        },
74      ],
75      'sources': [
76        '<(DEPTH)/chrome/browser/ui/webui/web_ui_test_handler.cc',
77        '<(DEPTH)/chrome/browser/ui/webui/web_ui_test_handler.h',
78        '<(DEPTH)/chrome/test/base/browser_tests_main.cc',
79        '<(DEPTH)/chrome/test/base/test_chrome_web_ui_controller_factory.cc',
80        '<(DEPTH)/chrome/test/base/test_chrome_web_ui_controller_factory.h',
81        '<(DEPTH)/chrome/test/base/web_ui_browser_test.cc',
82        '<(DEPTH)/chrome/test/base/web_ui_browser_test.h',
83
84        'common/aria_util_test.js',
85        'common/cursor_selection_test.js',
86        'common/editable_text_area_shadow_test.js',
87        'common/key_sequence_test.js',
88        'common/math_semantic_tree_test.js',
89        'common/selection_util_test.js',
90      ],
91    },  # target chromevox_tests
92    {
93      'target_name': 'chromevox_test_deps_js',
94      'type': 'none',
95      'actions': [
96        {
97          'action_name': 'deps_js',
98          'message': 'Generate <(_target_name)',
99          'variables': {
100            # Closure library directory relative to source tree root.
101            'closure_dir': 'chrome/third_party/chromevox/third_party/closure-library/closure/goog',
102            'depswriter_path': 'tools/generate_deps.py',
103            'js_files': [
104              '<!@(python tools/find_js_files.py . <(DEPTH)/<(closure_dir))',
105            ],
106          },
107          'inputs': [
108            '<@(js_files)',
109            '<(depswriter_path)',
110          ],
111          'outputs': [
112            '<(chromevox_test_deps_js_file)',
113          ],
114          'action': [
115            'python',
116            '<(depswriter_path)',
117            '-w', '<(DEPTH)/<(closure_dir):<(closure_dir)',
118            '-w', ':chrome/browser/resources/chromeos/chromevox',
119            '-o', '<(chromevox_test_deps_js_file)',
120            '<@(js_files)',
121          ],
122        },
123      ],
124    },
125  ],
126}
127