Index: build/android/test_runner.py |
diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
index f3dd764e554929b40f364460259038599549d4e6..c54ed28d324054eae3c5aee72aa1442d80bf1f36 100755 |
--- a/build/android/test_runner.py |
+++ b/build/android/test_runner.py |
@@ -16,6 +16,7 @@ |
import threading |
import unittest |
+from pylib import android_commands |
from pylib import constants |
from pylib import forwarder |
from pylib import ports |
@@ -24,8 +25,6 @@ |
from pylib.base import test_dispatcher |
from pylib.base import test_instance_factory |
from pylib.base import test_run_factory |
-from pylib.device import device_errors |
-from pylib.device import device_utils |
from pylib.gtest import gtest_config |
from pylib.gtest import setup as gtest_setup |
from pylib.gtest import test_options as gtest_test_options |
@@ -868,16 +867,16 @@ |
Returns: |
A list of attached devices. |
""" |
- attached_devices = device_utils.DeviceUtils.HealthyDevices() |
+ attached_devices = [] |
+ |
+ attached_devices = android_commands.GetAttachedDevices() |
if test_device: |
- test_device = [d for d in attached_devices if d == test_device] |
- if not test_device: |
- raise device_errors.DeviceUnreachableError( |
- 'Did not find device %s among attached device. Attached devices: %s' |
- % (test_device, ', '.join(attached_devices))) |
- |
- if not attached_devices: |
- raise device_errors.NoDevicesError() |
+ assert test_device in attached_devices, ( |
+ 'Did not find device %s among attached device. Attached devices: %s' |
+ % (test_device, ', '.join(attached_devices))) |
+ attached_devices = [test_device] |
+ |
+ assert attached_devices, 'No devices attached.' |
return sorted(attached_devices) |