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

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

Issue 23467004: [android] Update FlagChanger to work with additional apks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cmd_helper._Call -> cmd_helper.Call Created 7 years, 4 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/flag_changer.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_package_apk.py
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py
index 5944147bdc005af40c84b40d4263723d463af7c3..81c4cfed92ec9b5ca6710ec5f1ff9a4908609903 100644
--- a/build/android/pylib/gtest/test_package_apk.py
+++ b/build/android/pylib/gtest/test_package_apk.py
@@ -34,15 +34,11 @@ class TestPackageApk(TestPackage):
if suite_name == 'content_browsertests':
self.suite_path = os.path.join(
product_dir, 'apks', '%s.apk' % suite_name)
- self._test_apk_package_name = constants.BROWSERTEST_TEST_PACKAGE_NAME
- self._test_activity_name = constants.BROWSERTEST_TEST_ACTIVITY_NAME
- self._command_line_file = constants.BROWSERTEST_COMMAND_LINE_FILE
+ self._package_info = constants.PACKAGE_INFO['content_browsertests']
else:
self.suite_path = os.path.join(
product_dir, '%s_apk' % suite_name, '%s-debug.apk' % suite_name)
- self._test_apk_package_name = constants.GTEST_TEST_PACKAGE_NAME
- self._test_activity_name = constants.GTEST_TEST_ACTIVITY_NAME
- self._command_line_file = constants.GTEST_COMMAND_LINE_FILE
+ self._package_info = constants.PACKAGE_INFO['gtest']
def _CreateCommandLineFileOnDevice(self, adb, options):
command_line_file = tempfile.NamedTemporaryFile()
@@ -50,15 +46,14 @@ class TestPackageApk(TestPackage):
command_line_file.write(self.suite_name + ' ' + options)
command_line_file.flush()
adb.PushIfNeeded(command_line_file.name,
- constants.TEST_EXECUTABLE_DIR + '/' +
- self._command_line_file)
+ self._package_info.cmdline_file)
def _GetFifo(self):
# The test.fifo path is determined by:
# testing/android/java/src/org/chromium/native_test/
# ChromeNativeTestActivity.java and
# testing/android/native_test_launcher.cc
- return '/data/data/' + self._test_apk_package_name + '/files/test.fifo'
+ return '/data/data/' + self._package_info.package + '/files/test.fifo'
def _ClearFifo(self, adb):
adb.RunShellCommand('rm -f ' + self._GetFifo())
@@ -78,15 +73,15 @@ class TestPackageApk(TestPackage):
def _StartActivity(self, adb):
adb.StartActivity(
- self._test_apk_package_name,
- self._test_activity_name,
+ self._package_info.package,
+ self._package_info.activity,
wait_for_completion=True,
action='android.intent.action.MAIN',
force_stop=True)
#override
def ClearApplicationState(self, adb):
- adb.ClearApplicationState(self._test_apk_package_name)
+ adb.ClearApplicationState(self._package_info.package)
# Content shell creates a profile on the sdscard which accumulates cache
# files over time.
if self.suite_name == 'content_browsertests':
@@ -132,4 +127,4 @@ class TestPackageApk(TestPackage):
def Install(self, adb):
self.tool.CopyFiles()
adb.ManagedInstall(self.suite_path, False,
- package_name=self._test_apk_package_name)
+ package_name=self._package_info.package)
« no previous file with comments | « build/android/pylib/flag_changer.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698