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

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

Issue 12263024: Android: Add test runner scripts to run content_browsertests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Frank's comments and fixed typo in constants.py 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/gtest/dispatch.py ('k') | build/android/pylib/gtest/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 79de36f202d4dffb83e2c90faaecb5fcd6d211cc..3d9a926e422080bd43f3e72317f460fd924fce42 100644
--- a/build/android/pylib/gtest/test_package_apk.py
+++ b/build/android/pylib/gtest/test_package_apk.py
@@ -30,9 +30,13 @@ class TestPackageApk(TestPackage):
"""
def __init__(self, adb, device, test_suite, timeout,
- cleanup_test_files, tool):
+ cleanup_test_files, tool, apk_package_name,
+ test_activity_name, command_line_file):
TestPackage.__init__(self, adb, device, test_suite, timeout,
cleanup_test_files, tool)
+ self._apk_package_name = apk_package_name
+ self._test_activity_name = test_activity_name
+ self._command_line_file = command_line_file
def _CreateTestRunnerScript(self, options):
command_line_file = tempfile.NamedTemporaryFile()
@@ -40,8 +44,8 @@ class TestPackageApk(TestPackage):
command_line_file.write(self.test_suite_basename + ' ' + options)
command_line_file.flush()
self.adb.PushIfNeeded(command_line_file.name,
- constants.TEST_EXECUTABLE_DIR +
- '/chrome-native-tests-command-line')
+ constants.TEST_EXECUTABLE_DIR + '/' +
+ self._command_line_file)
def _GetGTestReturnCode(self):
return None
@@ -51,7 +55,7 @@ class TestPackageApk(TestPackage):
# testing/android/java/src/org/chromium/native_test/
# ChromeNativeTestActivity.java and
# testing/android/native_test_launcher.cc
- return '/data/data/org.chromium.native_test/files/test.fifo'
+ return '/data/data/' + self._apk_package_name + '/files/test.fifo'
def _ClearFifo(self):
self.adb.RunShellCommand('rm -f ' + self._GetFifo())
@@ -77,9 +81,8 @@ class TestPackageApk(TestPackage):
# Clear and start monitoring logcat.
self._ClearFifo()
self.adb.RunShellCommand(
- 'am start -n '
- 'org.chromium.native_test/'
- 'org.chromium.native_test.ChromeNativeTestActivity')
+ 'am start -n ' + self._apk_package_name + '/' +
+ self._test_activity_name)
# Wait for native test to complete.
p = self._WatchFifo(timeout=30 * self.tool.GetTimeoutScale())
p.expect("<<ScopedMainEntryLogger")
@@ -100,9 +103,8 @@ class TestPackageApk(TestPackage):
self.tool.SetupEnvironment()
self._ClearFifo()
self.adb.RunShellCommand(
- 'am start -n '
- 'org.chromium.native_test/'
- 'org.chromium.native_test.ChromeNativeTestActivity')
+ 'am start -n ' + self._apk_package_name + '/' +
+ self._test_activity_name)
finally:
self.tool.CleanUpEnvironment()
logfile = android_commands.NewLineNormalizer(sys.stdout)
@@ -113,7 +115,7 @@ class TestPackageApk(TestPackage):
# Always uninstall the previous one (by activity name); we don't
# know what was embedded in it.
self.adb.ManagedInstall(self.test_suite_full, False,
- package_name='org.chromium.native_test')
+ package_name=self._apk_package_name)
def _GetTestSuiteBaseName(self):
"""Returns the base name of the test suite."""
« no previous file with comments | « build/android/pylib/gtest/dispatch.py ('k') | build/android/pylib/gtest/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698