diff options
author | Steve Block <steveblock@google.com> | 2010-08-26 15:43:21 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-08-26 17:04:52 +0100 |
commit | 5a45899b92b919e9315351e9e19a8507a9f871b7 (patch) | |
tree | e51829ea6b577605d58083b58e7d15dda57ac242 /WebKitTools/DumpRenderTree | |
parent | 7ad9a34a5be0eaf1ae3fb7c844e3dc3b8b0652b6 (diff) | |
download | external_webkit-5a45899b92b919e9315351e9e19a8507a9f871b7.zip external_webkit-5a45899b92b919e9315351e9e19a8507a9f871b7.tar.gz external_webkit-5a45899b92b919e9315351e9e19a8507a9f871b7.tar.bz2 |
Update get_layout_tests_dir_contents.php to account for new server document root
See https://android-git.corp.google.com/g/#change,63194 which updates apach2.py
to serve HTTP tests at server root
Bug: 2951727
Change-Id: I4a5777d71843c1c2fdcd74a69b13e3c4750a45a0
Diffstat (limited to 'WebKitTools/DumpRenderTree')
-rw-r--r-- | WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php b/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php index 09f6b35..28a1a8a 100644 --- a/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php +++ b/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php @@ -26,11 +26,8 @@ # MODE = [folders|files] (defaults to files) - if 'folders' then lists only folders, # if 'files' then only files - #Global variables - $rootDir = - dirname($_SERVER['DOCUMENT_ROOT']) . DIRECTORY_SEPARATOR . - basename($_SERVER['DOCUMENT_ROOT']) . DIRECTORY_SEPARATOR . - "LayoutTests"; + # The server document root is LayoutTests/http/tests. See run_apache2.py. + $rootDir = realpath($_SERVER['DOCUMENT_ROOT'] . '..' . DIRECTORY_SEPARATOR . '..'); function getAbsolutePath($relPath) { global $rootDir; @@ -46,8 +43,6 @@ } function getAllFilesUnderAsArray($relPath, $recurse, $mode) { - global $exclude; - global $rootDir; $files = getFilesAsArray($relPath); $result = array(); @@ -95,17 +90,17 @@ $mode = 'files'; } - #Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute + # Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute if (strpos($_GET['path'], "..") !== False || substr($_GET['path'], 0, 1) == DIRECTORY_SEPARATOR) { return; } - #If we don't want realpath to append any prefixes we need to pass it an absolute path + # If we don't want realpath to append any prefixes we need to pass it an absolute path $path = realpath(getAbsolutePath($_GET['path'])); $relPath = substr($path, strlen($rootDir) + 1); - #If there is an error of some sort it will be output as a part of the answer! + # If there is an error of some sort it will be output as a part of the answer! foreach (getAllFilesUnderAsArray($relPath, $recurse, $mode) as $i => $value) { echo "$value$separator"; } |