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

Unified Diff: third_party/android_testrunner/adb_interface.py

Issue 10823093: [Android] Upstream changes to android_testrunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add docstring 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 | « third_party/android_testrunner/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/android_testrunner/adb_interface.py
diff --git a/third_party/android_testrunner/adb_interface.py b/third_party/android_testrunner/adb_interface.py
index 1928c73a8e6ba7c41c4a725d1988f6044dfe0829..b8f740b2f01b2e31e13cb84c1ed6c95af02b41a3 100644
--- a/third_party/android_testrunner/adb_interface.py
+++ b/third_party/android_testrunner/adb_interface.py
@@ -176,7 +176,7 @@ class AdbInterface:
def StartInstrumentation(
self, instrumentation_path, timeout_time=60*10, no_window_animation=False,
- profile=False, instrumentation_args={}):
+ profile=False, instrumentation_args={}, silent_log=False):
"""Runs an instrumentation class on the target.
@@ -195,6 +195,8 @@ class AdbInterface:
profile: If True, profiling will be turned on for the instrumentation.
instrumentation_args: Dictionary of key value bundle arguments to pass to
instrumentation.
+ silent_log: If True, the invocation of the instrumentation test runner
+ will not be logged.
Returns:
(test_results, inst_finished_bundle)
@@ -217,22 +219,26 @@ class AdbInterface:
instrumentation_path, no_window_animation=no_window_animation,
profile=profile, raw_mode=True,
instrumentation_args=instrumentation_args)
- logger.Log(command_string)
+ if silent_log:
+ logger.SilentLog(command_string)
+ else:
+ logger.Log(command_string)
(test_results, inst_finished_bundle) = (
am_instrument_parser.ParseAmInstrumentOutput(
self.SendShellCommand(command_string, timeout_time=timeout_time,
retry_count=2)))
-
if "code" not in inst_finished_bundle:
+ logger.Log('No code available. inst_finished_bundle contains: %s '
+ % inst_finished_bundle)
raise errors.InstrumentationError("no test results... device setup "
"correctly?")
if inst_finished_bundle["code"] == "0":
- short_msg_result = "no error message"
- if "shortMsg" in inst_finished_bundle:
- short_msg_result = inst_finished_bundle["shortMsg"]
- logger.Log("Error! Test run failed: %s" % short_msg_result)
- raise errors.InstrumentationError(short_msg_result)
+ long_msg_result = "no error message"
+ if "longMsg" in inst_finished_bundle:
+ long_msg_result = inst_finished_bundle["longMsg"]
+ logger.Log("Error! Test run failed: %s" % long_msg_result)
+ raise errors.InstrumentationError(long_msg_result)
if "INSTRUMENTATION_ABORTED" in inst_finished_bundle:
logger.Log("INSTRUMENTATION ABORTED!")
« no previous file with comments | « third_party/android_testrunner/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698