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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 self._apk_under_test_incremental_install_script = ( | 481 self._apk_under_test_incremental_install_script = ( |
482 args.apk_under_test_incremental_install_script) | 482 args.apk_under_test_incremental_install_script) |
483 self._test_apk_incremental_install_script = ( | 483 self._test_apk_incremental_install_script = ( |
484 args.test_apk_incremental_install_script) | 484 args.test_apk_incremental_install_script) |
485 | 485 |
486 if self._test_apk_incremental_install_script: | 486 if self._test_apk_incremental_install_script: |
487 assert self._suite.endswith('_incremental') | 487 assert self._suite.endswith('_incremental') |
488 self._suite = self._suite[:-len('_incremental')] | 488 self._suite = self._suite[:-len('_incremental')] |
489 | 489 |
490 self._test_jar = os.path.join( | 490 self._test_jar = args.test_jar |
491 constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR, | |
492 '%s.jar' % self._suite) | |
493 self._test_support_apk = apk_helper.ToHelper(os.path.join( | 491 self._test_support_apk = apk_helper.ToHelper(os.path.join( |
494 constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR, | 492 constants.GetOutDirectory(), constants.SDK_BUILD_TEST_JAVALIB_DIR, |
495 '%sSupport.apk' % self._suite)) | 493 '%sSupport.apk' % self._suite)) |
496 | 494 |
497 if not os.path.exists(self._test_apk.path): | 495 if not os.path.exists(self._test_apk.path): |
498 error_func('Unable to find test APK: %s' % self._test_apk.path) | 496 error_func('Unable to find test APK: %s' % self._test_apk.path) |
499 if not os.path.exists(self._test_jar): | 497 if not self._test_jar or not os.path.exists(self._test_jar): |
500 error_func('Unable to find test JAR: %s' % self._test_jar) | 498 error_func('Unable to find test JAR: %s' % self._test_jar) |
501 | 499 |
502 self._test_package = self._test_apk.GetPackageName() | 500 self._test_package = self._test_apk.GetPackageName() |
503 self._test_runner = self._test_apk.GetInstrumentationName() | 501 self._test_runner = self._test_apk.GetInstrumentationName() |
504 | 502 |
505 self._package_info = None | 503 self._package_info = None |
506 if self._apk_under_test: | 504 if self._apk_under_test: |
507 package_under_test = self._apk_under_test.GetPackageName() | 505 package_under_test = self._apk_under_test.GetPackageName() |
508 for package_info in constants.PACKAGE_INFO.itervalues(): | 506 for package_info in constants.PACKAGE_INFO.itervalues(): |
509 if package_under_test == package_info.package: | 507 if package_under_test == package_info.package: |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 | 741 |
744 @staticmethod | 742 @staticmethod |
745 def GenerateTestResults( | 743 def GenerateTestResults( |
746 result_code, result_bundle, statuses, start_ms, duration_ms): | 744 result_code, result_bundle, statuses, start_ms, duration_ms): |
747 return GenerateTestResults(result_code, result_bundle, statuses, | 745 return GenerateTestResults(result_code, result_bundle, statuses, |
748 start_ms, duration_ms) | 746 start_ms, duration_ms) |
749 | 747 |
750 #override | 748 #override |
751 def TearDown(self): | 749 def TearDown(self): |
752 pass | 750 pass |
OLD | NEW |