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

Side by Side Diff: build/android/pylib/monkey/test_runner.py

Issue 333933003: [Android] Switch to DeviceUtils version of RunShellCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 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
« no previous file with comments | « build/android/pylib/linker/test_case.py ('k') | build/android/pylib/perf/cache_control.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Runs a monkey test on a single device.""" 5 """Runs a monkey test on a single device."""
6 6
7 import logging 7 import logging
8 import random 8 import random
9 9
10 from pylib import constants 10 from pylib import constants
(...skipping 22 matching lines...) Expand all
33 cmd = ['monkey', 33 cmd = ['monkey',
34 '-p %s' % self._package, 34 '-p %s' % self._package,
35 ' '.join(['-c %s' % c for c in self._options.category]), 35 ' '.join(['-c %s' % c for c in self._options.category]),
36 '--throttle %d' % self._options.throttle, 36 '--throttle %d' % self._options.throttle,
37 '-s %d' % (self._options.seed or random.randint(1, 100)), 37 '-s %d' % (self._options.seed or random.randint(1, 100)),
38 '-v ' * self._options.verbose_count, 38 '-v ' * self._options.verbose_count,
39 '--monitor-native-crashes', 39 '--monitor-native-crashes',
40 '--kill-process-after-error', 40 '--kill-process-after-error',
41 self._options.extra_args, 41 self._options.extra_args,
42 '%d' % self._options.event_count] 42 '%d' % self._options.event_count]
43 return self.device.old_interface.RunShellCommand( 43 return self.device.RunShellCommand(' '.join(cmd), timeout=timeout_ms)
44 ' '.join(cmd), timeout_time=timeout_ms)
45 44
46 def RunTest(self, test_name): 45 def RunTest(self, test_name):
47 """Run a Monkey test on the device. 46 """Run a Monkey test on the device.
48 47
49 Args: 48 Args:
50 test_name: String to use for logging the test result. 49 test_name: String to use for logging the test result.
51 50
52 Returns: 51 Returns:
53 A tuple of (TestRunResults, retry). 52 A tuple of (TestRunResults, retry).
54 """ 53 """
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 result = base_test_result.BaseTestResult( 85 result = base_test_result.BaseTestResult(
87 test_name, base_test_result.ResultType.FAIL, log=output) 86 test_name, base_test_result.ResultType.FAIL, log=output)
88 if 'chrome' in self._options.package: 87 if 'chrome' in self._options.package:
89 logging.warning('Starting MinidumpUploadService...') 88 logging.warning('Starting MinidumpUploadService...')
90 try: 89 try:
91 self.device.old_interface.StartCrashUploadService(self._package) 90 self.device.old_interface.StartCrashUploadService(self._package)
92 except AssertionError as e: 91 except AssertionError as e:
93 logging.error('Failed to start MinidumpUploadService: %s', e) 92 logging.error('Failed to start MinidumpUploadService: %s', e)
94 results.AddResult(result) 93 results.AddResult(result)
95 return results, False 94 return results, False
OLDNEW
« no previous file with comments | « build/android/pylib/linker/test_case.py ('k') | build/android/pylib/perf/cache_control.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698