1# Copyright 2010-2018, Google Inc.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7#
8#     * Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10#     * Redistributions in binary form must reproduce the above
11# copyright notice, this list of conditions and the following disclaimer
12# in the documentation and/or other materials provided with the
13# distribution.
14#     * Neither the name of Google Inc. nor the names of its
15# contributors may be used to endorse or promote products derived from
16# this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30{
31  'variables': {
32    'relative_dir': 'session',
33    'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)',
34  },
35  'targets': [
36    {
37      'target_name': 'session_handler_test_util',
38      'type' : 'static_library',
39      'sources': [
40        'session_handler_test_util.cc',
41      ],
42      'dependencies': [
43        '../base/base.gyp:base',
44        '../config/config.gyp:config_handler',
45        '../engine/engine.gyp:engine_factory',
46        '../engine/engine.gyp:mock_data_engine_factory',
47        '../protocol/protocol.gyp:commands_proto',
48        '../protocol/protocol.gyp:config_proto',
49        '../testing/testing.gyp:testing',
50        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
51        'session.gyp:session',
52        'session.gyp:session_handler',
53        'session.gyp:session_usage_observer',
54      ],
55    },
56    {
57      'target_name': 'session_server_test',
58      'type': 'executable',
59      'sources': [
60        'session_server_test.cc',
61      ],
62      'dependencies': [
63        '../testing/testing.gyp:gtest_main',
64        'session.gyp:session',
65        'session.gyp:session_server',
66      ],
67      'variables': {
68        'test_size': 'small',
69      },
70    },
71    {
72      'target_name': 'session_test',
73      'type': 'executable',
74      'sources': [
75        'session_test.cc',
76      ],
77      'dependencies': [
78        '../converter/converter_base.gyp:converter_mock',
79        '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
80        '../engine/engine.gyp:engine',
81        '../engine/engine.gyp:mock_converter_engine',
82        '../engine/engine.gyp:mock_data_engine_factory',
83        '../rewriter/rewriter.gyp:rewriter',
84        '../testing/testing.gyp:gtest_main',
85        '../testing/testing.gyp:mozctest',
86        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
87        'session.gyp:session',
88      ],
89      'variables': {
90        'test_size': 'small',
91      },
92    },
93    {
94      'target_name': 'session_regression_test',
95      'type': 'executable',
96      'sources': [
97        'session_regression_test.cc',
98      ],
99      'dependencies': [
100        '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
101        '../engine/engine.gyp:engine_factory',
102        '../testing/testing.gyp:gtest_main',
103        'session.gyp:session',
104        'session.gyp:session_server',
105      ],
106      'variables': {
107        'test_size': 'large',
108      },
109    },
110    {
111      'target_name': 'session_handler_test',
112      'type': 'executable',
113      'sources': [
114        'session_handler_test.cc',
115      ],
116      'dependencies': [
117        '../base/base_test.gyp:clock_mock',
118        '../converter/converter_base.gyp:converter_mock',
119        '../engine/engine.gyp:mock_converter_engine',
120        '../testing/testing.gyp:gtest_main',
121        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
122        'session.gyp:session',
123        'session.gyp:session_server',
124        'session_handler_test_util',
125      ],
126      'variables': {
127        'test_size': 'small',
128      },
129      'conditions': [
130        ['target_platform=="NaCl" and _toolset=="target"', {
131          'dependencies!': [
132            'session.gyp:session_server',
133          ],
134        }],
135      ],
136    },
137    {
138      'target_name': 'session_converter_test',
139      'type': 'executable',
140      'sources': [
141        'session_converter_test.cc',
142      ],
143      'dependencies': [
144        '../converter/converter_base.gyp:converter_mock',
145        '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
146        '../testing/testing.gyp:gtest_main',
147        '../testing/testing.gyp:testing_util',
148        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
149        'session.gyp:session',
150        'session_base.gyp:request_test_util',
151      ],
152    },
153    {
154      'target_name': 'session_module_test',
155      'type': 'executable',
156      'sources': [
157        'output_util_test.cc',
158        'session_observer_handler_test.cc',
159        'session_usage_observer_test.cc',
160        'session_usage_stats_util_test.cc',
161      ],
162      'dependencies': [
163        '../base/base.gyp:base',
164        '../base/base_test.gyp:clock_mock',
165        '../base/base_test.gyp:scheduler_stub',
166        '../client/client.gyp:client_mock',
167        '../config/config.gyp:config_handler',
168        '../config/config.gyp:stats_config_util',
169        '../protocol/protocol.gyp:commands_proto',
170        '../testing/testing.gyp:gtest_main',
171        '../usage_stats/usage_stats_base.gyp:usage_stats',
172        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
173        'session.gyp:session_handler',
174        'session.gyp:session_usage_observer',
175        'session_base.gyp:keymap',
176        'session_base.gyp:keymap_factory',
177        'session_base.gyp:output_util',
178        'session_base.gyp:session_usage_stats_util',
179      ],
180      'variables': {
181        'test_size': 'small',
182      },
183    },
184    {
185      # Android is not supported.
186      'target_name': 'session_watch_dog_test',
187      'type': 'executable',
188      'sources': [
189        'session_watch_dog_test.cc',
190      ],
191      'dependencies': [
192        '../base/base.gyp:base',
193        '../client/client.gyp:client_mock',
194        '../testing/testing.gyp:gtest_main',
195        'session.gyp:session_watch_dog',
196      ],
197      'variables': {
198        'test_size': 'small',
199      },
200    },
201    {
202      'target_name': 'session_key_handling_test',
203      'type': 'executable',
204      'sources': [
205        'ime_switch_util_test.cc',
206        'key_info_util_test.cc',
207      ],
208      'dependencies': [
209        '../base/base.gyp:base',
210        '../config/config.gyp:config_handler',
211        '../protocol/protocol.gyp:commands_proto',
212        '../testing/testing.gyp:gtest_main',
213        'session_base.gyp:ime_switch_util',
214      ],
215      'variables': {
216        'test_size': 'small',
217      },
218    },
219    {
220      'target_name': 'session_internal_test',
221      'type': 'executable',
222      'sources': [
223        'internal/candidate_list_test.cc',
224        'internal/ime_context_test.cc',
225        'internal/keymap_test.cc',
226        'internal/keymap_factory_test.cc',
227        'internal/session_output_test.cc',
228        'internal/key_event_transformer_test.cc',
229      ],
230      'dependencies': [
231        '../base/base.gyp:base',
232        '../converter/converter_base.gyp:converter_mock',
233        '../engine/engine.gyp:mock_converter_engine',
234        '../protocol/protocol.gyp:commands_proto',
235        '../protocol/protocol.gyp:config_proto',
236        '../testing/testing.gyp:gtest_main',
237        '../testing/testing.gyp:testing_util',
238        'session.gyp:session',
239      ],
240      'variables': {
241        'test_size': 'small',
242      },
243    },
244    {
245      'target_name': 'session_handler_stress_test',
246      'type': 'executable',
247      'sources': [
248        'session_handler_stress_test.cc'
249      ],
250      'dependencies': [
251        '../engine/engine.gyp:engine_factory',
252        '../testing/testing.gyp:gtest_main',
253        'session.gyp:random_keyevents_generator',
254        'session.gyp:session',
255        'session.gyp:session_server',
256        'session_handler_test_util',
257      ],
258      'variables': {
259        'test_size': 'large',
260      },
261    },
262    {
263      'target_name': 'random_keyevents_generator_test',
264      'type': 'executable',
265      'sources': [
266        'random_keyevents_generator_test.cc',
267      ],
268      'dependencies': [
269        '../protocol/protocol.gyp:commands_proto',
270        '../testing/testing.gyp:gtest_main',
271        'session.gyp:random_keyevents_generator',
272      ],
273      'variables': {
274        'test_size': 'large',
275      },
276    },
277    {
278      'target_name': 'session_converter_stress_test',
279      'type': 'executable',
280      'sources': [
281        'session_converter_stress_test.cc'
282      ],
283      'dependencies': [
284        '../engine/engine.gyp:mock_data_engine_factory',
285        '../testing/testing.gyp:gtest_main',
286        'session.gyp:session',
287      ],
288      'variables': {
289        'test_size': 'large',
290      },
291    },
292    {
293      'target_name': 'generic_storage_manager_test',
294      'type': 'executable',
295      'sources': [
296        'generic_storage_manager_test.cc'
297      ],
298      'dependencies': [
299        '../base/base.gyp:base',
300        '../testing/testing.gyp:gtest_main',
301        'session_base.gyp:generic_storage_manager',
302      ],
303      'variables': {
304        'test_size': 'small',
305      },
306    },
307    {
308      'target_name': 'request_test_util_test',
309      'type': 'executable',
310      'sources': [
311        'request_test_util_test.cc'
312      ],
313      'dependencies': [
314        '../base/base.gyp:base',
315        '../testing/testing.gyp:gtest_main',
316        'session_base.gyp:request_test_util',
317      ],
318      'variables': {
319        'test_size': 'small',
320      },
321    },
322    {
323      'target_name': 'session_handler_scenario_test',
324      'type': 'executable',
325      'sources': [
326        'session_handler_scenario_test.cc'
327      ],
328      'dependencies': [
329        '../base/base.gyp:base',
330        '../data/test/session/scenario/scenario.gyp:install_session_handler_scenario_test_data',
331        '../data/test/session/scenario/usage_stats/usage_stats.gyp:install_session_handler_usage_stats_scenario_test_data',
332        '../engine/engine.gyp:mock_data_engine_factory',
333        '../protocol/protocol.gyp:commands_proto',
334        '../testing/testing.gyp:gtest_main',
335        '../testing/testing.gyp:mozctest',
336        '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
337        'session.gyp:session_handler',
338        'session_base.gyp:request_test_util',
339        'session_handler_test_util',
340      ],
341      'variables': {
342        'test_size': 'large',
343      },
344    },
345
346    # Test cases meta target: this target is referred from gyp/tests.gyp
347    {
348      'target_name': 'session_all_test',
349      'type': 'none',
350      'dependencies': [
351        'generic_storage_manager_test',
352        'random_keyevents_generator_test',
353        'request_test_util_test',
354        'session_converter_stress_test',
355        'session_converter_test',
356        'session_handler_scenario_test',
357        'session_handler_stress_test',
358        'session_handler_test',
359        'session_key_handling_test',
360        'session_internal_test',
361        'session_module_test',
362        'session_regression_test',
363        'session_server_test',
364        'session_test',
365        'session_watch_dog_test',
366      ],
367      'conditions': [
368        ['target_platform=="Android"', {
369          'dependencies!': [
370            'session_server_test',
371            'session_watch_dog_test',
372            # These tests have been disabled as it takes long execution time.
373            # In addition currently they fail.
374            # Here we also disable the tests temporarirly.
375            # TODO(matsuzakit): Reactivate them.
376            'session_handler_stress_test',
377            'session_regression_test',
378          ],
379        }],
380      ],
381    },
382  ],
383}
384