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

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

Issue 20649002: [Android] Dedup content_browsertests test setup from gtests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed bulach's comments Created 7 years, 5 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/setup.py ('k') | build/android/pylib/gtest/test_package_apk.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.py
diff --git a/build/android/pylib/gtest/test_package.py b/build/android/pylib/gtest/test_package.py
index 945b4fde947c97ff3a258a146c22bd77881a9c20..ce07f4fb97101038837ca95d551310a064d0ec55 100644
--- a/build/android/pylib/gtest/test_package.py
+++ b/build/android/pylib/gtest/test_package.py
@@ -4,67 +4,65 @@
"""Base class representing GTest test packages."""
-import os
-
-from pylib import constants
+import logging
class TestPackage(object):
+
"""A helper base class for both APK and stand-alone executables.
Args:
- adb: ADB interface the tests are using.
- device: Device to run the tests.
- suite_path_full: Absolute path to a specific test suite to run,
- empty to run all.
- Ex: '/foo/bar/base_unittests-debug.apk', for which
- self.suite_path_full = '/foo/bar/base_unittests-debug.apk'
- self.suite_path = '/foo/bar/base_unittests-debug'
- self.suite_basename = 'base_unittests'
- self.suite_dirname = '/foo/bar'
- tool: Name of the Valgrind tool.
+ suite_name: Name of the test suite (e.g. base_unittests).
"""
+ def __init__(self, suite_name):
+ self.suite_name = suite_name
- def __init__(self, adb, device, suite_path_full, tool):
- self.adb = adb
- self.device = device
- self.suite_path_full = suite_path_full
- self.suite_path = os.path.splitext(suite_path_full)[0]
- self.suite_basename = self._GetTestSuiteBaseName()
- self.suite_dirname = os.path.dirname(
- self.suite_path.split(self.suite_basename)[0])
- self.tool = tool
-
- def ClearApplicationState(self):
- """Clears the application state."""
+ def ClearApplicationState(self, adb):
+ """Clears the application state.
+
+ Args:
+ adb: Instance of AndroidCommands.
+ """
raise NotImplementedError('Method must be overriden.')
- def CreateCommandLineFileOnDevice(self, test_filter, test_arguments):
+ def CreateCommandLineFileOnDevice(self, adb, test_filter, test_arguments):
"""Creates a test runner script and pushes to the device.
Args:
+ adb: Instance of AndroidCommands.
test_filter: A test_filter flag.
test_arguments: Additional arguments to pass to the test binary.
"""
raise NotImplementedError('Method must be overriden.')
- def GetAllTests(self):
- """Returns a list of all tests available in the test suite."""
+ def GetAllTests(self, adb):
+ """Returns a list of all tests available in the test suite.
+
+ Args:
+ adb: Instance of AndroidCommands.
+ """
raise NotImplementedError('Method must be overriden.')
- def GetGTestReturnCode(self):
+ def GetGTestReturnCode(self, adb):
return None
- def SpawnTestProcess(self):
+ def SpawnTestProcess(self, adb):
"""Spawn the test process.
+ Args:
+ adb: Instance of AndroidCommands.
+
Returns:
An instance of pexpect spawn class.
"""
raise NotImplementedError('Method must be overriden.')
- def Install(self):
- """Install the test package to the device."""
+ def Install(self, adb):
+ """Install the test package to the device.
+
+ Args:
+ adb: Instance of AndroidCommands.
+ """
raise NotImplementedError('Method must be overriden.')
def _ParseGTestListTests(self, raw_list):
« no previous file with comments | « build/android/pylib/gtest/setup.py ('k') | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698