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

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

Issue 26422003: [Android] Launch chrome using an intent before running uiautomator tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/uiautomator/test_options.py ('k') | build/android/test_runner.py » ('j') | 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 fcd2cc61f92b4ad0a98533e514e0841ab79926bb..55911e75bd681767a64635a9e087e5817c8e954c 100644
--- a/build/android/pylib/uiautomator/test_runner.py
+++ b/build/android/pylib/uiautomator/test_runner.py
@@ -4,6 +4,7 @@
"""Class for running uiautomator tests on a single device."""
+from pylib import constants
from pylib.instrumentation import test_options as instr_test_options
from pylib.instrumentation import test_runner as instr_test_runner
@@ -42,7 +43,8 @@ class TestRunner(instr_test_runner.TestRunner):
super(TestRunner, self).__init__(instrumentation_options, device,
shard_index, test_pkg, ports_to_forward)
- self.package_name = test_options.package_name
+ self._package = constants.PACKAGE_INFO[test_options.package].package
+ self._activity = constants.PACKAGE_INFO[test_options.package].activity
#override
def InstallTestPackage(self):
@@ -54,10 +56,15 @@ class TestRunner(instr_test_runner.TestRunner):
#override
def _RunTest(self, test, timeout):
- self.adb.ClearApplicationState(self.package_name)
+ self.adb.ClearApplicationState(self._package)
if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
self.flags.RemoveFlags(['--disable-fre'])
else:
self.flags.AddFlags(['--disable-fre'])
+ self.adb.StartActivity(self._package,
craigdh 2013/10/08 16:57:49 How was this being started before?
+ self._activity,
+ wait_for_completion=True,
+ action='android.intent.action.MAIN',
+ force_stop=True)
return self.adb.RunUIAutomatorTest(
test, self.test_pkg.GetPackageName(), timeout)
« no previous file with comments | « build/android/pylib/uiautomator/test_options.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698