| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 # Run the test. | 299 # Run the test. |
| 300 timeout = (self._test_instance.shard_timeout | 300 timeout = (self._test_instance.shard_timeout |
| 301 * self.GetTool(device).GetTimeoutScale()) | 301 * self.GetTool(device).GetTimeoutScale()) |
| 302 output = self._delegate.Run( | 302 output = self._delegate.Run( |
| 303 test, device, timeout=timeout, retries=0) | 303 test, device, timeout=timeout, retries=0) |
| 304 for s in self._servers[str(device)]: | 304 for s in self._servers[str(device)]: |
| 305 s.Reset() | 305 s.Reset() |
| 306 if self._test_instance.app_files: | 306 if self._test_instance.app_files: |
| 307 self._delegate.PullAppFiles(device, self._test_instance.app_files, | 307 self._delegate.PullAppFiles(device, self._test_instance.app_files, |
| 308 self._test_instance.app_file_dir) | 308 self._test_instance.app_file_dir) |
| 309 self._delegate.Clear(device) | 309 # Clearing data when using incremental install wipes out cached optimized |
| 310 # dex files (and shouldn't be necessary by tests anyways). |
| 311 if not self._env.incremental_install: |
| 312 self._delegate.Clear(device) |
| 310 | 313 |
| 311 # Parse the output. | 314 # Parse the output. |
| 312 # TODO(jbudorick): Transition test scripts away from parsing stdout. | 315 # TODO(jbudorick): Transition test scripts away from parsing stdout. |
| 313 results = self._test_instance.ParseGTestOutput(output) | 316 results = self._test_instance.ParseGTestOutput(output) |
| 314 return results | 317 return results |
| 315 | 318 |
| 316 #override | 319 #override |
| 317 def TearDown(self): | 320 def TearDown(self): |
| 318 @local_device_test_run.handle_shard_failures | 321 @local_device_test_run.handle_shard_failures |
| 319 def individual_device_tear_down(dev): | 322 def individual_device_tear_down(dev): |
| 320 for s in self._servers.get(str(dev), []): | 323 for s in self._servers.get(str(dev), []): |
| 321 s.TearDown() | 324 s.TearDown() |
| 322 | 325 |
| 323 tool = self.GetTool(dev) | 326 tool = self.GetTool(dev) |
| 324 tool.CleanUpEnvironment() | 327 tool.CleanUpEnvironment() |
| 325 | 328 |
| 326 self._env.parallel_devices.pMap(individual_device_tear_down) | 329 self._env.parallel_devices.pMap(individual_device_tear_down) |
| OLD | NEW |