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

Unified Diff: build/android/run_monkey_test.py

Issue 11273099: Restart app before running monkey test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: build/android/run_monkey_test.py
diff --git a/build/android/run_monkey_test.py b/build/android/run_monkey_test.py
index 8abe975b018a3c09396b360dd5640dc1f3fc677c..cdef7f57df2c410ba9cee3f1a6360eab9dafd4b2 100755
--- a/build/android/run_monkey_test.py
+++ b/build/android/run_monkey_test.py
@@ -6,10 +6,15 @@
"""Runs the Monkey tests on one or more devices."""
import logging
import optparse
+import os
import random
import sys
import time
+# Don't need these deps.
bulach 2012/10/30 10:52:50 hmm, which bit needs this? would it be possible to
frankf 2012/10/30 19:05:22 Good point. I fixed the root cause by moving class
+os.environ['ANDROID_SDK_ROOT'] = ''
+os.environ['ANDROID_BUILD_TOP'] = ''
+
from pylib import android_commands
from pylib import python_test_base
from pylib import python_test_sharder
@@ -24,6 +29,7 @@ class MonkeyTest(python_test_base.PythonTestBase):
# Launch and wait for Chrome to launch.
self.adb.StartActivity(self.options.package_name,
self.options.activity_name,
+ force_stop=True,
wait_for_completion=True,
action='android.intent.action.MAIN')
@@ -90,7 +96,6 @@ class MonkeyTest(python_test_base.PythonTestBase):
return self.adb.RunShellCommand(' '.join(cmd), timeout_time=timeout_ms)
-
def DispatchPythonTests(options):
"""Dispatches the Monkey tests, sharding it if there multiple devices."""
logger = logging.getLogger()
@@ -104,13 +109,14 @@ def DispatchPythonTests(options):
# Actually run the tests.
logging.debug('Running monkey tests.')
available_tests *= len(attached_devices)
- options.ensure_value('shard_retries',1)
+ options.ensure_value('shard_retries', 1)
sharder = python_test_sharder.PythonTestSharder(
attached_devices, available_tests, options)
result = sharder.RunShardedTests()
result.LogFull('Monkey', 'Monkey', options.build_type)
result.PrintAnnotation()
+
def main():
desc = 'Run the Monkey tests on 1 or more devices.'
parser = optparse.OptionParser(description=desc)
« build/android/pylib/android_commands.py ('K') | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698