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

Unified Diff: build/android/adb_install_content_shell

Issue 10824227: Organize adb install cmds and reboot on failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/android_commands.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_install_content_shell
diff --git a/build/android/adb_install_content_shell b/build/android/adb_install_content_shell
index 3667998cdc044c6703c95ed0e06fb4c9ccb0c4f9..a7cc2182cd47aa3f5707f3a90609b1be21d1e1d0 100755
--- a/build/android/adb_install_content_shell
+++ b/build/android/adb_install_content_shell
@@ -1,26 +1,33 @@
-#!/bin/bash
+#!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-CONTENT_SHELL_APK=${CHROME_SRC}/out/Release/content_shell/ContentShell-debug.apk
+from multiprocessing import Process
+import os
-if [ ! -f "${CONTENT_SHELL_APK}" ]; then
- echo "Error: Could not find ${CONTENT_SHELL_APK} to install."
- exit 1
-fi
+from pylib import android_commands
-DEVS=$(adb devices | grep device | grep -v devices | awk '{ print $1 }')
-if [[ -z $DEVS ]]; then
- echo "Error: No connected devices. Device needed to run content shell test."
- exit 1
-fi
+def InstallContentShell(device):
+ apk_path = os.path.join(os.environ['CHROME_SRC'],
+ 'out/Release/content_shell/ContentShell-debug.apk')
+ result = android_commands.AndroidCommands(device=device).ManagedInstall(
+ apk_path, False, 'org.chromium.content_shell')
+ print '----- Installed on %s -----' % device
+ print result
-for DEV in ${DEVS}; do
- # Reinstall content shell. This will also kill existing content_shell procs.
- echo "Installing ${CONTENT_SHELL_APK} in ${DEV}"
- adb -s ${DEV} uninstall org.chromium.content_shell
- adb -s ${DEV} install -r ${CONTENT_SHELL_APK}
-done
+
+devices = android_commands.GetAttachedDevices()
+if not devices:
+ raise Exception('Error: no connected devices')
+
+procs = []
+for device in devices:
+ p = Process(target=InstallContentShell, args=(device,))
+ p.start()
+ procs += [p]
+
+for p in procs:
+ p.join()
« no previous file with comments | « no previous file | build/android/pylib/android_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698