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 json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 is_infra_error=True) | 105 is_infra_error=True) |
106 time.sleep(self.WAIT_TIME) | 106 time.sleep(self.WAIT_TIME) |
107 timeout_counter += self.WAIT_TIME | 107 timeout_counter += self.WAIT_TIME |
108 heartbeat_counter += self.WAIT_TIME | 108 heartbeat_counter += self.WAIT_TIME |
109 self._DownloadTestResults(self._env.results_path) | 109 self._DownloadTestResults(self._env.results_path) |
110 | 110 |
111 if self._results['results']['exception']: | 111 if self._results['results']['exception']: |
112 raise remote_device_helper.RemoteDeviceError( | 112 raise remote_device_helper.RemoteDeviceError( |
113 self._results['results']['exception'], is_infra_error=True) | 113 self._results['results']['exception'], is_infra_error=True) |
114 | 114 |
115 return self._ParseTestResults() | 115 return [self._ParseTestResults()] |
116 | 116 |
117 #override | 117 #override |
118 def TearDown(self): | 118 def TearDown(self): |
119 """Tear down the test run.""" | 119 """Tear down the test run.""" |
120 if self._env.collect: | 120 if self._env.collect: |
121 self._CollectTearDown() | 121 self._CollectTearDown() |
122 elif self._env.trigger: | 122 elif self._env.trigger: |
123 assert isinstance(self._env.trigger, basestring), ( | 123 assert isinstance(self._env.trigger, basestring), ( |
124 'File for storing test_run_id must be a string.') | 124 'File for storing test_run_id must be a string.') |
125 with open(self._env.trigger, 'w') as persisted_data_file: | 125 with open(self._env.trigger, 'w') as persisted_data_file: |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 self._LogLogcat() | 381 self._LogLogcat() |
382 self._LogAdbTraceLog() | 382 self._LogAdbTraceLog() |
383 raise remote_device_helper.RemoteDeviceError( | 383 raise remote_device_helper.RemoteDeviceError( |
384 'Remote service unable to reach device.', is_infra_error=True) | 384 'Remote service unable to reach device.', is_infra_error=True) |
385 else: | 385 else: |
386 # Remote service is reporting a failure, but no failure in results obj. | 386 # Remote service is reporting a failure, but no failure in results obj. |
387 if results.DidRunPass(): | 387 if results.DidRunPass(): |
388 results.AddResult(base_test_result.BaseTestResult( | 388 results.AddResult(base_test_result.BaseTestResult( |
389 'Remote service detected error.', | 389 'Remote service detected error.', |
390 base_test_result.ResultType.UNKNOWN)) | 390 base_test_result.ResultType.UNKNOWN)) |
OLD | NEW |