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

Unified Diff: build/android/pylib/utils/emulator.py

Issue 221823011: [Android] Change object types from AndroidCommands to DeviceUtils in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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/pylib/screenshot.py ('k') | build/android/pylib/utils/test_environment.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/emulator.py
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py
index 7d57781f8ea01f10d263815a95f0ae47a2943364..c256eac236cbd134293028a20ed114d230135abc 100644
--- a/build/android/pylib/utils/emulator.py
+++ b/build/android/pylib/utils/emulator.py
@@ -19,6 +19,7 @@ from pylib import android_commands
from pylib import cmd_helper
from pylib import constants
from pylib import pexpect
+from pylib.device import device_utils
from pylib.utils import time_profile
import errors
@@ -106,7 +107,7 @@ def DeleteAllTempAVDs():
If the test exits abnormally and some temporary AVDs created when testing may
be left in the system. Clean these AVDs.
"""
- avds = android_commands.GetAVDs()
+ avds = device_utils.GetAVDs()
if not avds:
return
for avd_name in avds:
@@ -236,7 +237,7 @@ class Emulator(object):
self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator')
self.android = os.path.join(android_sdk_root, 'tools', 'android')
self.popen = None
- self.device = None
+ self.device_serial = None
self.abi = abi
self.avd_name = avd_name
@@ -334,7 +335,7 @@ class Emulator(object):
if kill_all_emulators:
_KillAllEmulators() # just to be sure
self._AggressiveImageCleanup()
- (self.device, port) = self._DeviceName()
+ (self.device_serial, port) = self._DeviceName()
emulator_command = [
self.emulator,
# Speed up emulator launch by 40%. Really.
@@ -393,7 +394,7 @@ class Emulator(object):
"""
seconds_waited = 0
number_of_waits = 2 # Make sure we can wfd twice
- adb_cmd = "adb -s %s %s" % (self.device, 'wait-for-device')
+ adb_cmd = "adb -s %s %s" % (self.device_serial, 'wait-for-device')
while seconds_waited < self._LAUNCH_TIMEOUT:
try:
run_command.RunCommand(adb_cmd,
@@ -404,7 +405,7 @@ class Emulator(object):
break
except errors.WaitForResponseTimedOutError:
seconds_waited += self._WAITFORDEVICE_TIMEOUT
- adb_cmd = "adb -s %s %s" % (self.device, 'kill-server')
+ adb_cmd = "adb -s %s %s" % (self.device_serial, 'kill-server')
run_command.RunCommand(adb_cmd)
self.popen.poll()
if self.popen.returncode != None:
@@ -415,8 +416,8 @@ class Emulator(object):
if wait_for_boot:
# Now that we checked for obvious problems, wait for a boot complete.
# Waiting for the package manager is sometimes problematic.
- a = android_commands.AndroidCommands(self.device)
- a.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT)
+ d = device_utils.DeviceUtils(self.device_serial)
+ d.old_interface.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT)
def Shutdown(self):
"""Shuts down the process started by launch."""
« no previous file with comments | « build/android/pylib/screenshot.py ('k') | build/android/pylib/utils/test_environment.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698