| 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 logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import pickle | 7 import pickle |
| 8 import re | 8 import re |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) | 23 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) |
| 24 import unittest_util | 24 import unittest_util |
| 25 | 25 |
| 26 # Ref: http://developer.android.com/reference/android/app/Activity.html | 26 # Ref: http://developer.android.com/reference/android/app/Activity.html |
| 27 _ACTIVITY_RESULT_CANCELED = 0 | 27 _ACTIVITY_RESULT_CANCELED = 0 |
| 28 _ACTIVITY_RESULT_OK = -1 | 28 _ACTIVITY_RESULT_OK = -1 |
| 29 | 29 |
| 30 _DEFAULT_ANNOTATIONS = [ | 30 _DEFAULT_ANNOTATIONS = [ |
| 31 'Smoke', 'SmallTest', 'MediumTest', 'LargeTest', | 31 'Smoke', 'SmallTest', 'MediumTest', 'LargeTest', |
| 32 'EnormousTest', 'IntegrationTest'] | 32 'EnormousTest', 'IntegrationTest'] |
| 33 _EXTRA_ENABLE_HTTP_SERVER = ( | |
| 34 'org.chromium.chrome.test.ChromeInstrumentationTestRunner.' | |
| 35 + 'EnableTestHttpServer') | |
| 36 _EXTRA_DRIVER_TEST_LIST = ( | 33 _EXTRA_DRIVER_TEST_LIST = ( |
| 37 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList') | 34 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList') |
| 38 _EXTRA_DRIVER_TEST_LIST_FILE = ( | 35 _EXTRA_DRIVER_TEST_LIST_FILE = ( |
| 39 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile') | 36 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile') |
| 40 _EXTRA_DRIVER_TARGET_PACKAGE = ( | 37 _EXTRA_DRIVER_TARGET_PACKAGE = ( |
| 41 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage') | 38 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage') |
| 42 _EXTRA_DRIVER_TARGET_CLASS = ( | 39 _EXTRA_DRIVER_TARGET_CLASS = ( |
| 43 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass') | 40 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass') |
| 44 _NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE) | 41 _NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE) |
| 45 _PICKLE_FORMAT_VERSION = 10 | 42 _PICKLE_FORMAT_VERSION = 10 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 for m in c['methods']: | 476 for m in c['methods']: |
| 480 a = dict(c['annotations']) | 477 a = dict(c['annotations']) |
| 481 a.update(m['annotations']) | 478 a.update(m['annotations']) |
| 482 inflated_tests.append({ | 479 inflated_tests.append({ |
| 483 'class': c['class'], | 480 'class': c['class'], |
| 484 'method': m['method'], | 481 'method': m['method'], |
| 485 'annotations': a, | 482 'annotations': a, |
| 486 }) | 483 }) |
| 487 return inflated_tests | 484 return inflated_tests |
| 488 | 485 |
| 489 @staticmethod | |
| 490 def GetHttpServerEnvironmentVars(): | |
| 491 return { | |
| 492 _EXTRA_ENABLE_HTTP_SERVER: None, | |
| 493 } | |
| 494 | |
| 495 def GetDriverEnvironmentVars( | 486 def GetDriverEnvironmentVars( |
| 496 self, test_list=None, test_list_file_path=None): | 487 self, test_list=None, test_list_file_path=None): |
| 497 env = { | 488 env = { |
| 498 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package, | 489 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package, |
| 499 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner, | 490 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner, |
| 500 } | 491 } |
| 501 | 492 |
| 502 if test_list: | 493 if test_list: |
| 503 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list) | 494 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list) |
| 504 | 495 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 516 def GenerateTestResults( | 507 def GenerateTestResults( |
| 517 result_code, result_bundle, statuses, start_ms, duration_ms): | 508 result_code, result_bundle, statuses, start_ms, duration_ms): |
| 518 return GenerateTestResults(result_code, result_bundle, statuses, | 509 return GenerateTestResults(result_code, result_bundle, statuses, |
| 519 start_ms, duration_ms) | 510 start_ms, duration_ms) |
| 520 | 511 |
| 521 #override | 512 #override |
| 522 def TearDown(self): | 513 def TearDown(self): |
| 523 if self._isolate_delegate: | 514 if self._isolate_delegate: |
| 524 self._isolate_delegate.Clear() | 515 self._isolate_delegate.Clear() |
| 525 | 516 |
| OLD | NEW |