Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2043803003: 👔 Reland #2: Move side-loaded test data /sdcard -> /sdcard/gtestdata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase atop https://codereview.chromium.org/2041723006 Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 27ad38dadf7bfdfbc4c2b427ef7cabe7410df3f6..d5426bc3e66d52eddf8b6e595e102d5aa0550782 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
@@ -4,6 +4,7 @@
import logging
import os
+import posixpath
import re
import time
@@ -58,11 +59,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 posixpath.join(p if p else device_root for p in d)
else:
return d
@@ -106,14 +107,19 @@ class LocalDeviceInstrumentationTestRun(
check_return=True)
def push_test_data():
- external_storage = dev.GetExternalStoragePath()
+ device_root = posixpath.join(dev.GetExternalStoragePath(),
+ 'chromium_tests_root')
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], check_return=True)
+ dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
def create_flag_changer():
if self._test_instance.flags:

Powered by Google App Engine
This is Rietveld 408576698