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

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

Issue 12317059: [Andoid] Threaded TestRunner creation and SetUp and TearDown calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clear data and kill process between tests Created 7 years, 10 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/base/shard_unittest.py ('k') | build/android/pylib/utils/reraiser_thread.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_runner.py
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
index 0ecc9c5a787cb39ded4e5a47234bfe524329793b..003c6b444e66ba2f7404d46ac460a08ef4806190 100644
--- a/build/android/pylib/gtest/test_runner.py
+++ b/build/android/pylib/gtest/test_runner.py
@@ -163,6 +163,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
self._test_arguments = test_arguments
self.in_webkit_checkout = in_webkit_checkout
self._cleanup_test_files = cleanup_test_files
+ self._test_apk_package_name = test_apk_package_name
logging.warning('Test suite: ' + test_suite)
if os.path.splitext(test_suite)[1] == '.apk':
@@ -240,6 +241,12 @@ class TestRunner(base_test_runner.BaseTestRunner):
gtest_filter_base_path + '_emulator_additional_disabled'))
return disabled_tests
+ def _ClearApplicationState(self):
+ """Kill the test process and clear application state."""
+ if self._test_apk_package_name:
+ self.adb.ClearApplicationState(self._test_apk_package_name)
nilesh 2013/02/23 01:24:10 I think the killAllblocking can be in else: Or e
craigdh 2013/02/25 20:05:14 Done.
+ self.adb.KillAllBlocking(self.test_package.test_suite_basename, 30)
+
def RunTest(self, test):
"""Runs a test on a single device.
@@ -254,6 +261,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
return test_results, None
try:
+ self._ClearApplicationState()
self.test_package.CreateTestRunnerScript(test, self._test_arguments)
test_results = self.test_package.RunTestsAndListResults()
except errors.DeviceUnresponsiveError as e:
@@ -275,7 +283,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
def SetUp(self):
"""Sets up necessary test enviroment for the test suite."""
super(TestRunner, self).SetUp()
- self.adb.ClearApplicationState(constants.CHROME_PACKAGE)
+ self._ClearApplicationState()
nilesh 2013/02/23 01:24:10 I dont think we need it here now. The next line (S
craigdh 2013/02/25 20:05:14 Done.
self.StripAndCopyFiles()
if _TestSuiteRequiresMockTestServer(self.test_package.test_suite_basename):
self.LaunchChromeTestServerSpawner()
« no previous file with comments | « build/android/pylib/base/shard_unittest.py ('k') | build/android/pylib/utils/reraiser_thread.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698