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 import fnmatch | 5 import fnmatch |
6 import functools | 6 import functools |
| 7 import imp |
7 import logging | 8 import logging |
8 | 9 |
9 from devil import base_error | 10 from devil import base_error |
10 from devil.android import device_errors | 11 from devil.android import device_errors |
11 from pylib import valgrind_tools | 12 from pylib import valgrind_tools |
12 from pylib.base import base_test_result | 13 from pylib.base import base_test_result |
13 from pylib.base import test_run | 14 from pylib.base import test_run |
14 from pylib.base import test_collection | 15 from pylib.base import test_collection |
15 | 16 |
16 | 17 |
| 18 def IncrementalInstall(device, apk_helper, installer_script): |
| 19 """Performs an incremental install. |
| 20 |
| 21 Args: |
| 22 device: Device to install on. |
| 23 apk_helper: ApkHelper instance for the _incremental.apk. |
| 24 installer_script: Path to the installer script for the incremental apk. |
| 25 """ |
| 26 try: |
| 27 install_wrapper = imp.load_source('install_wrapper', installer_script) |
| 28 except IOError: |
| 29 raise Exception('Incremental install script not found: %s\n' % |
| 30 installer_script) |
| 31 params = install_wrapper.GetInstallParameters() |
| 32 |
| 33 from incremental_install import installer |
| 34 installer.Install(device, apk_helper, split_globs=params['splits'], |
| 35 native_libs=params['native_libs'], |
| 36 dex_files=params['dex_files']) |
| 37 |
| 38 |
17 def handle_shard_failures(f): | 39 def handle_shard_failures(f): |
18 """A decorator that handles device failures for per-device functions. | 40 """A decorator that handles device failures for per-device functions. |
19 | 41 |
20 Args: | 42 Args: |
21 f: the function being decorated. The function must take at least one | 43 f: the function being decorated. The function must take at least one |
22 argument, and that argument must be the device. | 44 argument, and that argument must be the device. |
23 """ | 45 """ |
24 return handle_shard_failures_with(None)(f) | 46 return handle_shard_failures_with(None)(f) |
25 | 47 |
26 | 48 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return test | 185 return test |
164 | 186 |
165 def _GetTests(self): | 187 def _GetTests(self): |
166 raise NotImplementedError | 188 raise NotImplementedError |
167 | 189 |
168 def _RunTest(self, device, test): | 190 def _RunTest(self, device, test): |
169 raise NotImplementedError | 191 raise NotImplementedError |
170 | 192 |
171 def _ShouldShard(self): | 193 def _ShouldShard(self): |
172 raise NotImplementedError | 194 raise NotImplementedError |
OLD | NEW |