summaryrefslogtreecommitdiffstats
path: root/chromium/build/android/pylib/base/environment_factory.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/build/android/pylib/base/environment_factory.py')
-rw-r--r--chromium/build/android/pylib/base/environment_factory.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/chromium/build/android/pylib/base/environment_factory.py b/chromium/build/android/pylib/base/environment_factory.py
index 4d3727444f4..2b402ab9854 100644
--- a/chromium/build/android/pylib/base/environment_factory.py
+++ b/chromium/build/android/pylib/base/environment_factory.py
@@ -4,14 +4,24 @@
from pylib import constants
from pylib.local.device import local_device_environment
-from pylib.local.emulator import local_emulator_environment
from pylib.local.machine import local_machine_environment
+try:
+ # local_emulator_environment depends on //tools.
+ # If a client pulls in the //build subtree but not the //tools
+ # one, fail at emulator environment creation time.
+ from pylib.local.emulator import local_emulator_environment
+except ImportError:
+ local_emulator_environment = None
+
+
def CreateEnvironment(args, output_manager, error_func):
if args.environment == 'local':
if args.command not in constants.LOCAL_MACHINE_TESTS:
- if args.avd_name:
+ if args.avd_config:
+ if not local_emulator_environment:
+ error_func('emulator environment requested but not available.')
return local_emulator_environment.LocalEmulatorEnvironment(
args, output_manager, error_func)
return local_device_environment.LocalDeviceEnvironment(