| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # | |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 from multiprocessing import Process | |
| 8 import optparse | |
| 9 import os | |
| 10 import sys | |
| 11 | |
| 12 from pylib import android_commands | |
| 13 from pylib import test_options_parser | |
| 14 from pylib import constants | |
| 15 | |
| 16 | |
| 17 def InstallContentShell(device, build_type): | |
| 18 apk_path = os.path.join(os.environ['CHROME_SRC'], | |
| 19 'out', build_type, | |
| 20 constants.SDK_BUILD_APKS_DIR, 'ContentShell-debug.apk'
) | |
| 21 result = android_commands.AndroidCommands(device=device).ManagedInstall( | |
| 22 apk_path, False, 'org.chromium.content_shell') | |
| 23 print '----- Installed on %s -----' % device | |
| 24 print result | |
| 25 | |
| 26 | |
| 27 parser = optparse.OptionParser() | |
| 28 test_options_parser.AddBuildTypeOption(parser) | |
| 29 options, args = parser.parse_args(sys.argv) | |
| 30 | |
| 31 devices = android_commands.GetAttachedDevices() | |
| 32 if not devices: | |
| 33 raise Exception('Error: no connected devices') | |
| 34 | |
| 35 procs = [] | |
| 36 for device in devices: | |
| 37 p = Process(target=InstallContentShell, args=(device, options.build_type)) | |
| 38 p.start() | |
| 39 procs += [p] | |
| 40 | |
| 41 for p in procs: | |
| 42 p.join() | |
| OLD | NEW |