OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 | 6 |
7 from devil.android import device_errors | 7 from devil.android import device_errors |
8 from devil.android.sdk import intent | 8 from devil.android.sdk import intent |
9 from pylib import constants | 9 from pylib import constants |
10 from pylib.base import base_test_result | 10 from pylib.base import base_test_result |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 '--throttle', str(self._test_instance.throttle), | 108 '--throttle', str(self._test_instance.throttle), |
109 '-s', str(self._test_instance.seed), | 109 '-s', str(self._test_instance.seed), |
110 '--monitor-native-crashes', | 110 '--monitor-native-crashes', |
111 '--kill-process-after-error'] | 111 '--kill-process-after-error'] |
112 for category in self._test_instance.categories: | 112 for category in self._test_instance.categories: |
113 cmd.extend(['-c', category]) | 113 cmd.extend(['-c', category]) |
114 for _ in range(self._test_instance.verbose_count): | 114 for _ in range(self._test_instance.verbose_count): |
115 cmd.append('-v') | 115 cmd.append('-v') |
116 cmd.append(str(self._test_instance.event_count)) | 116 cmd.append(str(self._test_instance.event_count)) |
117 return device.RunShellCommand( | 117 return device.RunShellCommand( |
118 cmd, timeout=self._test_instance.timeout) | 118 cmd, timeout=self._test_instance.timeout, check_return=True) |
119 finally: | 119 finally: |
120 try: | 120 try: |
121 # Kill the monkey test process on the device. If you manually | 121 # Kill the monkey test process on the device. If you manually |
122 # interupt the test run, this will prevent the monkey test from | 122 # interupt the test run, this will prevent the monkey test from |
123 # continuing to run. | 123 # continuing to run. |
124 device.KillAll('com.android.commands.monkey') | 124 device.KillAll('com.android.commands.monkey') |
125 except device_errors.CommandFailedError: | 125 except device_errors.CommandFailedError: |
126 pass | 126 pass |
OLD | NEW |