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

Unified Diff: build/android/pylib/android_commands.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
« no previous file with comments | « no previous file | build/android/run_monkey_test.py » ('j') | build/android/run_monkey_test.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 852a1ce0a9a0196fb0a275e7fb55e0c787653261..8a4f9ad03d3fc55115c305a91de1eac2797c14a1 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -505,7 +505,8 @@ class AndroidCommands(object):
return 0
return processes_killed
- def StartActivity(self, package, activity, wait_for_completion=False,
+ def StartActivity(self, package, activity,
+ force_stop=False, wait_for_completion=False,
bulach 2012/10/30 10:52:50 nit: new default params should always be added at
frankf 2012/10/30 19:05:22 Done. On 2012/10/30 10:52:50, bulach wrote:
action='android.intent.action.VIEW',
category=None, data=None,
extras=None, trace_file_name=None):
@@ -515,6 +516,8 @@ class AndroidCommands(object):
package: Name of package to start (e.g. 'com.google.android.apps.chrome').
activity: Name of activity (e.g. '.Main' or
'com.google.android.apps.chrome.Main').
+ force_stop: force stop the target app before starting the activity (-S
+ flag).
wait_for_completion: wait for the activity to finish launching (-W flag).
action: string (e.g. "android.intent.action.MAIN"). Default is VIEW.
category: string (e.g. "android.intent.category.HOME")
@@ -523,6 +526,8 @@ class AndroidCommands(object):
trace_file_name: If used, turns on and saves the trace to this file name.
"""
cmd = 'am start -a %s' % action
+ if force_stop:
+ cmd += ' -S'
if wait_for_completion:
cmd += ' -W'
if category:
@@ -1080,4 +1085,3 @@ class NewLineNormalizer(object):
def flush(self):
self._output.flush()
-
« no previous file with comments | « no previous file | build/android/run_monkey_test.py » ('j') | build/android/run_monkey_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698