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 RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): | |
21 """Run gtests and uirobot tests on a remote device.""" | |
22 | |
23 DEFAULT_RUNNER_TYPE = 'robotium' | |
24 DEFAULT_RUNNER_PACKAGE = ( | |
25 'org.chromium.native_test.ChromiumNativeTestInstrumentationTestRunner') | |
26 | |
27 def __init__(self, env, test_instance): | |
28 """Constructor. | |
29 | |
30 Args: | |
31 env: Environment the tests will run in. | |
32 test_instance: The test that will be run. | |
33 """ | |
34 super(RemoteDeviceGtestRun, self).__init__(env, test_instance) | |
35 | |
36 def TestPackage(self): | |
37 pass | |
38 | |
39 #override | |
40 def SetUp(self): | |
41 """Setup the test run.""" | |
42 if self._env.collect: | |
43 return | |
44 | |
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 PackageTestResults(self): | |
jbudorick
2014/12/04 21:51:34
This should return something. You can return an em
rnephew (Reviews Here)
2014/12/04 23:16:50
Done.
| |
66 pass | |
OLD | NEW |