From cfcd35727e183f94be3312bcccfc3ee32480bb72 Mon Sep 17 00:00:00 2001 From: "ilevy@chromium.org" Date: Thu, 13 Sep 2012 07:47:44 +0000 Subject: Moved RunMonkeyTests out of android_commands.py (it did not fit) - simplified calling structure. R=frankf@chromium.org,bulach@chromium.org,klundberg@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/10908188 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156511 0039d316-1c4b-4281-b951-d872f2087c98 --- build/android/pylib/android_commands.py | 35 --------------------------------- 1 file changed, 35 deletions(-) (limited to 'build/android/pylib') diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py index 2b412f3..740f53c 100644 --- a/build/android/pylib/android_commands.py +++ b/build/android/pylib/android_commands.py @@ -11,7 +11,6 @@ import collections import datetime import logging import os -import random import re import shlex import subprocess @@ -1003,37 +1002,3 @@ class AndroidCommands(object): status = self._adb.SendShellCommand( '\'ls "%s" >/dev/null 2>&1; echo $?\'' % (file_name)) return int(status) == 0 - - def RunMonkey(self, package_name, category=None, throttle=100, seed=None, - event_count=10000, verbosity=1, extra_args=''): - """Runs monkey test for a given package. - - Args: - package_name: Allowed package. - category: A list of allowed categories. - throttle: Delay between events (ms). - seed: Seed value for pseduo-random generator. Same seed value - generates the same sequence of events. Seed is randomized by - default. - event_count: Number of events to generate. - verbosity: Verbosity level [0-3]. - extra_args: A string of other args to pass to the command verbatim. - - Returns: - Output of the test run. - """ - category = category or [] - seed = seed or random.randint(1, 100) - - cmd = ['monkey', - '-p %s' % package_name, - ' '.join(['-c %s' % c for c in category]), - '--throttle %d' % throttle, - '-s %d' % seed, - '-v ' * verbosity, - '--monitor-native-crashes', - '--kill-process-after-error', - extra_args, - '%d' % event_count] - return self.RunShellCommand(' '.join(cmd), - timeout_time=event_count*throttle*1.5) -- cgit v1.1