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 imp | 5 import imp |
6 import itertools | 6 import itertools |
7 import os | 7 import os |
8 import posixpath | 8 import posixpath |
9 | 9 |
10 from devil.android import device_errors | 10 from devil.android import device_errors |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 self._apk_helper = test_instance.apk_helper | 100 self._apk_helper = test_instance.apk_helper |
101 self._package = test_instance.package | 101 self._package = test_instance.package |
102 self._runner = test_instance.runner | 102 self._runner = test_instance.runner |
103 self._permissions = test_instance.permissions | 103 self._permissions = test_instance.permissions |
104 self._suite = test_instance.suite | 104 self._suite = test_instance.suite |
105 self._component = '%s/%s' % (self._package, self._runner) | 105 self._component = '%s/%s' % (self._package, self._runner) |
106 self._extras = test_instance.extras | 106 self._extras = test_instance.extras |
107 | 107 |
108 def Install(self, device, incremental=False): | 108 def Install(self, device, incremental=False): |
109 if not incremental: | 109 if not incremental: |
110 device.Install(self._apk_helper, permissions=self._permissions) | 110 device.Install(self._apk_helper, reinstall=True, |
jbudorick
2015/10/22 15:14:15
Hrm, I was worried about how the bots would handle
| |
111 permissions=self._permissions) | |
111 return | 112 return |
112 | 113 |
113 installer_script = os.path.join(constants.GetOutDirectory(), 'bin', | 114 installer_script = os.path.join(constants.GetOutDirectory(), 'bin', |
114 'install_%s_apk_incremental' % self._suite) | 115 'install_%s_apk_incremental' % self._suite) |
115 try: | 116 try: |
116 install_wrapper = imp.load_source('install_wrapper', installer_script) | 117 install_wrapper = imp.load_source('install_wrapper', installer_script) |
117 except IOError: | 118 except IOError: |
118 raise Exception(('Incremental install script not found: %s\n' | 119 raise Exception(('Incremental install script not found: %s\n' |
119 'Make sure to first build "%s_incremental"') % | 120 'Make sure to first build "%s_incremental"') % |
120 (installer_script, self._suite)) | 121 (installer_script, self._suite)) |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 def TearDown(self): | 355 def TearDown(self): |
355 @local_device_test_run.handle_shard_failures | 356 @local_device_test_run.handle_shard_failures |
356 def individual_device_tear_down(dev): | 357 def individual_device_tear_down(dev): |
357 for s in self._servers.get(str(dev), []): | 358 for s in self._servers.get(str(dev), []): |
358 s.TearDown() | 359 s.TearDown() |
359 | 360 |
360 tool = self.GetTool(dev) | 361 tool = self.GetTool(dev) |
361 tool.CleanUpEnvironment() | 362 tool.CleanUpEnvironment() |
362 | 363 |
363 self._env.parallel_devices.pMap(individual_device_tear_down) | 364 self._env.parallel_devices.pMap(individual_device_tear_down) |
OLD | NEW |