[Extensions] Make extension message bubble factory platform-abstract
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / chromevox / chromevox_tests.gypi
blob9b0bd1296f1727983618bdb7bbfb5ca42672b279
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.
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     'chromevox_test_messages_js_file': '<(PRODUCT_DIR)/test_data/chrome/browser/resources/chromeos/chromevox/host/testing/test_messages.js',
12   },
13   'targets': [
14     {
15       'target_name': 'chromevox_tests',
16       'type': 'executable',
17       'dependencies': [
18         '<(DEPTH)/base/base.gyp:base',
19         '<(DEPTH)/base/base.gyp:base_i18n',
20         '<(DEPTH)/base/base.gyp:test_support_base',
21         '<(DEPTH)/chrome/chrome.gyp:browser',
22         '<(DEPTH)/chrome/chrome.gyp:renderer',
23         '<(DEPTH)/chrome/chrome.gyp:test_support_common',
24         '<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
25         '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings',
26         '<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
27         '<(DEPTH)/chrome/chrome_resources.gyp:packed_resources',
28         '<(DEPTH)/testing/gmock.gyp:gmock',
29         '<(DEPTH)/testing/gtest.gyp:gtest',
30         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
31         'chromevox_test_deps_js',
32       ],
33       'conditions': [
34         [ 'cld_version==0 or cld_version==2', {
35           'dependencies': [
36             # Interactive tests should use whatever CLD2 data access mode that
37             # the application embedder is using.
38             '<(DEPTH)/third_party/cld_2/cld_2.gyp:cld2_platform_impl', ],
39         }],
40       ],
41       'defines': [
42         'HAS_OUT_OF_PROC_TEST_RUNNER',
43       ],
44       'include_dirs': [
45         '<(DEPTH)',
46         '<(SHARED_INTERMEDIATE_DIR)',
47       ],
48       'rules': [
49         {
50           # A JavaScript test that runs in an environment similar to a webui
51           # browser test.  This is meant for unit tests that test individual
52           # components without depending on the ChromeVox extension.
53           'rule_name': 'js2webui',
54           'extension': 'unitjs',
55           'msvs_external_rule': 1,
56           'variables': {
57             'conditions': [
58               ['v8_use_external_startup_data==1', {
59                 'external_v8': 'y',
60               }, {
61                 'external_v8': 'n',
62               }],
63             ],
64           },
65           'inputs': [
66             '<(gypv8sh)',
67             '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
68             '<(mock_js)',
69             '<(test_api_js)',
70             '<(js2gtest)',
71             '<(chromevox_test_deps_js_file)',
72             'testing/assert_additions.js',
73             'testing/chromevox_unittest_base.js',
74           ],
75           'outputs': [
76             '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-gen.cc',
77             '<(PRODUCT_DIR)/test_data/chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).js',
78           ],
79           'process_outputs_as_sources': 1,
80           'action': [
81             'python',
82             '<(gypv8sh)',
83             '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
84             '--deps_js', '<(chromevox_test_deps_js_file)',
85             '--external', '<(external_v8)',
86             '<(mock_js)',
87             '<(test_api_js)',
88             '<(js2gtest)',
89             'webui',
90             '<(RULE_INPUT_PATH)',
91             'chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).unitjs',
92             '<@(_outputs)',
93           ],
94         },
95         {
96           # A JavaScript test that runs in the ChromeVox background page's
97           # isolate.
98           'rule_name': 'js2extension',
99           'extension': 'extjs',
100           'msvs_external_rule': 1,
101           'variables': {
102             'conditions': [
103               ['v8_use_external_startup_data==1', {
104                 'external_v8': 'y',
105               }, {
106                 'external_v8': 'n',
107               }],
108             ],
109           },
110           'inputs': [
111             '<(gypv8sh)',
112             '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
113             '<(mock_js)',
114             '<(test_api_js)',
115             '<(js2gtest)',
116             'testing/callback_helper.js',
117             'testing/chromevox_e2e_test_base.js',
118             'testing/chromevox_next_e2e_test_base.js',
119             'testing/assert_additions.js',
120           ],
121           'outputs': [
122             '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT)-gen.cc',
123             '<(PRODUCT_DIR)/test_data/chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).extjs',
124           ],
125           'process_outputs_as_sources': 1,
126           'action': [
127             'python',
128             '<(gypv8sh)',
129             '<(PRODUCT_DIR)/d8<(EXECUTABLE_SUFFIX)',
130             '--external', '<(external_v8)',
131             '<(mock_js)',
132             '<(test_api_js)',
133             '<(js2gtest)',
134             'extension',
135             '<(RULE_INPUT_PATH)',
136             'chrome/browser/resources/chromeos/chromevox/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).extjs',
137             '<@(_outputs)',
138           ],
139         },
140       ],
141       'sources': [
142         '<(DEPTH)/chrome/browser/extensions/browsertest_util.cc',
143         '<(DEPTH)/chrome/browser/extensions/browsertest_util.h',
144         '<(DEPTH)/chrome/browser/ui/webui/web_ui_test_handler.cc',
145         '<(DEPTH)/chrome/browser/ui/webui/web_ui_test_handler.h',
146         '<(DEPTH)/chrome/test/base/browser_tests_main.cc',
147         '<(DEPTH)/chrome/test/base/extension_js_browser_test.cc',
148         '<(DEPTH)/chrome/test/base/extension_js_browser_test.h',
149         '<(DEPTH)/chrome/test/base/extension_load_waiter_one_shot.cc',
150         '<(DEPTH)/chrome/test/base/extension_load_waiter_one_shot.h',
151         '<(DEPTH)/chrome/test/base/javascript_browser_test.cc',
152         '<(DEPTH)/chrome/test/base/javascript_browser_test.h',
153         '<(DEPTH)/chrome/test/base/test_chrome_web_ui_controller_factory.cc',
154         '<(DEPTH)/chrome/test/base/test_chrome_web_ui_controller_factory.h',
155         '<(DEPTH)/chrome/test/base/web_ui_browser_test.cc',
156         '<(DEPTH)/chrome/test/base/web_ui_browser_test.h',
158         'braille/braille_display_manager_test.unitjs',
159         'braille/braille_input_handler_test.unitjs',
160         'braille/braille_table_test.extjs',
161         'braille/braille_translator_manager_test.extjs',
162         'braille/expanding_braille_translator_test.unitjs',
163         'braille/liblouis_test.extjs',
164         'braille/pan_strategy_test.unitjs',
165         'common/aria_util_test.unitjs',
166         'common/braille_text_handler_test.unitjs',
167         'common/braille_util_test.unitjs',
168         'common/command_store_test.unitjs',
169         'common/content_editable_extractor_test.unitjs',
170         'common/cursor_selection_test.unitjs',
171         'common/dom_util_test.unitjs',
172         'common/editable_text_area_shadow_test.unitjs',
173         'common/editable_text_test.unitjs',
174         'common/find_util_test.unitjs',
175         'common/key_sequence_test.unitjs',
176         'common/math_semantic_tree_test.unitjs',
177         'common/page_selection_test.unitjs',
178         'common/selection_util_test.unitjs',
179         'common/spannable_test.unitjs',
180         'common/string_util_test.unitjs',
181         'chromevox/injected/event_watcher_test.unitjs',
182         'chromevox/injected/live_regions_test.unitjs',
183         'chromevox/injected/user_commands_test.unitjs',
184         'chromevox/injected/navigation_manager_test.unitjs',
185         'cvox2/background/automation_util_test.extjs',
186         'cvox2/background/background_test.extjs',
187         'cvox2/background/cursors_test.extjs',
188         'cvox2/background/output_test.extjs',
189         'host/chrome/braille_integration_test.unitjs',
190         'host/chrome/tts_background_test.extjs',
191         'walkers/character_walker_test.unitjs',
192         'walkers/group_walker_test.unitjs',
193         'walkers/object_walker_test.unitjs',
194         'walkers/layout_line_walker_test.unitjs',
195         'walkers/math_shifter_test.unitjs',
196         'walkers/sentence_walker_test.unitjs',
197         'walkers/structural_line_walker_test.unitjs',
198         'walkers/table_walker_test.unitjs',
199         'walkers/word_walker_test.unitjs',
200       ],
201     },  # target chromevox_tests
202     {
203       'target_name': 'chromevox_test_messages_js',
204       'type': 'none',
205       'actions': [
206         {
207           'action_name': 'test_messages_js',
208           'message': 'Generate <(_target_name)',
209           'variables': {
210             'english_messages_file': '<(chromevox_dest_dir)/_locales/en/messages.json',
211           },
212           'inputs': [
213             'tools/generate_test_messages.py',
214             '<(english_messages_file)',
215           ],
216           'outputs': [
217             '<(chromevox_test_messages_js_file)',
218           ],
219           'action': [
220             'python',
221             'tools/generate_test_messages.py',
222             '-o', '<(chromevox_test_messages_js_file)',
223             '<(english_messages_file)',
224           ],
225         },
226       ],
227     },  # target chromevox_test_messages_js
228     {
229       'target_name': 'chromevox_test_deps_js',
230       'type': 'none',
231       'actions': [
232         {
233           'action_name': 'deps_js',
234           'message': 'Generate <(_target_name)',
235           'variables': {
236             # Closure library directory relative to source tree root.
237             'closure_dir': 'chrome/third_party/chromevox/third_party/closure-library/closure/goog',
238             'depswriter_path': 'tools/generate_deps.py',
239             'js_files': [
240               '<!@(python tools/find_js_files.py . <(DEPTH)/<(closure_dir))',
241               '<(chromevox_test_messages_js_file)',
242             ],
243           },
244           'inputs': [
245             '<@(js_files)',
246             '<(depswriter_path)',
247           ],
248           'outputs': [
249             '<(chromevox_test_deps_js_file)',
250           ],
251           'action': [
252             'python',
253             '<(depswriter_path)',
254             '-w', '<(DEPTH)/<(closure_dir):<(closure_dir)',
255             '-w', '<(PRODUCT_DIR)/test_data:',
256             '-w', ':chrome/browser/resources/chromeos/chromevox',
257             '-o', '<(chromevox_test_deps_js_file)',
258             '<@(js_files)',
259           ],
260         },
261       ],
262       'dependencies': [
263         'chromevox_test_messages_js',
264       ],
265     },  # target chromevox_test_deps_js
266   ],