Chromium Code Reviews| Index: build/android/run_tests.py |
| diff --git a/build/android/run_tests.py b/build/android/run_tests.py |
| index aa4e7dc482e73ae73da6febe95dc3f4f32f758c7..8d0b05535c8b0a60da4fff712282b9b2f124ad70 100755 |
| --- a/build/android/run_tests.py |
| +++ b/build/android/run_tests.py |
| @@ -107,6 +107,32 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type): |
| return qualified_test_suites |
| +def LaunchEmulators(emulator_count, fast_and_loose=False): |
|
frankf
2013/01/07 18:27:23
I recall fast_and_loose option causing more harm t
craigdh
2013/01/07 22:50:41
Filed http://crbug.com/168653 and assigned it to m
|
| + """Launch multiple emulators and wait for them to boot. |
| + |
| + Args: |
| + emulator_count: number of emulators to launch. |
| + |
| + Returns: |
| + List of emulators. |
| + """ |
| + emulators = [] |
| + for n in xrange(emulator_count): |
| + t = time_profile.TimeProfile('Emulator launch %d' % n) |
| + avd_name = None |
| + if n > 0: |
| + # Creates a temporary AVD for the extra emulators. |
| + avd_name = 'run_tests_avd_%d' % n |
| + emu = emulator.Emulator(avd_name, fast_and_loose) |
|
frankf
2013/01/07 18:27:23
Is there any kind of logging done by the emulator
craigdh
2013/01/07 22:50:41
The emulator module logs at the info level already
|
| + emu.Launch(kill_all_emulators=n == 0) |
| + t.Stop() |
| + emulators.append(emu) |
| + # Wait for all emulators to boot completed. |
| + for emu in emulators: |
| + emu.ConfirmLaunch(True) |
| + return emulators |
| + |
| + |
| class TestSharder(BaseTestSharder): |
| """Responsible for sharding the tests on the connected devices.""" |
| @@ -247,20 +273,9 @@ def _RunATestSuite(options): |
| buildbot_emulators = [] |
| if options.use_emulator: |
| - for n in range(options.emulator_count): |
| - t = time_profile.TimeProfile('Emulator launch %d' % n) |
| - avd_name = None |
| - if n > 0: |
| - # Creates a temporary AVD for the extra emulators. |
| - avd_name = 'run_tests_avd_%d' % n |
| - buildbot_emulator = emulator.Emulator(avd_name, options.fast_and_loose) |
| - buildbot_emulator.Launch(kill_all_emulators=n == 0) |
| - t.Stop() |
| - buildbot_emulators.append(buildbot_emulator) |
| - attached_devices.append(buildbot_emulator.device) |
| - # Wait for all emulators to boot completed. |
| - map(lambda buildbot_emulator: buildbot_emulator.ConfirmLaunch(True), |
| - buildbot_emulators) |
| + buildbot_emulators = LaunchEmulators(options.emulator_count, |
| + fast_and_loose=options.fast_and_loose) |
| + attached_devices = [e.device for e in buildbot_emulators] |
| elif options.test_device: |
| attached_devices = [options.test_device] |
| else: |