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

Side by Side Diff: build/android/pylib/utils/emulator.py

Issue 294113003: [Android] Convert to DeviceUtils versions of WaitUntilFullyBooted and GetExternalStoragePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/screenshot.py ('k') | build/android/pylib/utils/parallelizer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides an interface to start and stop Android emulator. 5 """Provides an interface to start and stop Android emulator.
6 6
7 Emulator: The class provides the methods to launch/shutdown the emulator with 7 Emulator: The class provides the methods to launch/shutdown the emulator with
8 the android virtual device named 'avd_armeabi' . 8 the android virtual device named 'avd_armeabi' .
9 """ 9 """
10 10
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 run_command.RunCommand(adb_cmd) 409 run_command.RunCommand(adb_cmd)
410 self.popen.poll() 410 self.popen.poll()
411 if self.popen.returncode != None: 411 if self.popen.returncode != None:
412 raise EmulatorLaunchException('EMULATOR DIED') 412 raise EmulatorLaunchException('EMULATOR DIED')
413 if seconds_waited >= self._LAUNCH_TIMEOUT: 413 if seconds_waited >= self._LAUNCH_TIMEOUT:
414 raise EmulatorLaunchException('TIMEOUT with wait-for-device') 414 raise EmulatorLaunchException('TIMEOUT with wait-for-device')
415 logging.info('Seconds waited on wait-for-device: %d', seconds_waited) 415 logging.info('Seconds waited on wait-for-device: %d', seconds_waited)
416 if wait_for_boot: 416 if wait_for_boot:
417 # Now that we checked for obvious problems, wait for a boot complete. 417 # Now that we checked for obvious problems, wait for a boot complete.
418 # Waiting for the package manager is sometimes problematic. 418 # Waiting for the package manager is sometimes problematic.
419 # TODO(jbudorick) Convert this once waiting for the package manager and
420 # the external storage is no longer problematic.
419 d = device_utils.DeviceUtils(self.device_serial) 421 d = device_utils.DeviceUtils(self.device_serial)
420 d.old_interface.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT) 422 d.old_interface.WaitForSystemBootCompleted(self._WAITFORBOOT_TIMEOUT)
421 423
422 def Shutdown(self): 424 def Shutdown(self):
423 """Shuts down the process started by launch.""" 425 """Shuts down the process started by launch."""
424 self._DeleteAVD() 426 self._DeleteAVD()
425 if self.popen: 427 if self.popen:
426 self.popen.poll() 428 self.popen.poll()
427 if self.popen.returncode == None: 429 if self.popen.returncode == None:
428 self.popen.kill() 430 self.popen.kill()
429 self.popen = None 431 self.popen = None
430 432
431 def _ShutdownOnSignal(self, _signum, _frame): 433 def _ShutdownOnSignal(self, _signum, _frame):
432 logging.critical('emulator _ShutdownOnSignal') 434 logging.critical('emulator _ShutdownOnSignal')
433 for sig in self._SIGNALS: 435 for sig in self._SIGNALS:
434 signal.signal(sig, signal.SIG_DFL) 436 signal.signal(sig, signal.SIG_DFL)
435 self.Shutdown() 437 self.Shutdown()
436 raise KeyboardInterrupt # print a stack 438 raise KeyboardInterrupt # print a stack
437 439
438 def _InstallKillHandler(self): 440 def _InstallKillHandler(self):
439 """Install a handler to kill the emulator when we exit unexpectedly.""" 441 """Install a handler to kill the emulator when we exit unexpectedly."""
440 for sig in self._SIGNALS: 442 for sig in self._SIGNALS:
441 signal.signal(sig, self._ShutdownOnSignal) 443 signal.signal(sig, self._ShutdownOnSignal)
OLDNEW
« no previous file with comments | « build/android/pylib/screenshot.py ('k') | build/android/pylib/utils/parallelizer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698