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

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

Issue 13496004: [Android] Set flags for uiautomator based on annotations not test name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/constants.py ('k') | build/android/pylib/utils/test_options_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33c499e10077c563da8cf4a6f6a2a18e4a69437c..4128b0f9ee667496fe12bcfcfa763d7708195a90 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -373,6 +373,24 @@ class TestRunner(base_test_runner.BaseTestRunner):
return 3 * 60
return 1 * 60
+ def _RunUIAutomatorTest(self, test, timeout):
+ """Runs a single uiautomator test.
+
+ Args:
+ test: Test class/method.
+ timeout: Timeout time in seconds.
+
+ Returns:
+ An instance of am_instrument_parser.TestResult object.
+ """
+ self.adb.ClearApplicationState(self.package_name)
+ if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
+ self.flags.RemoveFlags(['--disable-fre'])
+ else:
+ self.flags.AddFlags(['--disable-fre'])
+ return self.adb.RunUIAutomatorTest(
+ test, self.test_pkg.GetPackageName(), timeout)
+
#override.
def RunTest(self, test):
raw_result = None
@@ -386,14 +404,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
start_date_ms = int(time.time()) * 1000
if self.is_uiautomator_test:
- self.adb.ClearApplicationState(self.package_name)
- # TODO(frankf): Stop-gap solution. Should use annotations.
- if 'FirstRun' in test:
- self.flags.RemoveFlags(['--disable-fre'])
- else:
- self.flags.AddFlags(['--disable-fre'])
- raw_result = self.adb.RunUIAutomatorTest(
- test, self.test_pkg.GetPackageName(), timeout)
+ raw_result = self._RunUIAutomatorTest(test, timeout)
else:
raw_result = self.adb.RunInstrumentationTest(
test, self.test_pkg.GetPackageName(),
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/utils/test_options_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698