| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 api.chromium.output_dir.join('chrome_public_apk', 'classes.dex.zip')) | 141 api.chromium.output_dir.join('chrome_public_apk', 'classes.dex.zip')) |
| 142 | 142 |
| 143 if config.get('specific_install'): | 143 if config.get('specific_install'): |
| 144 api.chromium_android.adb_install_apk('Chrome.apk', devices=['abc123']) | 144 api.chromium_android.adb_install_apk('Chrome.apk', devices=['abc123']) |
| 145 | 145 |
| 146 api.adb.root_devices() | 146 api.adb.root_devices() |
| 147 api.chromium_android.spawn_logcat_monitor() | 147 api.chromium_android.spawn_logcat_monitor() |
| 148 | 148 |
| 149 failure = False | 149 failure = False |
| 150 try: | 150 try: |
| 151 # TODO(luqui): remove redundant cruft, need one consistent API. | 151 # detect_and_setup_devices contains device recovery, provisiong, and status. |
| 152 api.chromium_android.detect_and_setup_devices() | 152 api.chromium_android.detect_and_setup_devices() |
| 153 | 153 api.chromium_android.device_status_check() |
| 154 api.chromium_android.device_status_check( | 154 # Needed to test all flags to provision devices. |
| 155 restart_usb=config.get('restart_usb', False)) | |
| 156 | |
| 157 api.chromium_android.provision_devices( | 155 api.chromium_android.provision_devices( |
| 158 skip_wipe=config.get('skip_wipe', False), | 156 skip_wipe=config.get('skip_wipe', False), |
| 159 disable_location=config.get('disable_location', False), | 157 disable_location=config.get('disable_location', False), |
| 160 min_battery_level=config.get('min_battery_level'), | 158 min_battery_level=config.get('min_battery_level'), |
| 161 max_battery_temp=config.get('max_battery_temp'), | 159 max_battery_temp=config.get('max_battery_temp'), |
| 162 reboot_timeout=1800, | 160 reboot_timeout=1800, |
| 163 remove_system_webview=config.get('remove_system_webview', False), | 161 remove_system_webview=config.get('remove_system_webview', False), |
| 164 disable_system_chrome=config.get('disable_system_chrome', False)) | 162 disable_system_chrome=config.get('disable_system_chrome', False)) |
| 165 | 163 |
| 166 except api.step.StepFailure as f: | 164 except api.step.StepFailure as f: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 slavename='tehslave', | 231 slavename='tehslave', |
| 234 repo_name='src/repo', | 232 repo_name='src/repo', |
| 235 patch_url='https://the.patch.url/the.patch', | 233 patch_url='https://the.patch.url/the.patch', |
| 236 repo_url='svn://svn.chromium.org/chrome/trunk/src', | 234 repo_url='svn://svn.chromium.org/chrome/trunk/src', |
| 237 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', | 235 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 238 internal=True) | 236 internal=True) |
| 239 | 237 |
| 240 for buildername in BUILDERS: | 238 for buildername in BUILDERS: |
| 241 yield api.test('%s_basic' % buildername) + properties_for(buildername) | 239 yield api.test('%s_basic' % buildername) + properties_for(buildername) |
| 242 | 240 |
| 243 yield (api.test('tester_no_devices') + | 241 yield (api.test('tester_no_devices_during_recovery') + |
| 244 properties_for('tester') + | 242 properties_for('tester') + |
| 245 api.step_data('device_status_check', retcode=1)) | 243 api.step_data('device_recovery', retcode=1)) |
| 246 | 244 |
| 247 yield (api.test('tester_other_device_failure') + | 245 yield (api.test('tester_no_devices_during_status') + |
| 248 properties_for('tester') + | 246 properties_for('tester') + |
| 249 api.step_data('device_status_check', retcode=2)) | 247 api.step_data('device_status', retcode=1)) |
| 248 |
| 249 yield (api.test('tester_other_device_failure_during_recovery') + |
| 250 properties_for('tester') + |
| 251 api.step_data('device_recovery', retcode=2)) |
| 252 |
| 253 yield (api.test('tester_other_device_failure_during_status') + |
| 254 properties_for('tester') + |
| 255 api.step_data('device_status', retcode=2)) |
| 250 | 256 |
| 251 yield (api.test('tester_with_step_warning') + | 257 yield (api.test('tester_with_step_warning') + |
| 252 properties_for('tester') + | 258 properties_for('tester') + |
| 253 api.step_data('unittests', retcode=88)) | 259 api.step_data('unittests', retcode=88)) |
| 254 | 260 |
| 255 yield (api.test('tester_blacklisted_devices') + | 261 yield (api.test('tester_blacklisted_devices') + |
| 256 properties_for('tester') + | 262 properties_for('tester') + |
| 257 api.override_step_data('provision_devices', | 263 api.override_step_data('provision_devices', |
| 258 api.json.output(['abc123', 'def456']))) | 264 api.json.output(['abc123', 'def456']))) |
| 259 | 265 |
| 260 yield (api.test('tester_offline_devices') + | 266 yield (api.test('tester_offline_devices') + |
| 261 properties_for('tester') + | 267 properties_for('tester') + |
| 262 api.override_step_data('device_status_check', | 268 api.override_step_data('device_status', |
| 263 api.json.output([{}, {}]))) | 269 api.json.output([{}, {}]))) |
| 264 | 270 |
| 265 yield (api.test('perf_tests_failure') + | 271 yield (api.test('perf_tests_failure') + |
| 266 properties_for('perf_runner') + | 272 properties_for('perf_runner') + |
| 267 api.step_data('perf_test.foo', retcode=1)) | 273 api.step_data('perf_test.foo', retcode=1)) |
| 268 | 274 |
| 269 yield (api.test('gerrit_refs') + | 275 yield (api.test('gerrit_refs') + |
| 270 api.properties.generic( | 276 api.properties.generic( |
| 271 buildername='gerrit_try_builder', | 277 buildername='gerrit_try_builder', |
| 272 slavename='testslave', | 278 slavename='testslave', |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 'Created xml report file at file:///path/to/testResult.xml', | 371 'Created xml report file at file:///path/to/testResult.xml', |
| 366 stream='stdout')) + | 372 stream='stdout')) + |
| 367 api.override_step_data('Read test result and report failures', | 373 api.override_step_data('Read test result and report failures', |
| 368 api.raw_io.output(result_xml_with_unexpected_failure_method))) | 374 api.raw_io.output(result_xml_with_unexpected_failure_method))) |
| 369 | 375 |
| 370 yield (api.test('webview_cts_invalid_output') + | 376 yield (api.test('webview_cts_invalid_output') + |
| 371 properties_for('webview_cts') + | 377 properties_for('webview_cts') + |
| 372 api.override_step_data('Run CTS', api.raw_io.stream_output( | 378 api.override_step_data('Run CTS', api.raw_io.stream_output( |
| 373 'Invalid CTS output here...', | 379 'Invalid CTS output here...', |
| 374 stream='stdout'))) | 380 stream='stdout'))) |
| OLD | NEW |