| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Base class representing GTest test packages.""" | 5 """Base class representing GTest test packages.""" |
| 6 # pylint: disable=R0201 | 6 # pylint: disable=R0201 |
| 7 | 7 |
| 8 | 8 |
| 9 class TestPackage(object): | 9 class TestPackage(object): |
| 10 | 10 |
| 11 """A helper base class for both APK and stand-alone executables. | 11 """A helper base class for both APK and stand-alone executables. |
| 12 | 12 |
| 13 Args: | 13 Args: |
| 14 suite_name: Name of the test suite (e.g. base_unittests). | 14 suite_name: Name of the test suite (e.g. base_unittests). |
| 15 """ | 15 """ |
| 16 def __init__(self, suite_name): | 16 def __init__(self, suite_name): |
| 17 self.suite_name = suite_name | 17 self.suite_name = suite_name |
| 18 | 18 |
| 19 def ClearApplicationState(self, device): | 19 def ClearApplicationState(self, device): |
| 20 """Clears the application state. | 20 """Clears the application state. |
| 21 | 21 |
| 22 Args: | 22 Args: |
| 23 device: Instance of DeviceUtils. | 23 device: Instance of DeviceUtils. |
| 24 """ | 24 """ |
| 25 raise NotImplementedError('Method must be overriden.') | 25 raise NotImplementedError('Method must be overridden.') |
| 26 | 26 |
| 27 def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments): | 27 def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments): |
| 28 """Creates a test runner script and pushes to the device. | 28 """Creates a test runner script and pushes to the device. |
| 29 | 29 |
| 30 Args: | 30 Args: |
| 31 device: Instance of DeviceUtils. | 31 device: Instance of DeviceUtils. |
| 32 test_filter: A test_filter flag. | 32 test_filter: A test_filter flag. |
| 33 test_arguments: Additional arguments to pass to the test binary. | 33 test_arguments: Additional arguments to pass to the test binary. |
| 34 """ | 34 """ |
| 35 raise NotImplementedError('Method must be overriden.') | 35 raise NotImplementedError('Method must be overridden.') |
| 36 | 36 |
| 37 def GetAllTests(self, device): | 37 def GetAllTests(self, device): |
| 38 """Returns a list of all tests available in the test suite. | 38 """Returns a list of all tests available in the test suite. |
| 39 | 39 |
| 40 Args: | 40 Args: |
| 41 device: Instance of DeviceUtils. | 41 device: Instance of DeviceUtils. |
| 42 """ | 42 """ |
| 43 raise NotImplementedError('Method must be overriden.') | 43 raise NotImplementedError('Method must be overridden.') |
| 44 | 44 |
| 45 def GetGTestReturnCode(self, _device): | 45 def GetGTestReturnCode(self, _device): |
| 46 return None | 46 return None |
| 47 | 47 |
| 48 def SpawnTestProcess(self, device): | 48 def SpawnTestProcess(self, device): |
| 49 """Spawn the test process. | 49 """Spawn the test process. |
| 50 | 50 |
| 51 Args: | 51 Args: |
| 52 device: Instance of DeviceUtils. | 52 device: Instance of DeviceUtils. |
| 53 | 53 |
| 54 Returns: | 54 Returns: |
| 55 An instance of pexpect spawn class. | 55 An instance of pexpect spawn class. |
| 56 """ | 56 """ |
| 57 raise NotImplementedError('Method must be overriden.') | 57 raise NotImplementedError('Method must be overridden.') |
| 58 | 58 |
| 59 def Install(self, device): | 59 def Install(self, device): |
| 60 """Install the test package to the device. | 60 """Install the test package to the device. |
| 61 | 61 |
| 62 Args: | 62 Args: |
| 63 device: Instance of DeviceUtils. | 63 device: Instance of DeviceUtils. |
| 64 """ | 64 """ |
| 65 raise NotImplementedError('Method must be overriden.') | 65 raise NotImplementedError('Method must be overridden.') |
| 66 | 66 |
| 67 def PullAppFiles(self, device, files, directory): |
| 68 """Pull application data from the device. |
| 69 |
| 70 Args: |
| 71 device: Instance of DeviceUtils. |
| 72 files: A list of paths relative to the application data directory to |
| 73 retrieve from the device. |
| 74 directory: The host directory to which files should be pulled. |
| 75 """ |
| 76 raise NotImplementedError('Method must be overridden.') |
| OLD | NEW |