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

Unified Diff: build/android/emulator.py

Issue 9494007: Upstream test sharder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: N emulators launched asynchronously Created 8 years, 10 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 | « build/android/base_test_sharder.py ('k') | build/android/run_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/emulator.py
diff --git a/build/android/emulator.py b/build/android/emulator.py
index 5abfadcaa6f914a03e812c2cee8a487c2bc68251..95a3a13b5dddd4a75a5bcb8f17f690efcf9eb087 100755
--- a/build/android/emulator.py
+++ b/build/android/emulator.py
@@ -136,12 +136,14 @@ class Emulator(object):
port = _GetAvailablePort()
return ('emulator-%d' % port, port)
- def Launch(self):
- """Launches the emulator and waits for package manager to startup.
+ def Launch(self, kill_all_emulators):
+ """Launches the emulator asynchronously. Call ConfirmLaunch() to ensure the
+ emulator is ready for use.
If fails, an exception will be raised.
"""
- _KillAllEmulators() # just to be sure
+ if kill_all_emulators:
+ _KillAllEmulators() # just to be sure
if not self.fast_and_loose:
self._AggressiveImageCleanup()
(self.device, port) = self._DeviceName()
@@ -166,7 +168,6 @@ class Emulator(object):
self.popen = subprocess.Popen(args=emulator_command,
stderr=subprocess.STDOUT)
self._InstallKillHandler()
- self._ConfirmLaunch()
def _AggressiveImageCleanup(self):
"""Aggressive cleanup of emulator images.
@@ -186,7 +187,7 @@ class Emulator(object):
logging.info('Deleting emulator image %s', full_name)
os.unlink(full_name)
- def _ConfirmLaunch(self, wait_for_boot=False):
+ def ConfirmLaunch(self, wait_for_boot=False):
"""Confirm the emulator launched properly.
Loop on a wait-for-device with a very small timeout. On each
« no previous file with comments | « build/android/base_test_sharder.py ('k') | build/android/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698