Bug 37496 - Add URL scheme parsing tests
Summary: Add URL scheme parsing tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 37641
  Show dependency treegraph
 
Reported: 2010-04-13 01:10 PDT by Adam Barth
Modified: 2010-04-15 01:07 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.67 KB, patch)
2010-04-13 01:13 PDT, Adam Barth
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Barth 2010-04-13 01:10:13 PDT
Add URL scheme parsing tests
Comment 1 Adam Barth 2010-04-13 01:13:23 PDT
Created attachment 53231 [details]
Patch
Comment 2 Alexey Proskuryakov 2010-04-13 15:43:35 PDT
Could it be correct behavior that " HTTP " is treated as a relative URL? Maybe it should never hit the "absolute URL" case, in fact?
Comment 3 Adam Barth 2010-04-14 08:24:36 PDT
> Could it be correct behavior that " HTTP " is treated as a relative URL? Maybe
> it should never hit the "absolute URL" case, in fact?

Yes, I believe that is the correct behavior.  However, it makes it tricky to test how we parse absolute URLs that begin in this way.
Comment 4 Alexey Proskuryakov 2010-04-14 08:34:10 PDT
That would mean testing a code path that should never be taken. It seems better to just test that this code path is never taken by verifying that such URLs are parsed as relative.
Comment 5 Adam Barth 2010-04-14 08:41:57 PDT
> That would mean testing a code path that should never be taken.

There might be another API that takes strings and parses them as absolute URLs, or if there isn't one today, we could well invent one tomorrow.

> It seems better
> to just test that this code path is never taken by verifying that such URLs are
> parsed as relative.

We can certainly test that if you like.  The intent of this test is to test the URL parser, not the HTMLAnchorElement.href API.  We're just using the href API as a convenient way to get at the URL parser.
Comment 6 Maciej Stachowiak 2010-04-15 00:56:44 PDT
Comment on attachment 53231 [details]
Patch

r=me
Comment 7 Adam Barth 2010-04-15 01:07:21 PDT
Committed r57635: <http://trac.webkit.org/changeset/57635>