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

Unified Diff: telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 2398683006: [telemetry] Install PushAppsToBackground apk (Closed)
Patch Set: fixes Created 4 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: telemetry/telemetry/internal/platform/android_platform_backend.py
diff --git a/telemetry/telemetry/internal/platform/android_platform_backend.py b/telemetry/telemetry/internal/platform/android_platform_backend.py
index 3b57f66779275d245392320e15b66ce60fb323f7..45313b3ac091f0631b3f08f8716df21af140cd4f 100644
--- a/telemetry/telemetry/internal/platform/android_platform_backend.py
+++ b/telemetry/telemetry/internal/platform/android_platform_backend.py
@@ -238,6 +238,22 @@ class AndroidPlatformBackend(
android_prebuilt_profiler_helper.GetDevicePath('memtrack_helper'),
'-d'], as_root=True, check_return=True)
+ def EnsureBackgroundApkInstalled(self):
+ name = 'PushAppsToBackground.apk'
+ directories = util.GetBuildDirectories()
nednguyen 2016/10/10 18:42:31 Hmhh, don't rely on this method. Instead, use depe
+ if not directories:
+ raise Exception("Error installing PushAppsToBackground.apk:"
+ "No build directories found.")
+ possible_paths = [os.path.join(d, 'apks', name) for d in directories]
+ paths = [path for path in possible_paths if os.path.exists(path)]
+ if not paths:
+ raise Exception("Error installing PushAppsToBackground.apk: "
+ "Couldn't find apk. Looked for it at: "
+ "\n".join(possible_paths))
+ # Choose the first path
+ path = paths[0]
+ self.InstallApplication(path)
+
def PurgeUnpinnedMemory(self):
"""Purges the unpinned ashmem memory for the whole system.
« no previous file with comments | « telemetry/telemetry/internal/backends/chrome/android_browser_backend.py ('k') | telemetry/telemetry/page/shared_page_state.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698