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..366eb0e23303515c98cfde05fb7254a1f51a9690 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) |
|
jbudorick
2016/05/18 14:23:38
nit: since you're here, this should be posixpath.j
agrieve
2016/05/19 02:11:53
Done.
|
| else: |
| return d |
| @@ -105,14 +106,19 @@ class LocalDeviceInstrumentationTestRun( |
| check_return=True) |
| def push_test_data(): |
| - external_storage = dev.GetExternalStoragePath() |
| + device_root = posixpath.join(dev.GetExternalStoragePath(), |
| + 'chromium_tests_root') |
|
jbudorick
2016/05/18 14:23:38
3 places :(
agrieve
2016/05/19 02:11:53
The entire pushing of .isolate data is duplicated.
|
| 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(['rm', '-rf', device_root]) |
|
jbudorick
2016/05/18 14:23:38
again, check_return=True
agrieve
2016/05/19 02:11:53
Done.
|
| + dev.RunShellCommand(['mkdir', '-p', device_root]) |
| def create_flag_changer(): |
| if self._test_instance.flags: |