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

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: Fixed bulach's comments 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/pylib/apk_info.py » ('j') | no next file with comments »
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..c40870e40137971d8f3330ed66eddb7d9c1b4464 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -508,7 +508,8 @@ class AndroidCommands(object):
def StartActivity(self, package, activity, wait_for_completion=False,
action='android.intent.action.VIEW',
category=None, data=None,
- extras=None, trace_file_name=None):
+ extras=None, trace_file_name=None,
+ force_stop=False):
"""Starts |package|'s activity on the device.
Args:
@@ -521,8 +522,12 @@ class AndroidCommands(object):
data: Data string to pass to activity (e.g. 'http://www.example.com/').
extras: Dict of extras to pass to activity. Values are significant.
trace_file_name: If used, turns on and saves the trace to this file name.
+ force_stop: force stop the target app before starting the activity (-S
+ flag).
"""
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/pylib/apk_info.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698