WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
71342
[Mac] _drt_descriptionSuitableForTestResult generate an exception for absolute paths above the main frame
https://bugs.webkit.org/show_bug.cgi?id=71342
Summary
[Mac] _drt_descriptionSuitableForTestResult generate an exception for absolut...
Benjamin Poulain
Reported
2011-11-01 17:29:09 PDT
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.
Attachments
Patch
(4.22 KB, patch)
2011-11-01 17:41 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2011-11-01 17:41:17 PDT
Created
attachment 113266
[details]
Patch
Darin Adler
Comment 2
2011-11-01 17:48:30 PDT
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!
Darin Adler
Comment 3
2011-11-01 17:50:07 PDT
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.
Benjamin Poulain
Comment 4
2011-11-01 17:58:04 PDT
My user directly is definitely not /Users/pecoraro/ :) This the path of the source as encoded in the webarchive.
Benjamin Poulain
Comment 5
2011-11-01 17:58:37 PDT
s/user directly/user directory
Darin Adler
Comment 6
2011-11-01 18:24:08 PDT
(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.
Darin Adler
Comment 7
2011-11-01 18:26:53 PDT
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".
Joseph Pecoraro
Comment 8
2011-11-01 18:33:05 PDT
(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 =(.
WebKit Review Bot
Comment 9
2011-11-01 19:08:33 PDT
Comment on
attachment 113266
[details]
Patch Clearing flags on attachment: 113266 Committed
r99031
: <
http://trac.webkit.org/changeset/99031
>
WebKit Review Bot
Comment 10
2011-11-01 19:08:38 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug