Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: build/android/pylib/local/device/local_device_monkey_test_run.py

Issue 2760923002: [build/android] Fix device.RunShellCommand usages (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698