[Webkit-unassigned] [Bug 71968] Implement URL API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 20 23:24:12 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=71968





--- Comment #20 from Kaustubh Atrawalkar <kaustubh at motorola.com>  2011-11-20 23:24:11 PST ---
(In reply to comment #18)
> (From update of attachment 115780 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115780&action=review
> 
> Can you add tests that ensures that:
> 
> webkitURL instancof Function
> 
> new webkitURL(...) instanceof webkitURL
> 
> webkitURL.createObjectURL instanceof function
> 
> new webkitURL(...).createObjectURL === undefined
> new webkitURL(...).revokeObjectURL === undefined
> 
> webkitURL.prototype.getParameter instanceof Function
> new webkitURL(...).hasOwnProperty('getParameter') === false
> 
> etc
> 

Surely, I will add them all.

> > Source/WebCore/html/DOMURL.idl:30
> >          Conditional=BLOB,
> 
> The conditional should be moved to createObjectURL and revokeObjectURL
>

Yes as the blob conditional is only applicable to these two methods now.

> > Source/WebCore/html/DOMURL.idl:56
> >          [ConvertNullStringTo=Undefined] DOMString createObjectURL(in MediaStream stream);
> 
> This and revokeObjectURL are class (static) methods.
> 
> > LayoutTests/fast/dom/DOMURL/get-domurl-attribute-port.html:1
> > +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
> 
> Don't use script-tests. It just doubles the number of files in the repo.
> 
> http://trac.webkit.org/wiki/Writing%20Layout%20Tests%20for%20DumpRenderTree#WritingJavaScript-basedDOM-onlyTestCases
> 
> <!DOCTYPE html>
> <script src="../../js/resources/js-test-pre.js"></script>
> <script>
> 
> // your tests go here
> 
> </script>
> <script src="../../js/resources/js-test-post.js"></script>
> 

No worries. I will change them all.

> > LayoutTests/fast/dom/DOMURL/script-tests/get-domurl-attribute-port.js:3
> > +var domurl = document.createElement("DOMURL");
> 
> What? This is not an element. Can you add an assert that this does NOT work?
> 
> The correct usage of this should be:
> 
> var url = new webkitURL(urlString, baseUrlString);
> 

Opps. Sorry for that. Think i did some foolish mistake there.

> > LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-hash.js:8
> > +debug("Hash value does not start with '#'");
> > +domurl.href = "https://www.mydomain.com:8080/path/testurl.html#middle";
> > +domurl.hash = "hash-value";
> > +shouldBe("domurl.href", "'https://www.mydomain.com:8080/path/testurl.html#hash-value'");
> 
> This is also wrong. The constructor should not have any properties except for the two "static" methods, createObjectURL and revokeObjectURL.
> 
> var url = new URL('http://www.example.com/#hash-value');
> shouldBeEqualToString('url.hash', 'hash-value');
>

Right. I will change them all.

> Can you add tests that asserts that the constructor has the right static methods and that the instance has the expected properties and methods?
> 
> > LayoutTests/fast/dom/DOMURL/script-tests/set-domurl-attribute-host.js:17
> > +try {
> > +domurl.href = "https://www.mydomain.com:8080/path/?key=value";
> > +domurl.host = "www.other?domain.com:8080";
> > +shouldBe("domurl.href", "'https://www.other/?domain.com:8080/path/?key=value'");
> > +} catch(e) {
> > +debug("Exception: " + e.description);
> > +}
> 
> Use shouldThrow()

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list