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

Unified Diff: build/android/adb_install_apk.py

Issue 10993069: Adds AndroidWebView and ChromiumTestShell tests to the Android FYI bot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix pooling issue when installing APKs. 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/adb_install_content_shell » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/adb_install_apk.py
diff --git a/build/android/adb_install_apk.py b/build/android/adb_install_apk.py
new file mode 100755
index 0000000000000000000000000000000000000000..36e2cd3cc8b663647a08772ba8f2814942a6e9bf
--- /dev/null
+++ b/build/android/adb_install_apk.py
@@ -0,0 +1,48 @@
+#!/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.
+
+import multiprocessing
+import optparse
+import os
+import sys
+
+from pylib import android_commands
+from pylib import test_options_parser
+from pylib import constants
+
+
+def InstallApk(args):
Isaac (away) 2012/10/02 19:29:59 suggest changing this to: def InstallApk(options,
klundberg 2012/10/02 21:01:03 As discussed in person, just changing the line bel
+ options = args[0]
+ device = args[1]
+ apk_path = os.path.join(os.environ['CHROME_SRC'],
+ 'out', options.build_type,
+ 'apks', options.apk)
+ result = android_commands.AndroidCommands(device=device).ManagedInstall(
+ apk_path, False, options.apk_package)
+ print '----- Installed on %s -----' % device
+ print result
+
+
+def main(argv):
+ parser = optparse.OptionParser()
+ test_options_parser.AddBuildTypeOption(parser)
+ test_options_parser.AddInstallAPKOption(parser)
+ options, args = parser.parse_args(argv)
+
+ if len(args) > 1:
+ raise Exception('Error: Unknown argument:', args[1:])
+
+ devices = android_commands.GetAttachedDevices()
+ if not devices:
+ raise Exception('Error: no connected devices')
+
+ pool = multiprocessing.Pool(len(devices))
+ # Send a tuple (options, device) per instance of DeploySingleDevice.
+ pool.map(InstallApk, zip([options] * len(devices), devices))
Isaac (away) 2012/10/02 19:29:59 change this to pool.imap and you can eliminate the
klundberg 2012/10/02 21:01:03 As discussed (and tried) in person, this doesn't w
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
« no previous file with comments | « no previous file | build/android/adb_install_content_shell » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698