OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import logging | 6 import logging |
7 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import shlex | 9 import shlex |
10 import sys | 10 import sys |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 group.add_option('--show-stdout', | 261 group.add_option('--show-stdout', |
262 action='store_true', | 262 action='store_true', |
263 help='When possible, will display the stdout of the process') | 263 help='When possible, will display the stdout of the process') |
264 parser.add_option_group(group) | 264 parser.add_option_group(group) |
265 | 265 |
266 group = optparse.OptionGroup(parser, 'Compatibility options') | 266 group = optparse.OptionGroup(parser, 'Compatibility options') |
267 group.add_option('--gtest_output', | 267 group.add_option('--gtest_output', |
268 help='Ignored argument for compatibility with runtest.py harness') | 268 help='Ignored argument for compatibility with runtest.py harness') |
269 parser.add_option_group(group) | 269 parser.add_option_group(group) |
270 | 270 |
| 271 group = optparse.OptionGroup(parser, 'Synthetic gesture options') |
| 272 synthetic_gesture_source_type_choices = [ 'default', 'mouse', 'touch' ] |
| 273 group.add_option('--synthetic-gesture-source-type', |
| 274 dest='synthetic_gesture_source_type', |
| 275 default='default', type='choice', |
| 276 choices=synthetic_gesture_source_type_choices, |
| 277 help='Specify the source type for synthetic gestures. Note that some ' + |
| 278 'actions only support a specific source type. ' + |
| 279 'Supported values: ' + |
| 280 ', '.join(synthetic_gesture_source_type_choices)) |
| 281 parser.add_option_group(group) |
| 282 |
271 | 283 |
272 def UpdateFromParseResults(self, finder_options): | 284 def UpdateFromParseResults(self, finder_options): |
273 """Copies our options from finder_options""" | 285 """Copies our options from finder_options""" |
274 browser_options_list = [ | 286 browser_options_list = [ |
275 'extra_browser_args_as_string', | 287 'extra_browser_args_as_string', |
276 'extra_wpr_args_as_string', | 288 'extra_wpr_args_as_string', |
277 'netsim', | 289 'netsim', |
278 'profile_dir', | 290 'profile_dir', |
279 'profile_type', | 291 'profile_type', |
280 'show_stdout', | 292 'show_stdout', |
| 293 'synthetic_gesture_source_type', |
281 ] | 294 ] |
282 for o in browser_options_list: | 295 for o in browser_options_list: |
283 a = getattr(finder_options, o, None) | 296 a = getattr(finder_options, o, None) |
284 if a is not None: | 297 if a is not None: |
285 setattr(self, o, a) | 298 setattr(self, o, a) |
286 delattr(finder_options, o) | 299 delattr(finder_options, o) |
287 | 300 |
288 self.browser_type = finder_options.browser_type | 301 self.browser_type = finder_options.browser_type |
289 | 302 |
290 if hasattr(self, 'extra_browser_args_as_string'): # pylint: disable=E1101 | 303 if hasattr(self, 'extra_browser_args_as_string'): # pylint: disable=E1101 |
(...skipping 28 matching lines...) Expand all Loading... |
319 | 332 |
320 @property | 333 @property |
321 def extra_browser_args(self): | 334 def extra_browser_args(self): |
322 return self._extra_browser_args | 335 return self._extra_browser_args |
323 | 336 |
324 def AppendExtraBrowserArgs(self, args): | 337 def AppendExtraBrowserArgs(self, args): |
325 if isinstance(args, list): | 338 if isinstance(args, list): |
326 self._extra_browser_args.update(args) | 339 self._extra_browser_args.update(args) |
327 else: | 340 else: |
328 self._extra_browser_args.add(args) | 341 self._extra_browser_args.add(args) |
OLD | NEW |