OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Run specific test on specific environment.""" |
| 6 |
| 7 import logging |
| 8 import os |
| 9 import sys |
| 10 |
| 11 from pylib import constants |
| 12 from pylib.remote.device import remote_device_test_run |
| 13 from pylib.remote.device import remote_device_helper |
| 14 |
| 15 sys.path.append(os.path.join( |
| 16 constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src')) |
| 17 import appurify.api |
| 18 import appurify.utils |
| 19 |
| 20 class RemoteDeviceUirobotRun(remote_device_test_run.RemoteDeviceTestRun): |
| 21 """Run gtests and uirobot tests on a remote device.""" |
| 22 |
| 23 DEFAULT_RUNNER_TYPE = 'android_robot' |
| 24 |
| 25 def __init__(self, env, test_instance): |
| 26 """Constructor. |
| 27 |
| 28 Args: |
| 29 env: Environment the tests will run in. |
| 30 test_instance: The test that will be run. |
| 31 """ |
| 32 super(RemoteDeviceUirobotRun, self).__init__(env, test_instance) |
| 33 |
| 34 def TestPackage(self): |
| 35 pass |
| 36 |
| 37 #override |
| 38 def SetUp(self): |
| 39 """Setup the test run.""" |
| 40 self._app_id = self.UploadAppToDevice() |
| 41 if not self._env.runner_type: |
| 42 runner_type = self.DEFAULT_RUNNER_TYPE |
| 43 logging.debug('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) |
| 44 else: |
| 45 runner_type = self._env.runner_type |
| 46 self._test_id = self.GetTestByName(runner_type) |
| 47 config_body = {'duration': self._test_instance.minutes} |
| 48 self.SetTestConfig(runner_type, config_body) |
| 49 |
OLD | NEW |