Index: build/android/pylib/instrumentation/test_runner.py |
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py |
index 60e00f33efca8b74a18ee9647f61004e56f1f99c..f2808da8560a15e230002fa2116b4a7a8eaaf965 100644 |
--- a/build/android/pylib/instrumentation/test_runner.py |
+++ b/build/android/pylib/instrumentation/test_runner.py |
@@ -208,8 +208,8 @@ class TestRunner(base_test_runner.BaseTestRunner): |
Returns: |
Whether the feature being tested is FirstRunExperience. |
""" |
- freFeature = 'Feature:FirstRunExperience' |
- return freFeature in self.test_pkg.GetTestAnnotations(test) |
+ annotations = self.test_pkg.GetTestAnnotations(test) |
+ return ('FirstRunExperience' == annotations.get('Feature', None)) |
def _IsPerfTest(self, test): |
"""Determines whether a test is a performance test. |
@@ -329,10 +329,11 @@ class TestRunner(base_test_runner.BaseTestRunner): |
annotations = self.test_pkg.GetTestAnnotations(test) |
timeout_scale = 1 |
if 'TimeoutScale' in annotations: |
- for annotation in annotations: |
- scale_match = re.match('TimeoutScale:([0-9]+)', annotation) |
- if scale_match: |
- timeout_scale = int(scale_match.group(1)) |
+ try: |
+ timeout_scale = int(annotations['TimeoutScale']) |
+ except ValueError: |
+ logging.warning('Non-integer value of TimeoutScale ignored. (%s)' |
+ % annotations['TimeoutScale']) |
if self.options.wait_for_debugger: |
timeout_scale *= 100 |
return timeout_scale |