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

Unified Diff: build/android/emulator.py

Issue 8769020: Android bot changes for robustness, profiling, and debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/buildbot.sh ('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 8e7031c3e5b89618218c80639e4ca3fb5d81f44b..6aeb3fca3b9cbd138ce532004cdd20f84df1eaf3 100755
--- a/build/android/emulator.py
+++ b/build/android/emulator.py
@@ -18,6 +18,11 @@ import sys
import android_commands
+# adb_interface.py is under ../../third_party/android/testrunner/
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..',
+ '..', 'third_party', 'android', 'testrunner'))
+import adb_interface
+
def _GetAvailablePort():
"""Returns an available TCP port for the console."""
@@ -58,6 +63,15 @@ class Emulator(object):
self.popen = None
self.device = None
+ def Reset(self):
+ """Kill a running emulator.
+
+ May be needed if the test scripts stopped abnormally and an
+ emulator is left around."""
+ adb = adb_interface.AdbInterface()
+ logging.info('Killing any existing emulator.')
+ adb.SendCommand('emu kill')
+
def Launch(self):
"""Launches the emulator and waits for package manager to startup.
@@ -65,8 +79,16 @@ class Emulator(object):
"""
port = _GetAvailablePort()
self.device = "emulator-%d" % port
- self.popen = subprocess.Popen(args=[self.emulator, '-avd', 'buildbot',
- '-port', str(port)])
+ self.popen = subprocess.Popen(args=[
+ self.emulator,
+ # Speed up emulator launch by 40%. Really.
+ '-no-boot-anim',
+ # The default /data size is 64M.
+ # That's not enough for 4 unit test bundles and their data.
+ '-partition-size', '256',
+ # Use a familiar name and port.
+ '-avd', 'buildbot',
+ '-port', str(port)])
# This will not return until device's package manager starts up or an
# exception is raised.
android_commands.AndroidCommands(self.device, True)
« no previous file with comments | « build/android/buildbot.sh ('k') | build/android/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698