OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """Runs all the native unit tests. | 6 """Runs all the native unit tests. |
7 | 7 |
8 1. Copy over test binary to /data/local on device. | 8 1. Copy over test binary to /data/local on device. |
9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) | 9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) |
10 to be deployed to the device (in /data/local/tmp). | 10 to be deployed to the device (in /data/local/tmp). |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 buildbot_emulator = None | 208 buildbot_emulator = None |
209 attached_devices = [] | 209 attached_devices = [] |
210 | 210 |
211 if options.use_xvfb: | 211 if options.use_xvfb: |
212 xvfb = Xvfb() | 212 xvfb = Xvfb() |
213 xvfb.Start() | 213 xvfb.Start() |
214 | 214 |
215 if options.use_emulator: | 215 if options.use_emulator: |
216 t = TimeProfile('Emulator launch') | 216 t = TimeProfile('Emulator launch') |
217 buildbot_emulator = emulator.Emulator() | 217 buildbot_emulator = emulator.Emulator() |
218 buildbot_emulator.Reset() | |
219 buildbot_emulator.Launch() | 218 buildbot_emulator.Launch() |
220 t.Stop() | 219 t.Stop() |
221 attached_devices.append(buildbot_emulator.device) | 220 attached_devices.append(buildbot_emulator.device) |
222 else: | 221 else: |
223 attached_devices = android_commands.GetAttachedDevices() | 222 attached_devices = android_commands.GetAttachedDevices() |
224 | 223 |
225 if not attached_devices: | 224 if not attached_devices: |
226 logging.critical('A device must be attached and online.') | 225 logging.critical('A device must be attached and online.') |
227 return 1 | 226 return 1 |
228 | 227 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if len(args) > 1: | 279 if len(args) > 1: |
281 print 'Unknown argument:', args[1:] | 280 print 'Unknown argument:', args[1:] |
282 option_parser.print_usage() | 281 option_parser.print_usage() |
283 sys.exit(1) | 282 sys.exit(1) |
284 run_tests_helper.SetLogLevel(options.verbose_count) | 283 run_tests_helper.SetLogLevel(options.verbose_count) |
285 return Dispatch(options) | 284 return Dispatch(options) |
286 | 285 |
287 | 286 |
288 if __name__ == '__main__': | 287 if __name__ == '__main__': |
289 sys.exit(main(sys.argv)) | 288 sys.exit(main(sys.argv)) |
OLD | NEW |