OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import logging | 5 import logging |
6 import os | 6 import os |
7 import posixpath | 7 import posixpath |
8 import re | 8 import re |
9 import time | 9 import time |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 self._flag_changers = {} | 57 self._flag_changers = {} |
58 | 58 |
59 def TestPackage(self): | 59 def TestPackage(self): |
60 return self._test_instance.suite | 60 return self._test_instance.suite |
61 | 61 |
62 def SetUp(self): | 62 def SetUp(self): |
63 def substitute_device_root(d, device_root): | 63 def substitute_device_root(d, device_root): |
64 if not d: | 64 if not d: |
65 return device_root | 65 return device_root |
66 elif isinstance(d, list): | 66 elif isinstance(d, list): |
67 return posixpath.join(p if p else device_root for p in d) | 67 return posixpath.join(*(p if p else device_root for p in d)) |
68 else: | 68 else: |
69 return d | 69 return d |
70 | 70 |
71 @local_device_environment.handle_shard_failures_with( | 71 @local_device_environment.handle_shard_failures_with( |
72 self._env.BlacklistDevice) | 72 self._env.BlacklistDevice) |
73 def individual_device_set_up(dev, host_device_tuples): | 73 def individual_device_set_up(dev, host_device_tuples): |
74 def install_apk(): | 74 def install_apk(): |
75 if self._test_instance.apk_under_test: | 75 if self._test_instance.apk_under_test: |
76 if self._test_instance.apk_under_test_incremental_install_script: | 76 if self._test_instance.apk_under_test_incremental_install_script: |
77 local_device_test_run.IncrementalInstall( | 77 local_device_test_run.IncrementalInstall( |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 timeout = v | 371 timeout = v |
372 break | 372 break |
373 else: | 373 else: |
374 logging.warning('Using default 1 minute timeout for %s', test_name) | 374 logging.warning('Using default 1 minute timeout for %s', test_name) |
375 timeout = 60 | 375 timeout = 60 |
376 | 376 |
377 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) | 377 timeout *= cls._GetTimeoutScaleFromAnnotations(annotations) |
378 | 378 |
379 return timeout | 379 return timeout |
380 | 380 |
OLD | NEW |