OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 collections | 5 import collections |
6 import copy | 6 import copy |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import pickle | 9 import pickle |
10 import re | 10 import re |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 for apk in args.additional_apks: | 284 for apk in args.additional_apks: |
285 if not os.path.exists(apk): | 285 if not os.path.exists(apk): |
286 error_func('Unable to find additional APK: %s' % apk) | 286 error_func('Unable to find additional APK: %s' % apk) |
287 self._additional_apks = ( | 287 self._additional_apks = ( |
288 [apk_helper.ToHelper(x) for x in args.additional_apks]) | 288 [apk_helper.ToHelper(x) for x in args.additional_apks]) |
289 | 289 |
290 def _initializeDataDependencyAttributes(self, args, isolate_delegate): | 290 def _initializeDataDependencyAttributes(self, args, isolate_delegate): |
291 self._data_deps = [] | 291 self._data_deps = [] |
292 if args.isolate_file_path: | 292 if args.isolate_file_path: |
293 self._isolate_abs_path = os.path.abspath(args.isolate_file_path) | 293 if os.path.isabs(args.isolate_file_path): |
| 294 self._isolate_abs_path = args.isolate_file_path |
| 295 else: |
| 296 self._isolate_abs_path = os.path.join( |
| 297 constants.DIR_SOURCE_ROOT, args.isolate_file_path) |
294 self._isolate_delegate = isolate_delegate | 298 self._isolate_delegate = isolate_delegate |
295 self._isolated_abs_path = os.path.join( | 299 self._isolated_abs_path = os.path.join( |
296 constants.GetOutDirectory(), '%s.isolated' % self._test_package) | 300 constants.GetOutDirectory(), '%s.isolated' % self._test_package) |
297 else: | 301 else: |
298 self._isolate_delegate = None | 302 self._isolate_delegate = None |
299 | 303 |
300 # TODO(jbudorick): Deprecate and remove --test-data once data dependencies | 304 # TODO(jbudorick): Deprecate and remove --test-data once data dependencies |
301 # are fully converted to isolate. | 305 # are fully converted to isolate. |
302 if args.test_data: | 306 if args.test_data: |
303 logging.info('Data dependencies specified via --test-data') | 307 logging.info('Data dependencies specified via --test-data') |
(...skipping 29 matching lines...) Expand all Loading... |
333 else: | 337 else: |
334 self._excluded_annotations = {} | 338 self._excluded_annotations = {} |
335 | 339 |
336 self._excluded_annotations.update( | 340 self._excluded_annotations.update( |
337 { | 341 { |
338 a: None for a in _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS | 342 a: None for a in _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS |
339 if a not in self._annotations | 343 if a not in self._annotations |
340 }) | 344 }) |
341 | 345 |
342 def _initializeFlagAttributes(self, args): | 346 def _initializeFlagAttributes(self, args): |
343 self._flags = ['--disable-fre', '--enable-test-intents'] | 347 self._flags = ['--enable-test-intents'] |
344 # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file" | 348 # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file" |
345 if hasattr(args, 'device_flags') and args.device_flags: | 349 if hasattr(args, 'device_flags') and args.device_flags: |
346 with open(args.device_flags) as device_flags_file: | 350 with open(args.device_flags) as device_flags_file: |
347 stripped_lines = (l.strip() for l in device_flags_file) | 351 stripped_lines = (l.strip() for l in device_flags_file) |
348 self._flags.extend([flag for flag in stripped_lines if flag]) | 352 self._flags.extend([flag for flag in stripped_lines if flag]) |
349 if hasattr(args, 'device_flags_file') and args.device_flags_file: | 353 if hasattr(args, 'device_flags_file') and args.device_flags_file: |
350 with open(args.device_flags_file) as device_flags_file: | 354 with open(args.device_flags_file) as device_flags_file: |
351 stripped_lines = (l.strip() for l in device_flags_file) | 355 stripped_lines = (l.strip() for l in device_flags_file) |
352 self._flags.extend([flag for flag in stripped_lines if flag]) | 356 self._flags.extend([flag for flag in stripped_lines if flag]) |
353 if (hasattr(args, 'strict_mode') and | 357 if (hasattr(args, 'strict_mode') and |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 def GenerateTestResults( | 633 def GenerateTestResults( |
630 result_code, result_bundle, statuses, start_ms, duration_ms): | 634 result_code, result_bundle, statuses, start_ms, duration_ms): |
631 return GenerateTestResults(result_code, result_bundle, statuses, | 635 return GenerateTestResults(result_code, result_bundle, statuses, |
632 start_ms, duration_ms) | 636 start_ms, duration_ms) |
633 | 637 |
634 #override | 638 #override |
635 def TearDown(self): | 639 def TearDown(self): |
636 if self._isolate_delegate: | 640 if self._isolate_delegate: |
637 self._isolate_delegate.Clear() | 641 self._isolate_delegate.Clear() |
638 | 642 |
OLD | NEW |