Chromium Code Reviews| 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.base import base_test_result | |
| 13 from pylib.remote.device import remote_device_test_run | |
| 14 from pylib.remote.device import remote_device_helper | |
| 15 | |
| 16 sys.path.append(os.path.join( | |
| 17 constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src')) | |
| 18 import appurify.api | |
| 19 import appurify.utils | |
| 20 | |
| 21 class RemoteDeviceUirobotRun(remote_device_test_run.RemoteDeviceTestRun): | |
| 22 """Run uirobot tests on a remote device.""" | |
| 23 | |
| 24 DEFAULT_RUNNER_TYPE = 'android_robot' | |
| 25 | |
| 26 def __init__(self, env, test_instance): | |
| 27 """Constructor. | |
| 28 | |
| 29 Args: | |
| 30 env: Environment the tests will run in. | |
| 31 test_instance: The test that will be run. | |
| 32 """ | |
| 33 super(RemoteDeviceUirobotRun, self).__init__(env, test_instance) | |
| 34 | |
| 35 def TestPackage(self): | |
| 36 pass | |
| 37 | |
| 38 #override | |
| 39 def _TriggerSetUp(self): | |
| 40 """Set up the triggering of a test run.""" | |
| 41 self._app_id = self._UploadAppToDevice(self._test_instance.apk_under_test) | |
| 42 if not self._env.runner_type: | |
| 43 runner_type = self.DEFAULT_RUNNER_TYPE | |
| 44 logging.debug('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) | |
|
jbudorick
2014/12/05 21:35:12
again, log at info level
rnephew (Reviews Here)
2014/12/05 21:46:29
Done.
| |
| 45 else: | |
| 46 runner_type = self._env.runner_type | |
| 47 self._test_id = self._GetTestByName(runner_type) | |
| 48 config_body = {'duration': self._test_instance.minutes} | |
| 49 self._SetTestConfig(runner_type, config_body) | |
| 50 | |
| 51 #override | |
| 52 def _ParseTestResults(self): | |
| 53 # TODO(rnephew): Populate test results object. | |
| 54 results = remote_device_test_run.TestRunResults() | |
| 55 return results | |
| 56 | |
| OLD | NEW |