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

Unified Diff: build/android/pylib/uiautomator/test_runner.py

Issue 607583002: [Android] Fix UIAutomator test running. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « build/android/pylib/instrumentation/test_runner_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/uiautomator/test_runner.py
diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py
index 794c313d4324479813b0b625326c31c58a6c52bf..fa0725d34a48f2979abedd7354de75ad07cf2299 100644
--- a/build/android/pylib/uiautomator/test_runner.py
+++ b/build/android/pylib/uiautomator/test_runner.py
@@ -74,5 +74,13 @@ class TestRunner(instr_test_runner.TestRunner):
package=self._package),
blocking=True,
force_stop=True)
- return self.device.old_interface.RunUIAutomatorTest(
- test, self.test_pkg.GetPackageName(), timeout)
+ cmd = ['uiautomator', 'runtest', self.test_pkg.GetPackageName(),
+ '-e', 'class', test]
+ return self.device.RunShellCommand(cmd, timeout=timeout, retries=0)
+
+ #override
+ def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
+ # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE,
+ # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses.
+ return super(TestRunner, self)._GenerateTestResult(
+ test, instr_statuses[:-1], start_ms, duration_ms)
« no previous file with comments | « build/android/pylib/instrumentation/test_runner_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698