Chromium Code Reviews| Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| index fd7cfbbad34d80352cac2630712f3eeeac0e139f..0f8bff80895a42b32ac74f47d2b7e765470fd1e4 100644 |
| --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py |
| @@ -3,6 +3,7 @@ |
| # found in the LICENSE file. |
| import logging |
| +import posixpath |
| import re |
| import time |
| @@ -57,11 +58,11 @@ class LocalDeviceInstrumentationTestRun( |
| return self._test_instance.suite |
| def SetUp(self): |
| - def substitute_external_storage(d, external_storage): |
| + def substitute_device_root(d, device_root): |
| if not d: |
| - return external_storage |
| + return device_root |
| elif isinstance(d, list): |
| - return '/'.join(p if p else external_storage for p in d) |
| + return '/'.join(p if p else device_root for p in d) |
| else: |
| return d |
| @@ -105,14 +106,17 @@ class LocalDeviceInstrumentationTestRun( |
| check_return=True) |
| def push_test_data(): |
| - external_storage = dev.GetExternalStoragePath() |
| + device_root = posixpath.join(dev.GetExternalStoragePath(), 'gtestdata') |
| host_device_tuples_substituted = [ |
| - (h, substitute_external_storage(d, external_storage)) |
| + (h, substitute_device_root(d, device_root)) |
| for h, d in host_device_tuples] |
| logging.info('instrumentation data deps:') |
| for h, d in host_device_tuples_substituted: |
| logging.info('%r -> %r', h, d) |
| - dev.PushChangedFiles(host_device_tuples_substituted) |
| + dev.PushChangedFiles(host_device_tuples_substituted, |
| + delete_device_stale=True) |
| + if not host_device_tuples_substituted: |
| + dev.RunShellCommand('r=%s;rm -rf $r;mkdir -p $r' % device_root) |
|
jbudorick
2016/04/27 19:59:01
ditto
|
| def create_flag_changer(): |
| if self._test_instance.flags: |