OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Run specific test on specific environment.""" | 5 """Run specific test on specific environment.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 def __init__(self, env, test_instance): | 28 def __init__(self, env, test_instance): |
29 """Constructor. | 29 """Constructor. |
30 | 30 |
31 Args: | 31 Args: |
32 env: Environment the tests will run in. | 32 env: Environment the tests will run in. |
33 test_instance: The test that will be run. | 33 test_instance: The test that will be run. |
34 """ | 34 """ |
35 super(RemoteDeviceUirobotRun, self).__init__(env, test_instance) | 35 super(RemoteDeviceUirobotRun, self).__init__(env, test_instance) |
36 | 36 |
| 37 #override |
37 def TestPackage(self): | 38 def TestPackage(self): |
38 pass | 39 return self._test_instance.package_name |
39 | 40 |
40 #override | 41 #override |
41 def _TriggerSetUp(self): | 42 def _TriggerSetUp(self): |
42 """Set up the triggering of a test run.""" | 43 """Set up the triggering of a test run.""" |
43 self._app_id = self._UploadAppToDevice(self._test_instance.apk_under_test) | 44 self._app_id = self._UploadAppToDevice(self._test_instance.apk_under_test) |
44 if not self._env.runner_type: | 45 if not self._env.runner_type: |
45 runner_type = self.DEFAULT_RUNNER_TYPE | 46 runner_type = self.DEFAULT_RUNNER_TYPE |
46 logging.info('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) | 47 logging.info('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) |
47 else: | 48 else: |
48 runner_type = self._env.runner_type | 49 runner_type = self._env.runner_type |
49 self._test_id = self._GetTestByName(runner_type) | 50 self._test_id = self._GetTestByName(runner_type) |
50 config_body = {'duration': self._test_instance.minutes} | 51 config_body = {'duration': self._test_instance.minutes} |
51 self._SetTestConfig(runner_type, config_body) | 52 self._SetTestConfig(runner_type, config_body) |
52 | 53 |
53 #override | 54 #override |
54 def _ParseTestResults(self): | 55 def _ParseTestResults(self): |
55 # TODO(rnephew): Populate test results object. | 56 # TODO(rnephew): Populate test results object. |
56 results = remote_device_test_run.TestRunResults() | 57 results = remote_device_test_run.TestRunResults() |
57 return results | 58 return results |
58 | 59 |
OLD | NEW |