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

Unified Diff: build/android/pylib/single_test_runner.py

Issue 10692132: fix test broken issue when using --use-emulator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « no previous file | build/android/run_tests.py » ('j') | build/android/run_tests.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 48e92ea3d6cec24f2d59731b4057a7c807c00b94..e3b6d87a3b3eef5b14803f4c96a6c7a2ba8ffb87 100644
--- a/build/android/pylib/single_test_runner.py
+++ b/build/android/pylib/single_test_runner.py
@@ -13,6 +13,11 @@ from test_package_apk import TestPackageApk
from test_package_executable import TestPackageExecutable
from test_result import TestResults
+# adb_interface.py is under ../../third_party/android_testrunner/
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..',
+ '..', 'third_party', 'android_testrunner'))
+import run_command
+
class SingleTestRunner(BaseTestRunner):
"""Single test suite attached to a single device.
@@ -292,6 +297,11 @@ class SingleTestRunner(BaseTestRunner):
def SetUp(self):
"""Sets up necessary test enviroment for the test suite."""
super(SingleTestRunner, self).SetUp()
+ # Sometimes adb server may crash and the connection to the device lost,
+ # which will block the test. So kill the server each time the test starts
+ # and the connection to the device will be re-established.
+ run_command.RunCommand('adb kill-server')
John Grabowski 2012/07/10 06:14:09 prefer self.adb.SomethingOrOther() to a 'run comma
Wei James(wistoch) 2012/07/10 14:26:48 fixed. define Start/Kill/RestartAdbServer in adb
+
if self.test_package.performance_test:
if run_tests_helper.IsRunningAsBuildbot():
self.adb.SetJavaAssertsEnabled(enable=False)
« no previous file with comments | « no previous file | build/android/run_tests.py » ('j') | build/android/run_tests.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698