| 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 from recipe_engine.types import freeze | 5 from recipe_engine.types import freeze |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'adb', | 8 'adb', |
| 9 'chromium', | 9 'chromium', |
| 10 'chromium_android', | 10 'chromium_android', |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 api.chromium.output_dir.join('chrome_public_apk', 'classes.dex.zip')) | 147 api.chromium.output_dir.join('chrome_public_apk', 'classes.dex.zip')) |
| 148 | 148 |
| 149 if config.get('specific_install'): | 149 if config.get('specific_install'): |
| 150 api.chromium_android.adb_install_apk('Chrome.apk', devices=['abc123']) | 150 api.chromium_android.adb_install_apk('Chrome.apk', devices=['abc123']) |
| 151 | 151 |
| 152 api.adb.root_devices() | 152 api.adb.root_devices() |
| 153 api.chromium_android.spawn_logcat_monitor() | 153 api.chromium_android.spawn_logcat_monitor() |
| 154 | 154 |
| 155 failure = False | 155 failure = False |
| 156 try: | 156 try: |
| 157 # TODO(luqui): remove redundant cruft, need one consistent API. | 157 # detect_and_setup_devices contains device recovery, provisiong, and status. |
| 158 api.chromium_android.detect_and_setup_devices() | 158 api.chromium_android.detect_and_setup_devices() |
| 159 | 159 api.chromium_android.device_status_check() |
| 160 api.chromium_android.device_status_check( | 160 # Needed to test all flags to provision devices. |
| 161 restart_usb=config.get('restart_usb', False)) | |
| 162 | |
| 163 api.chromium_android.provision_devices( | 161 api.chromium_android.provision_devices( |
| 164 skip_wipe=config.get('skip_wipe', False), | 162 skip_wipe=config.get('skip_wipe', False), |
| 165 disable_location=config.get('disable_location', False), | 163 disable_location=config.get('disable_location', False), |
| 166 min_battery_level=config.get('min_battery_level'), | 164 min_battery_level=config.get('min_battery_level'), |
| 167 max_battery_temp=config.get('max_battery_temp'), | 165 max_battery_temp=config.get('max_battery_temp'), |
| 168 reboot_timeout=1800, | 166 reboot_timeout=1800, |
| 169 remove_system_webview=config.get('remove_system_webview', False), | 167 remove_system_webview=config.get('remove_system_webview', False), |
| 170 disable_system_chrome=config.get('disable_system_chrome', False)) | 168 disable_system_chrome=config.get('disable_system_chrome', False)) |
| 171 | 169 |
| 172 except api.step.StepFailure as f: | 170 except api.step.StepFailure as f: |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 slavename='tehslave', | 239 slavename='tehslave', |
| 242 repo_name='src/repo', | 240 repo_name='src/repo', |
| 243 patch_url='https://the.patch.url/the.patch', | 241 patch_url='https://the.patch.url/the.patch', |
| 244 repo_url='svn://svn.chromium.org/chrome/trunk/src', | 242 repo_url='svn://svn.chromium.org/chrome/trunk/src', |
| 245 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', | 243 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 246 internal=True) | 244 internal=True) |
| 247 | 245 |
| 248 for buildername in BUILDERS: | 246 for buildername in BUILDERS: |
| 249 yield api.test('%s_basic' % buildername) + properties_for(buildername) | 247 yield api.test('%s_basic' % buildername) + properties_for(buildername) |
| 250 | 248 |
| 251 yield (api.test('tester_no_devices') + | 249 yield (api.test('tester_no_devices_during_recovery') + |
| 252 properties_for('tester') + | 250 properties_for('tester') + |
| 253 api.step_data('device_status_check', retcode=1)) | 251 api.step_data('device_recovery', retcode=1)) |
| 254 | 252 |
| 255 yield (api.test('tester_other_device_failure') + | 253 yield (api.test('tester_no_devices_during_status') + |
| 256 properties_for('tester') + | 254 properties_for('tester') + |
| 257 api.step_data('device_status_check', retcode=2)) | 255 api.step_data('device_status', retcode=1)) |
| 256 |
| 257 yield (api.test('tester_other_device_failure_during_recovery') + |
| 258 properties_for('tester') + |
| 259 api.step_data('device_recovery', retcode=2)) |
| 260 |
| 261 yield (api.test('tester_other_device_failure_during_status') + |
| 262 properties_for('tester') + |
| 263 api.step_data('device_status', retcode=2)) |
| 258 | 264 |
| 259 yield (api.test('tester_with_step_warning') + | 265 yield (api.test('tester_with_step_warning') + |
| 260 properties_for('tester') + | 266 properties_for('tester') + |
| 261 api.step_data('unittests', retcode=88)) | 267 api.step_data('unittests', retcode=88)) |
| 262 | 268 |
| 263 yield (api.test('tester_blacklisted_devices') + | 269 yield (api.test('tester_blacklisted_devices') + |
| 264 properties_for('tester') + | 270 properties_for('tester') + |
| 265 api.override_step_data('provision_devices', | 271 api.override_step_data('provision_devices', |
| 266 api.json.output(['abc123', 'def456']))) | 272 api.json.output(['abc123', 'def456']))) |
| 267 | 273 |
| 268 yield (api.test('tester_offline_devices') + | 274 yield (api.test('tester_offline_devices') + |
| 269 properties_for('tester') + | 275 properties_for('tester') + |
| 270 api.override_step_data('device_status_check', | 276 api.override_step_data('device_status', |
| 271 api.json.output([{}, {}]))) | 277 api.json.output([{}, {}]))) |
| 272 | 278 |
| 273 yield (api.test('perf_tests_failure') + | 279 yield (api.test('perf_tests_failure') + |
| 274 properties_for('perf_runner') + | 280 properties_for('perf_runner') + |
| 275 api.step_data('perf_test.foo', retcode=1)) | 281 api.step_data('perf_test.foo', retcode=1)) |
| 276 | 282 |
| 277 yield (api.test('gerrit_refs') + | 283 yield (api.test('gerrit_refs') + |
| 278 api.properties.generic( | 284 api.properties.generic( |
| 279 buildername='gerrit_try_builder', | 285 buildername='gerrit_try_builder', |
| 280 slavename='testslave', | 286 slavename='testslave', |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 properties_for('tester') + | 396 properties_for('tester') + |
| 391 api.path.exists( | 397 api.path.exists( |
| 392 api.path['cache'].join('known_android_devices')) + | 398 api.path['cache'].join('known_android_devices')) + |
| 393 api.override_step_data('fix_device_file_format.read_device_file', | 399 api.override_step_data('fix_device_file_format.read_device_file', |
| 394 api.raw_io.output('["device1", "device2"]'))) | 400 api.raw_io.output('["device1", "device2"]'))) |
| 395 | 401 |
| 396 yield (api.test('tombstones_m53') + | 402 yield (api.test('tombstones_m53') + |
| 397 properties_for('tester') + | 403 properties_for('tester') + |
| 398 api.override_step_data('get version (2)', | 404 api.override_step_data('get version (2)', |
| 399 api.raw_io.output('MAJOR=53\nMINOR=0\nBUILD=2800\nPATCH=0\n'))) | 405 api.raw_io.output('MAJOR=53\nMINOR=0\nBUILD=2800\nPATCH=0\n'))) |
| OLD | NEW |