Changeset 69065 in webkit
- Timestamp:
- Oct 4, 2010 9:19:16 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r69050 r69065 1 2010-10-04 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 aroben's change in r68792 actually broke new-run-webkit-tests when 6 running the DRT code path. His change was intended to fix the 7 way we were converting windows paths to URIs when running under 8 Cygwin (the paths were getting one too many "/" on the front). 9 However, the change ended up breaking the chromium_win port, which 10 had slightly different logic. 11 12 This patch removes the port-specific code and adds tests to make 13 sure we're getting the behavior we expect. The Port object no longer 14 exposes a get_absolute_path() method that can be used outside of 15 of converting test filenames, because it's unreliable otherwise 16 (we don't have the right context to know which conversion is intended). 17 18 https://bugs.webkit.org/show_bug.cgi?id=47140 19 20 * Scripts/webkitpy/layout_tests/port/base.py: 21 * Scripts/webkitpy/layout_tests/port/base_unittest.py: 22 * Scripts/webkitpy/layout_tests/port/chromium_win.py: 23 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 24 * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py: 25 1 26 2010-10-04 Dirk Pranke <dpranke@chromium.org> 2 27 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
r68914 r69065 282 282 283 283 def filename_to_uri(self, filename): 284 """Convert a test file to a URI."""284 """Convert a test file (which is an absolute path) to a URI.""" 285 285 LAYOUTTEST_HTTP_DIR = "http/tests/" 286 286 LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/" … … 308 308 return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path) 309 309 310 if sys.platform is 'win32': 311 return "file:///" + self.get_absolute_path(filename) 312 return "file://" + self.get_absolute_path(filename) 310 abspath = os.path.abspath(filename) 311 312 # On Windows, absolute paths are of the form "c:\foo.txt". However, 313 # all current browsers (except for Opera) normalize file URLs by 314 # prepending an additional "/" as if the absolute path was 315 # "/c:/foo.txt". This means that all file URLs end up with "file:///" 316 # at the beginning. 317 if sys.platform == 'win32': 318 abspath = '/' + abspath.replace('\\', '/') 319 320 return "file://" + abspath 313 321 314 322 def tests(self, paths): … … 378 386 379 387 raise NotImplementedError('unknown url type: %s' % uri) 380 381 def get_absolute_path(self, filename):382 """Return the absolute path in unix format for the given filename.383 384 This routine exists so that platforms that don't use unix filenames385 can convert accordingly."""386 return os.path.abspath(filename)387 388 388 389 def layout_tests_dir(self): -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
r68365 r69065 227 227 self.assertTrue('css2.1' in dirs) 228 228 229 def test_filename_to_uri(self): 230 231 port = base.Port() 232 layout_test_dir = port.layout_tests_dir() 233 test_file = os.path.join(layout_test_dir, "foo", "bar.html") 234 235 # On Windows, absolute paths are of the form "c:\foo.txt". However, 236 # all current browsers (except for Opera) normalize file URLs by 237 # prepending an additional "/" as if the absolute path was 238 # "/c:/foo.txt". This means that all file URLs end up with "file:///" 239 # at the beginning. 240 if sys.platform == 'win32': 241 prefix = "file:///" 242 path = test_file.replace("\\", "/") 243 else: 244 prefix = "file://" 245 path = test_file 246 247 self.assertEqual(port.filename_to_uri(test_file), 248 prefix + path) 249 250 251 229 252 class VirtualTest(unittest.TestCase): 230 253 """Tests that various methods expected to be virtual are.""" -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
r68009 r69065 84 84 'build-instructions-windows') 85 85 return result 86 87 def get_absolute_path(self, filename):88 """Return the absolute path in unix format for the given filename."""89 abspath = os.path.abspath(filename)90 return abspath.replace('\\', '/')91 86 92 87 def relative_test_filename(self, filename): -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r68903 r69065 1440 1440 options.use_apache = sys.platform in ('darwin', 'linux2') 1441 1441 1442 if options.results_directory.startswith("/"): 1443 # Assume it's an absolute path and normalize. 1444 options.results_directory = port_obj.get_absolute_path( 1445 options.results_directory) 1446 else: 1447 # If it's a relative path, make the output directory relative to 1448 # Debug or Release. 1442 if not os.path.isabs(options.results_directory): 1443 # This normalizes the path to the build dir. 1444 # FIXME: how this happens is not at all obvious; this is a dumb 1445 # interface and should be cleaned up. 1449 1446 options.results_directory = port_obj.results_directory() 1450 1447 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
r68914 r69065 234 234 self.assertEqual(user.url, '/tmp/layout-test-results/results.html') 235 235 236 def test_results_directory_absolute(self): 237 # We run a configuration that should fail, to generate output, then 238 # look for what the output results url was. 239 240 res, out, err, user = logging_run(['--results-directory=/tmp-results'], 241 tests_included=True) 242 self.assertEqual(user.url, '/tmp-results/results.html') 243 244 def test_results_directory_default(self): 245 # We run a configuration that should fail, to generate output, then 246 # look for what the output results url was. 247 248 # This is the default location. 249 res, out, err, user = logging_run(tests_included=True) 250 self.assertEqual(user.url, '/tmp/layout-test-results/results.html') 251 252 def test_results_directory_relative(self): 253 # We run a configuration that should fail, to generate output, then 254 # look for what the output results url was. 255 256 res, out, err, user = logging_run(['--results-directory=foo'], 257 tests_included=True) 258 self.assertEqual(user.url, '/tmp/foo/results.html') 259 260 236 261 237 262 def _mocked_open(original_open, file_list):
Note: See TracChangeset
for help on using the changeset viewer.