Index: build/android/pylib/run_java_tests.py |
diff --git a/build/android/pylib/run_java_tests.py b/build/android/pylib/run_java_tests.py |
index bef6d7a1de736e9c341632a91d45803917c810fb..3a98a5a507b54640db57c951d1d69ca67c2b7088 100644 |
--- a/build/android/pylib/run_java_tests.py |
+++ b/build/android/pylib/run_java_tests.py |
@@ -10,6 +10,7 @@ import os |
import re |
import shutil |
import sys |
+import tempfile |
import time |
import android_commands |
@@ -162,11 +163,24 @@ class TestRunner(BaseTestRunner): |
logging.warning('Already copied test files to device %s, skipping.', |
self.device) |
return |
- host_test_files_path = (constants.CHROME_DIR + |
- '/chrome/test/data/android/device_files') |
- if os.path.exists(host_test_files_path): |
- self.adb.PushIfNeeded(host_test_files_path, |
- TestRunner._DEVICE_DATA_DIR) |
+ host_test_files_paths = [ |
+ constants.CHROME_DIR + '/android_webview/test/data/device_files', |
+ constants.CHROME_DIR + '/content/test/data/android/device_files', |
+ constants.CHROME_DIR + '/chrome/test/data/android/device_files' |
+ ] |
+ try: |
+ temp_dir = tempfile.mkdtemp() |
+ for src_dir in host_test_files_paths: |
+ # shutil.copytree requires the destination directory not to exist, |
+ # thus it can't be used for directory merges. |
+ if os.path.exists(src_dir): |
+ cmd_helper.RunCmd(['cp', '-r', src_dir, temp_dir]) |
bulach
2012/09/11 10:35:06
hmm.. how many tests do we have versus how many fi
mnaganov (inactive)
2012/09/11 16:45:03
OK, changed to avoid merging -- looks simpler. Thi
|
+ temp_files_dir = os.path.join(temp_dir, 'device_files') |
+ if os.path.exists(temp_files_dir): |
+ self.adb.PushIfNeeded(temp_files_dir, |
+ TestRunner._DEVICE_DATA_DIR) |
+ finally: |
+ shutil.rmtree(temp_dir) |
if self.install_apk: |
for apk in self.apks: |
self.adb.ManagedInstall(apk.GetApkPath(), |