| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Common steps for recipes that sync/build Cronet sources.""" | 5 """Common steps for recipes that sync/build Cronet sources.""" |
| 6 | 6 |
| 7 from recipe_engine.types import freeze | 7 from recipe_engine.types import freeze |
| 8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 class CronetApi(recipe_api.RecipeApi): | 10 class CronetApi(recipe_api.RecipeApi): |
| 11 def __init__(self, **kwargs): | 11 def __init__(self, **kwargs): |
| 12 super(CronetApi, self).__init__(**kwargs) | 12 super(CronetApi, self).__init__(**kwargs) |
| 13 self._repo_path = None | 13 self._repo_path = None |
| 14 | 14 |
| 15 INSTRUMENTATION_TESTS = freeze([ | 15 INSTRUMENTATION_TESTS = freeze([ |
| 16 { | 16 { |
| 17 'test': 'CronetSampleTest', | 17 'target': 'cronet_sample_test_apk', |
| 18 'gyp_target': 'cronet_sample_test_apk', | |
| 19 'apk_under_test': 'CronetSample.apk', | |
| 20 'test_apk': 'CronetSampleTest.apk', | |
| 21 'additional_apks': [ | |
| 22 'ChromiumNetTestSupport.apk', | |
| 23 ], | |
| 24 }, | 18 }, |
| 25 { | 19 { |
| 26 'test': 'CronetTestInstrumentation', | 20 'target': 'cronet_test_instrumentation_apk', |
| 27 'gyp_target': 'cronet_test_instrumentation_apk', | |
| 28 'apk_under_test': 'CronetTest.apk', | |
| 29 'test_apk': 'CronetTestInstrumentation.apk', | |
| 30 'additional_apks': [ | |
| 31 'ChromiumNetTestSupport.apk', | |
| 32 ], | |
| 33 'isolate_file_path': | |
| 34 'components/cronet/android/cronet_test_instrumentation_apk.isolate', | |
| 35 }, | 21 }, |
| 36 ]) | 22 ]) |
| 37 | 23 |
| 38 UNIT_TESTS = freeze([ | 24 UNIT_TESTS = freeze([ |
| 39 'cronet_unittests', | 25 'cronet_unittests', |
| 40 'net_unittests', | 26 'net_unittests', |
| 41 ]) | 27 ]) |
| 42 | 28 |
| 43 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' | 29 DASHBOARD_UPLOAD_URL = 'https://chromeperf.appspot.com' |
| 44 | 30 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 self, build_config, unit_tests=UNIT_TESTS, | 90 self, build_config, unit_tests=UNIT_TESTS, |
| 105 instrumentation_tests=INSTRUMENTATION_TESTS): | 91 instrumentation_tests=INSTRUMENTATION_TESTS): |
| 106 droid = self.m.chromium_android | 92 droid = self.m.chromium_android |
| 107 checkout_path = self.m.path['checkout'] | 93 checkout_path = self.m.path['checkout'] |
| 108 droid.common_tests_setup_steps() | 94 droid.common_tests_setup_steps() |
| 109 with self.m.step.defer_results(): | 95 with self.m.step.defer_results(): |
| 110 for suite in unit_tests: | 96 for suite in unit_tests: |
| 111 droid.run_test_suite(suite, shard_timeout=180) | 97 droid.run_test_suite(suite, shard_timeout=180) |
| 112 for suite in instrumentation_tests: | 98 for suite in instrumentation_tests: |
| 113 droid.run_instrumentation_suite( | 99 droid.run_instrumentation_suite( |
| 114 name=suite['test'], | 100 name=suite['target'], |
| 115 apk_under_test=droid.apk_path(suite.get('apk_under_test')), | |
| 116 test_apk=droid.apk_path(suite.get('test_apk')), | |
| 117 additional_apks=[ | |
| 118 droid.apk_path(a) for a in suite.get('additional_apks') or ()], | |
| 119 isolate_file_path=suite.get('isolate_file_path'), | |
| 120 verbose=True, | 101 verbose=True, |
| 121 num_retries=0, | 102 num_retries=0, |
| 122 **suite.get('kwargs', {})) | 103 **suite.get('kwargs', {})) |
| 123 droid.common_tests_final_steps() | 104 droid.common_tests_final_steps() |
| 124 | 105 |
| OLD | NEW |