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 re | 6 import re |
7 import time | 7 import time |
8 | 8 |
9 from devil.android import device_errors | 9 from devil.android import device_errors |
10 from devil.android.sdk import keyevent | 10 from devil.android.sdk import keyevent |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 def SetUp(self): | 59 def SetUp(self): |
60 def substitute_external_storage(d, external_storage): | 60 def substitute_external_storage(d, external_storage): |
61 if not d: | 61 if not d: |
62 return external_storage | 62 return external_storage |
63 elif isinstance(d, list): | 63 elif isinstance(d, list): |
64 return '/'.join(p if p else external_storage for p in d) | 64 return '/'.join(p if p else external_storage for p in d) |
65 else: | 65 else: |
66 return d | 66 return d |
67 | 67 |
68 def individual_device_set_up(dev, host_device_tuples): | 68 def individual_device_set_up(dev, host_device_tuples): |
69 dev.Install(self._test_instance.apk_under_test) | 69 dev.Install(self._test_instance.apk_under_test, |
70 dev.Install(self._test_instance.test_apk) | 70 permissions=self._test_instance.apk_under_test_permissions) |
| 71 dev.Install(self._test_instance.test_apk, |
| 72 permissions=self._test_instance.test_permissions) |
71 | 73 |
72 external_storage = dev.GetExternalStoragePath() | 74 external_storage = dev.GetExternalStoragePath() |
73 host_device_tuples = [ | 75 host_device_tuples = [ |
74 (h, substitute_external_storage(d, external_storage)) | 76 (h, substitute_external_storage(d, external_storage)) |
75 for h, d in host_device_tuples] | 77 for h, d in host_device_tuples] |
76 logging.info('instrumentation data deps:') | 78 logging.info('instrumentation data deps:') |
77 for h, d in host_device_tuples: | 79 for h, d in host_device_tuples: |
78 logging.info('%r -> %r', h, d) | 80 logging.info('%r -> %r', h, d) |
79 dev.PushChangedFiles(host_device_tuples) | 81 dev.PushChangedFiles(host_device_tuples) |
80 if self._test_instance.flags: | 82 if self._test_instance.flags: |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 184 |
183 try: | 185 try: |
184 scale = int(annotations.get('TimeoutScale', 1)) | 186 scale = int(annotations.get('TimeoutScale', 1)) |
185 except ValueError as e: | 187 except ValueError as e: |
186 logging.warning("Non-integer value of TimeoutScale ignored. (%s)", str(e)) | 188 logging.warning("Non-integer value of TimeoutScale ignored. (%s)", str(e)) |
187 scale = 1 | 189 scale = 1 |
188 timeout *= scale | 190 timeout *= scale |
189 | 191 |
190 return timeout | 192 return timeout |
191 | 193 |
OLD | NEW |