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

Unified Diff: build/android/pylib/run_java_tests.py

Issue 10933011: [Android] Add support for layering device-located test files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698