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

Side by Side Diff: webkit/tools/layout_tests/layout_package/path_utils.py

Issue 201048: Support running tests under LayoutTests/http/tests/local as local file, in or... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """This package contains utility methods for manipulating paths and 5 """This package contains utility methods for manipulating paths and
6 filenames for test results and baselines. It also contains wrappers 6 filenames for test results and baselines. It also contains wrappers
7 of a few routines in platform_utils.py so that platform_utils.py can 7 of a few routines in platform_utils.py so that platform_utils.py can
8 be considered a 'protected' package - i.e., this file should be 8 be considered a 'protected' package - i.e., this file should be
9 the only file that ever includes platform_utils. This leads to 9 the only file that ever includes platform_utils. This leads to
10 us including a few things that don't really have anything to do 10 us including a few things that don't really have anything to do
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 relative_path = relative_path[len(LAYOUTTEST_HTTP_DIR):] 190 relative_path = relative_path[len(LAYOUTTEST_HTTP_DIR):]
191 port = 8000 191 port = 8000
192 # pending/http/tests/ run off port 9000 and ssl/ off 9443 192 # pending/http/tests/ run off port 9000 and ssl/ off 9443
193 elif relative_path.startswith(PENDING_HTTP_DIR): 193 elif relative_path.startswith(PENDING_HTTP_DIR):
194 relative_path = relative_path[len(PENDING_HTTP_DIR):] 194 relative_path = relative_path[len(PENDING_HTTP_DIR):]
195 port = 9000 195 port = 9000
196 # chrome/http/tests run off of port 8081 with the full path 196 # chrome/http/tests run off of port 8081 with the full path
197 elif relative_path.find("/http/") >= 0: 197 elif relative_path.find("/http/") >= 0:
198 port = 8081 198 port = 8081
199 199
200 if port: 200 # Make LayoutTests/http/tests/local run as local files. This is to mimic the
201 # logic in run-webkit-tests.
202 # TODO: Should we also extend this to media/?
ojan 2009/09/11 03:23:04 nit: TODO(jianli). Even if you don't intend to do
203 if port and not relative_path.startswith("local/"):
201 if relative_path.startswith("ssl/"): 204 if relative_path.startswith("ssl/"):
202 port += 443 205 port += 443
203 protocol = "https" 206 protocol = "https"
204 else: 207 else:
205 protocol = "http" 208 protocol = "http"
206 return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path) 209 return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path)
207 else: 210
208 return "file:///" + GetAbsolutePath(full_path) 211 return "file:///" + GetAbsolutePath(full_path)
209 212
210 def GetAbsolutePath(path): 213 def GetAbsolutePath(path):
211 """Returns an absolute UNIX path.""" 214 """Returns an absolute UNIX path."""
212 return _WinPathToUnix(os.path.abspath(path)) 215 return _WinPathToUnix(os.path.abspath(path))
213 216
214 def MaybeMakeDirectory(*path): 217 def MaybeMakeDirectory(*path):
215 """Creates the specified directory if it doesn't already exist.""" 218 """Creates the specified directory if it doesn't already exist."""
216 # This is a reimplementation of google.path_utils.MaybeMakeDirectory(). 219 # This is a reimplementation of google.path_utils.MaybeMakeDirectory().
217 try: 220 try:
218 os.makedirs(os.path.join(*path)) 221 os.makedirs(os.path.join(*path))
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 return platform_utils.ImageDiffPath(target) 279 return platform_utils.ImageDiffPath(target)
277 280
278 def LayoutTestHelperPath(target): 281 def LayoutTestHelperPath(target):
279 return platform_utils.LayoutTestHelperPath(target) 282 return platform_utils.LayoutTestHelperPath(target)
280 283
281 def FuzzyMatchPath(): 284 def FuzzyMatchPath():
282 return platform_utils.FuzzyMatchPath() 285 return platform_utils.FuzzyMatchPath()
283 286
284 def ShutDownHTTPServer(server_process): 287 def ShutDownHTTPServer(server_process):
285 return platform_utils.ShutDownHTTPServer(server_process) 288 return platform_utils.ShutDownHTTPServer(server_process)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698