OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import collections | 6 import collections |
7 import glob | 7 import glob |
8 import multiprocessing | 8 import multiprocessing |
9 import os | 9 import os |
10 import shutil | 10 import shutil |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 except errors.DeviceUnresponsiveError as e: | 77 except errors.DeviceUnresponsiveError as e: |
78 return e | 78 return e |
79 | 79 |
80 | 80 |
81 def RebootDevices(): | 81 def RebootDevices(): |
82 """Reboot all attached and online devices.""" | 82 """Reboot all attached and online devices.""" |
83 # Early return here to avoid presubmit dependence on adb, | 83 # Early return here to avoid presubmit dependence on adb, |
84 # which might not exist in this checkout. | 84 # which might not exist in this checkout. |
85 if bb_utils.TESTING: | 85 if bb_utils.TESTING: |
86 return | 86 return |
87 devices = android_commands.GetAttachedDevices() | 87 devices = android_commands.GetAttachedDevices(emulator=False) |
88 print 'Rebooting: %s' % devices | 88 print 'Rebooting: %s' % devices |
89 if devices: | 89 if devices: |
90 pool = multiprocessing.Pool(len(devices)) | 90 pool = multiprocessing.Pool(len(devices)) |
91 results = pool.map_async(RebootDeviceSafe, devices).get(99999) | 91 results = pool.map_async(RebootDeviceSafe, devices).get(99999) |
92 | 92 |
93 for device, result in zip(devices, results): | 93 for device, result in zip(devices, results): |
94 if result: | 94 if result: |
95 print '%s failed to startup.' % device | 95 print '%s failed to startup.' % device |
96 | 96 |
97 if any(results): | 97 if any(results): |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 383 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
384 | 384 |
385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
386 | 386 |
387 MainTestWrapper(options) | 387 MainTestWrapper(options) |
388 provision_devices.KillHostHeartbeat() | 388 provision_devices.KillHostHeartbeat() |
389 | 389 |
390 | 390 |
391 if __name__ == '__main__': | 391 if __name__ == '__main__': |
392 sys.exit(main(sys.argv)) | 392 sys.exit(main(sys.argv)) |
OLD | NEW |