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.base_test_result import TestRunResults | |
jbudorick
2014/12/05 01:01:46
import base_test_result, not TestRunResults
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
| |
13 from pylib.remote.device import remote_device_test_run | |
14 from pylib.remote.device import remote_device_helper | |
15 | |
16 | |
17 sys.path.append(os.path.join( | |
18 constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src')) | |
19 import appurify.api | |
20 import appurify.utils | |
21 | |
22 class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): | |
23 """Run gtests and uirobot tests on a remote device.""" | |
24 | |
25 DEFAULT_RUNNER_TYPE = 'robotium' | |
26 DEFAULT_RUNNER_PACKAGE = ( | |
27 'org.chromium.native_test.ChromiumNativeTestInstrumentationTestRunner') | |
28 | |
29 def __init__(self, env, test_instance): | |
jbudorick
2014/12/05 01:01:46
If this is just calling the base class constructor
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
| |
30 """Constructor. | |
31 | |
32 Args: | |
33 env: Environment the tests will run in. | |
34 test_instance: The test that will be run. | |
35 """ | |
36 super(RemoteDeviceGtestRun, self).__init__(env, test_instance) | |
37 | |
38 def TestPackage(self): | |
39 pass | |
40 | |
41 #override | |
42 def SetUp(self): | |
43 """Setup the test run.""" | |
44 if self._env.trigger: | |
45 self._app_id = self._UploadAppToDevice(self._test_instance.apk) | |
46 | |
47 if not self._env.runner_type: | |
48 runner_type = self.DEFAULT_RUNNER_TYPE | |
49 logging.debug('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) | |
50 else: | |
51 runner_type = self._env.runner_type | |
52 | |
53 if not self._env.runner_package: | |
54 runner_package = self.DEFAULT_RUNNER_PACKAGE | |
55 logging.debug('Using default runner package: %s', | |
56 self.DEFAULT_RUNNER_TYPE) | |
57 else: | |
58 runner_package = self._env.runner_package | |
59 | |
60 self._test_id = self._UploadTestToDevice(runner_type) | |
61 config_body = {'runner': runner_package} | |
62 self._SetTestConfig(runner_type, config_body) | |
63 | |
64 #override | |
65 def _ParseTestResults(self): | |
66 #TODO(rnephew): Populate test results object. | |
jbudorick
2014/12/05 01:01:46
nit: space after TODO
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
| |
67 results = TestRunResults() | |
68 return results | |
OLD | NEW |