WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
119583
[Win] URL printing code in DumpRenderTree doesn't match WTR or Mac DRT
https://bugs.webkit.org/show_bug.cgi?id=119583
Summary
[Win] URL printing code in DumpRenderTree doesn't match WTR or Mac DRT
Alexey Proskuryakov
Reported
2013-08-08 11:18:43 PDT
urlSuitableForTestResult() in DumpRenderTree/win/DumpRenderTree.cpp removes a prefix from url without checking whether the url actually has this prefix: -------------------------- RetainPtr<CFStringRef> basePath = adoptCF(CFURLCopyPath(baseURL.get())); RetainPtr<CFStringRef> path = adoptCF(CFURLCopyPath(url.get())); return cfStringRefToWString(substringFromIndex(path.get(), CFStringGetLength(basePath.get())).get()); -------------------------- When it doesn't match - or when base URL cannot be determined - we should print last path component.
Attachments
Patch
(1.67 KB, patch)
2013-08-16 10:01 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(2.19 KB, patch)
2013-08-16 10:04 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(3.24 KB, patch)
2013-08-16 10:40 PDT
,
Brent Fulgham
ap
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2013-08-16 09:37:47 PDT
Either WebKitTestRunner code or Mac DRT could probably serve as a good model to follow.
Brent Fulgham
Comment 2
2013-08-16 10:01:43 PDT
Created
attachment 208928
[details]
Patch
Brent Fulgham
Comment 3
2013-08-16 10:04:18 PDT
Created
attachment 208929
[details]
Patch
Alexey Proskuryakov
Comment 4
2013-08-16 10:14:18 PDT
Comment on
attachment 208929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=208929&action=review
There are more instances of "return urlString;" above the changed code, all except the very first one should be changed to return the last path component. We never want a full file:// path!
> Tools/DumpRenderTree/win/DumpRenderTree.cpp:172 > + if (path.get() && CFStringHasPrefix(path.get(), basePath.get()))
This null check should be for basePath, not for path.
Brent Fulgham
Comment 5
2013-08-16 10:15:16 PDT
Comment on
attachment 208929
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=208929&action=review
>> Tools/DumpRenderTree/win/DumpRenderTree.cpp:172 >> + if (path.get() && CFStringHasPrefix(path.get(), basePath.get())) > > This null check should be for basePath, not for path.
Oops!
Brent Fulgham
Comment 6
2013-08-16 10:40:29 PDT
Created
attachment 208931
[details]
Patch
Alexey Proskuryakov
Comment 7
2013-08-16 10:52:09 PDT
Comment on
attachment 208931
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=208931&action=review
Great, thank you for tackling this!
> Tools/DumpRenderTree/win/DumpRenderTree.cpp:144 > +static wstring fallbackString(CFURLRef url)
I'd name this function after what it does - in this case, it seems more straightforward than naming it by what it is used for. What about lastPathComponent() as the name?
Alexey Proskuryakov
Comment 8
2013-08-16 10:52:49 PDT
Or something like lastPathComponentAsWString().
Brent Fulgham
Comment 9
2013-08-16 10:54:11 PDT
(In reply to
comment #8
)
> Or something like lastPathComponentAsWString().
That's a good idea. I'll change it while landing.
Brent Fulgham
Comment 10
2013-08-16 11:05:01 PDT
Committed
r154194
: <
http://trac.webkit.org/changeset/154194
>
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