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

Unified Diff: tools/telemetry/telemetry/internal/backends/android_app_backend.py

Issue 1606243002: [Telemetry] Small fixes in android_app_backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unittest Created 4 years, 11 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 | tools/telemetry/telemetry/internal/backends/android_app_backend_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/internal/backends/android_app_backend.py
diff --git a/tools/telemetry/telemetry/internal/backends/android_app_backend.py b/tools/telemetry/telemetry/internal/backends/android_app_backend.py
index 96403beea9662f32f871a90fe2abb805935f3334..ada3eb4480e77376b75eb13725ebc07e44096e35 100644
--- a/tools/telemetry/telemetry/internal/backends/android_app_backend.py
+++ b/tools/telemetry/telemetry/internal/backends/android_app_backend.py
@@ -46,8 +46,11 @@ class AndroidAppBackend(app_backend.AppBackend):
# TODO(slamm): check if the wait for "ps" check is really needed, or
# whether the "blocking=True" fall back is sufficient.
has_ready_predicate = self._is_app_ready_predicate is not None
- self.device.StartActivity(self._start_intent,
- blocking=not has_ready_predicate)
+ self.device.StartActivity(
+ self._start_intent,
+ blocking=not has_ready_predicate,
+ force_stop=True, # Ensure app was not running.
+ )
if has_ready_predicate:
util.WaitFor(is_app_ready, timeout=60)
@@ -87,7 +90,9 @@ class AndroidAppBackend(app_backend.AppBackend):
def GetProcesses(self, process_filter=None):
if process_filter is None:
- process_filter = lambda n: re.match('^' + self._default_process_name, n)
+ # Match process names of the form: 'process_name[:subprocess]'.
+ process_filter = re.compile(
+ '^%s(:|$)' % re.escape(self._default_process_name)).match
processes = set()
ps_output = self.platform_backend.GetPsOutput(['pid', 'name'])
« no previous file with comments | « no previous file | tools/telemetry/telemetry/internal/backends/android_app_backend_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698