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 25 matching lines...) Expand all Loading... |
36 def _TriggerSetUp(self): | 36 def _TriggerSetUp(self): |
37 """Set up the triggering of a test run.""" | 37 """Set up the triggering of a test run.""" |
38 logging.info('Triggering test run.') | 38 logging.info('Triggering test run.') |
39 | 39 |
40 if self._env.device_type == 'Android': | 40 if self._env.device_type == 'Android': |
41 default_runner_type = 'android_robot' | 41 default_runner_type = 'android_robot' |
42 elif self._env.device_type == 'iOS': | 42 elif self._env.device_type == 'iOS': |
43 default_runner_type = 'ios_robot' | 43 default_runner_type = 'ios_robot' |
44 else: | 44 else: |
45 raise remote_device_helper.RemoteDeviceError( | 45 raise remote_device_helper.RemoteDeviceError( |
46 'Unkown device type: %s' % self._env.device_type) | 46 'Unknown device type: %s' % self._env.device_type) |
47 | 47 |
48 self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test) | 48 self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test) |
49 if not self._env.runner_type: | 49 if not self._env.runner_type: |
50 runner_type = default_runner_type | 50 runner_type = default_runner_type |
51 logging.info('Using default runner type: %s', default_runner_type) | 51 logging.info('Using default runner type: %s', default_runner_type) |
52 else: | 52 else: |
53 runner_type = self._env.runner_type | 53 runner_type = self._env.runner_type |
54 | 54 |
55 self._test_id = self._UploadTestToDevice( | 55 self._test_id = self._UploadTestToDevice( |
56 'android_robot', None, app_id=self._app_id) | 56 'android_robot', None, app_id=self._app_id) |
(...skipping 22 matching lines...) Expand all Loading... |
79 #override | 79 #override |
80 def _ParseTestResults(self): | 80 def _ParseTestResults(self): |
81 logging.info('Parsing results from remote service.') | 81 logging.info('Parsing results from remote service.') |
82 results = base_test_result.TestRunResults() | 82 results = base_test_result.TestRunResults() |
83 if self._results['results']['pass']: | 83 if self._results['results']['pass']: |
84 result_type = base_test_result.ResultType.PASS | 84 result_type = base_test_result.ResultType.PASS |
85 else: | 85 else: |
86 result_type = base_test_result.ResultType.FAIL | 86 result_type = base_test_result.ResultType.FAIL |
87 results.AddResult(base_test_result.BaseTestResult('uirobot', result_type)) | 87 results.AddResult(base_test_result.BaseTestResult('uirobot', result_type)) |
88 return results | 88 return results |
OLD | NEW |