Unreverts revert: Makes it possible to find files used by some unit tests when running them as Chrome native tests.

TBR=andrew@webrtc.org

BUG=N/A

Review URL: https://webrtc-codereview.appspot.com/1754005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4303 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org
2013-07-08 14:55:23 +00:00
parent 1932fe1865
commit 34773d9b6b
5 changed files with 79 additions and 33 deletions

View File

@ -23,6 +23,7 @@ REMOTE_URL_BASE = 'http://commondatastorage.googleapis.com/webrtc-resources'
VERSION_FILENAME = 'webrtc-resources-version'
FILENAME_PREFIX = 'webrtc-resources-'
EXTENSION = '.tgz'
RELATIVE_OUTPUT_PATH = '../../'
def main():
@ -41,14 +42,6 @@ def main():
print 'Skipping resources download since WEBRTC_SKIP_RESOURCES_DOWNLOAD set'
return
project_root_dir = os.path.normpath(sys.path[0] + '/../../')
downloads_dir = os.path.join(project_root_dir, 'resources')
current_version_file = os.path.join(downloads_dir, VERSION_FILENAME)
# Ensure the downloads dir is created.
if not os.path.isdir(downloads_dir):
os.mkdir(downloads_dir)
# Define and parse arguments.
parser = OptionParser()
parser.add_option('-f', '--force', action='store_true', dest='force',
@ -56,7 +49,17 @@ def main():
parser.add_option('-b', '--base_url', dest='base_url',
help= 'Overrides the default Base URL (%s) and uses the '
'supplied URL instead.' % REMOTE_URL_BASE)
(options, unused_args) = parser.parse_args()
parser.add_option('-p', dest='path', help= 'path of resources directory'
'relative to this script', default=RELATIVE_OUTPUT_PATH)
options = parser.parse_args()[0]
project_root_dir = os.path.normpath(sys.path[0] + '/' + options.path)
downloads_dir = os.path.join(project_root_dir, 'resources')
current_version_file = os.path.join(downloads_dir, VERSION_FILENAME)
# Ensure the downloads dir is created.
if not os.path.isdir(downloads_dir):
os.mkdir(downloads_dir)
# Download archive if forced or DEPS version is different than our current.
current_version = _get_current_version(current_version_file)