| 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 if os.path.isabs(args.isolate_file_path): | 293 self._isolate_abs_path = os.path.abspath(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) | |
| 298 self._isolate_delegate = isolate_delegate | 294 self._isolate_delegate = isolate_delegate |
| 299 self._isolated_abs_path = os.path.join( | 295 self._isolated_abs_path = os.path.join( |
| 300 constants.GetOutDirectory(), '%s.isolated' % self._test_package) | 296 constants.GetOutDirectory(), '%s.isolated' % self._test_package) |
| 301 else: | 297 else: |
| 302 self._isolate_delegate = None | 298 self._isolate_delegate = None |
| 303 | 299 |
| 304 # TODO(jbudorick): Deprecate and remove --test-data once data dependencies | 300 # TODO(jbudorick): Deprecate and remove --test-data once data dependencies |
| 305 # are fully converted to isolate. | 301 # are fully converted to isolate. |
| 306 if args.test_data: | 302 if args.test_data: |
| 307 logging.info('Data dependencies specified via --test-data') | 303 logging.info('Data dependencies specified via --test-data') |
| (...skipping 29 matching lines...) Expand all Loading... |
| 337 else: | 333 else: |
| 338 self._excluded_annotations = {} | 334 self._excluded_annotations = {} |
| 339 | 335 |
| 340 self._excluded_annotations.update( | 336 self._excluded_annotations.update( |
| 341 { | 337 { |
| 342 a: None for a in _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS | 338 a: None for a in _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS |
| 343 if a not in self._annotations | 339 if a not in self._annotations |
| 344 }) | 340 }) |
| 345 | 341 |
| 346 def _initializeFlagAttributes(self, args): | 342 def _initializeFlagAttributes(self, args): |
| 347 self._flags = ['--enable-test-intents'] | 343 self._flags = ['--disable-fre', '--enable-test-intents'] |
| 348 # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file" | 344 # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file" |
| 349 if hasattr(args, 'device_flags') and args.device_flags: | 345 if hasattr(args, 'device_flags') and args.device_flags: |
| 350 with open(args.device_flags) as device_flags_file: | 346 with open(args.device_flags) as device_flags_file: |
| 351 stripped_lines = (l.strip() for l in device_flags_file) | 347 stripped_lines = (l.strip() for l in device_flags_file) |
| 352 self._flags.extend([flag for flag in stripped_lines if flag]) | 348 self._flags.extend([flag for flag in stripped_lines if flag]) |
| 353 if hasattr(args, 'device_flags_file') and args.device_flags_file: | 349 if hasattr(args, 'device_flags_file') and args.device_flags_file: |
| 354 with open(args.device_flags_file) as device_flags_file: | 350 with open(args.device_flags_file) as device_flags_file: |
| 355 stripped_lines = (l.strip() for l in device_flags_file) | 351 stripped_lines = (l.strip() for l in device_flags_file) |
| 356 self._flags.extend([flag for flag in stripped_lines if flag]) | 352 self._flags.extend([flag for flag in stripped_lines if flag]) |
| 357 if (hasattr(args, 'strict_mode') and | 353 if (hasattr(args, 'strict_mode') and |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 def GenerateTestResults( | 629 def GenerateTestResults( |
| 634 result_code, result_bundle, statuses, start_ms, duration_ms): | 630 result_code, result_bundle, statuses, start_ms, duration_ms): |
| 635 return GenerateTestResults(result_code, result_bundle, statuses, | 631 return GenerateTestResults(result_code, result_bundle, statuses, |
| 636 start_ms, duration_ms) | 632 start_ms, duration_ms) |
| 637 | 633 |
| 638 #override | 634 #override |
| 639 def TearDown(self): | 635 def TearDown(self): |
| 640 if self._isolate_delegate: | 636 if self._isolate_delegate: |
| 641 self._isolate_delegate.Clear() | 637 self._isolate_delegate.Clear() |
| 642 | 638 |
| OLD | NEW |