Index: build/android/pylib/single_test_runner.py |
diff --git a/build/android/pylib/single_test_runner.py b/build/android/pylib/single_test_runner.py |
index f1ee76f583fe5835b376fa2018fef5af61fc1bdb..35d5a94bb6c9df6b2bfeae6c22d746247a390c30 100644 |
--- a/build/android/pylib/single_test_runner.py |
+++ b/build/android/pylib/single_test_runner.py |
@@ -312,9 +312,10 @@ class SingleTestRunner(BaseTestRunner): |
"""Sets up necessary test enviroment for the test suite.""" |
super(SingleTestRunner, self).SetUp() |
self.adb.ClearApplicationState(constants.CHROME_PACKAGE) |
- # Sometimes adb server lost connection to the emulator, which will break the |
- # test, so restart the adb server before the test. |
- self.adb.Adb().RestartAdbServer() |
+ if self._running_on_emulator: |
+ # Sometimes adb server lost connection to the emulator, which will break |
+ # the test, so restart the adb server before the test. |
+ self.adb.RestartAdbServer() |
if self.test_package.performance_test: |
self.adb.SetupPerformanceTest() |
if self.dump_debug_info: |