Bug 15754 - webarchive layout tests fail when WebKit directory path contains symlinks
Summary: webarchive layout tests fail when WebKit directory path contains symlinks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-29 11:56 PDT by Anders Carlsson
Modified: 2008-02-29 10:22 PST (History)
1 user (show)

See Also:


Attachments
Patch v1 (5.43 KB, patch)
2008-02-27 18:25 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (5.43 KB, patch)
2008-02-29 07:33 PST, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2007-10-29 11:56:00 PDT
The diffs all look like:

--- /tmp/layout-test-results/webarchive/archive-empty-frame-dom-expected.txt	2007-10-29 11:55:19.000000000 -0700
+++ /tmp/layout-test-results/webarchive/archive-empty-frame-dom-actual.txt	2007-10-29 11:55:19.000000000 -0700
@@ -29,7 +29,7 @@
 		<key>WebResourceTextEncodingName</key>
 		<string>UTF-8</string>
 		<key>WebResourceURL</key>
-		<string>file:///LayoutTests/webarchive/archive-empty-frame-dom.html</string>
+		<string>file:///Users/andersca/WebKit/OpenSource/LayoutTests/webarchive/archive-empty-frame-dom.html</string>
 	</dict>
 	<key>WebSubframeArchives</key>
 	<array>

Running run-webkit-tests from elsewhere works fine.
Comment 1 David Kilzer (:ddkilzer) 2007-10-29 21:38:32 PDT
There is code in WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm that attempts to normalize the directories embedded in .webarchive files to make the test results repeatable.  Apparently, it is not working as expected in this case.

It would be interesting to see what cwdURL in serializeWebArchiveToXML(WebArchive*) is in cases where it works and where it doesn't.

Comment 2 David Kilzer (:ddkilzer) 2008-02-27 15:43:51 PST
Anders' ~/WebKit directory is a symlink to a directory on /Volumes.  So the code in DRT to remove directory paths probably isn't resolving the symlink when it should (or is resolving the symlink when it should not).

Comment 3 David Kilzer (:ddkilzer) 2008-02-27 18:25:11 PST
Created attachment 19422 [details]
Patch v1

Proposed fix.
Comment 4 Geoffrey Garen 2008-02-28 11:58:51 PST
This patch looks OK to me, but I don't think it will fix the whole problem: there are a few webarchive tests that are not located in LayoutTests/webarchive. For example, there are svg webarchive tests.
Comment 5 David Kilzer (:ddkilzer) 2008-02-29 07:33:21 PST
Created attachment 19447 [details]
Patch v2

(In reply to comment #4)
> This patch looks OK to me, but I don't think it will fix the whole problem:
> there are a few webarchive tests that are not located in
> LayoutTests/webarchive. For example, there are svg webarchive tests.

Thanks for catching this.  I fixed this by searching backwards in the URL for "/LayoutTests/" instead of searching forward for "/LayoutTests/webarchive/".  Assuming we never create any subdirectories named "LayoutTests" under "LayoutTests" with webarchive tests in them, this will just work!

I also ran all of the layout tests this time.  The SVG tests did fail with the previous patch.  They all pass now with this patch, as do LayoutTests/webarchive.

Sorry it took so long to fix this.
Comment 6 Darin Adler 2008-02-29 09:54:15 PST
Comment on attachment 19447 [details]
Patch v2

r=me
Comment 7 David Kilzer (:ddkilzer) 2008-02-29 10:22:59 PST
Committed revision 30666.