Chromium Code Reviews| 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 re | 6 import re |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from devil.android import device_errors | 9 from devil.android import device_errors |
| 10 from devil.android import flag_changer | 10 from devil.android import flag_changer |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 r.SetName(test_display_name) | 257 r.SetName(test_display_name) |
| 258 if DidPackageCrashOnDevice(self._test_instance.test_package, device): | 258 if DidPackageCrashOnDevice(self._test_instance.test_package, device): |
| 259 for r in results: | 259 for r in results: |
| 260 if r.GetType() == base_test_result.ResultType.UNKNOWN: | 260 if r.GetType() == base_test_result.ResultType.UNKNOWN: |
| 261 r.SetType(base_test_result.ResultType.CRASH) | 261 r.SetType(base_test_result.ResultType.CRASH) |
| 262 | 262 |
| 263 if any(r.GetType() not in (base_test_result.ResultType.PASS, | 263 if any(r.GetType() not in (base_test_result.ResultType.PASS, |
| 264 base_test_result.ResultType.SKIP) | 264 base_test_result.ResultType.SKIP) |
| 265 for r in results): | 265 for r in results): |
| 266 logging.info('detected failure in %s. raw output:', test_display_name) | 266 logging.info('detected failure in %s. raw output:', test_display_name) |
| 267 if self._test_instance.screenshot_dir: | |
| 268 device.TakeScreenshot(self._test_instance.screenshot_dir) | |
|
jbudorick
2016/05/18 17:52:21
TakeScreenshot returns the host path of the screen
BigBossZhiling
2016/05/18 19:22:22
Done.
| |
| 267 for l in output: | 269 for l in output: |
| 268 logging.info(' %s', l) | 270 logging.info(' %s', l) |
| 269 if (not self._env.skip_clear_data | 271 if (not self._env.skip_clear_data |
| 270 and self._test_instance.package_info): | 272 and self._test_instance.package_info): |
| 271 permissions = ( | 273 permissions = ( |
| 272 self._test_instance.apk_under_test.GetPermissions() | 274 self._test_instance.apk_under_test.GetPermissions() |
| 273 if self._test_instance.apk_under_test | 275 if self._test_instance.apk_under_test |
| 274 else None) | 276 else None) |
| 275 device.ClearApplicationState(self._test_instance.package_info.package, | 277 device.ClearApplicationState(self._test_instance.package_info.package, |
| 276 permissions=permissions) | 278 permissions=permissions) |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 301 timeout = v | 303 timeout = v |
| 302 break | 304 break |
| 303 else: | 305 else: |
| 304 logging.warning('Using default 1 minute timeout for %s', test_name) | 306 logging.warning('Using default 1 minute timeout for %s', test_name) |
| 305 timeout = 60 | 307 timeout = 60 |
| 306 | 308 |
| 307 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) | 309 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) |
| 308 | 310 |
| 309 return timeout | 311 return timeout |
| 310 | 312 |
| OLD | NEW |