The test webarchive/loading/test-loading-archive-subresource-null-mimetype.html introduce the first case where a subresource is loaded from outside the test directory. The file in question file:///test.png causes the method to raise a NSRangeException. This is hidden by the fact that OS X WebKit catch any exceptions when calling the delegate.
Created attachment 113266 [details] Patch
Comment on attachment 113266 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113266&action=review > LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt:12 > +file:///test.png - didReceiveResponse <NSURLResponse file:///Users/pecoraro/Desktop/test.png, http status code 0> That's not good. It has the patch of a user’s home directory!
Comment on attachment 113266 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113266&action=review >> LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype-expected.txt:12 >> +file:///test.png - didReceiveResponse <NSURLResponse file:///Users/pecoraro/Desktop/test.png, http status code 0> > > That's not good. It has the patch of a user’s home directory! The path of a specific users’s home directory. We can}t have that in expected test results.
My user directly is definitely not /Users/pecoraro/ :) This the path of the source as encoded in the webarchive.
s/user directly/user directory
(In reply to comment #4) > This the path of the source as encoded in the webarchive. OK, makes sense. I looked in the web archive and couldn’t find that, but it was because it was in the Base64-encoded WebResourceResponse data.
Comment on attachment 113266 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113266&action=review > Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm:89 > + if ([[self path] hasPrefix:basePath]) { > + ASSERT([[self path] length] >= ([basePath length] + 1)); > + return [[self path] substringFromIndex:[basePath length] + 1]; > + } We could also write this code so that it appends a "/" to basePath first, then we would not need the assertion or the "+ 1".
(In reply to comment #4) > My user directly is definitely not /Users/pecoraro/ :) > > This the path of the source as encoded in the webarchive. Feel free to update the webarchive. I didn't know this data was inside it, otherwise I wouldn't have included it originally =(.
Comment on attachment 113266 [details] Patch Clearing flags on attachment: 113266 Committed r99031: <http://trac.webkit.org/changeset/99031>
All reviewed patches have been landed. Closing bug.