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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Nov 19 09:05:50 PST 2011


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





--- Comment #18 from Erik Arvidsson <arv at chromium.org>  2011-11-19 09:05:49 PST ---
(From update of attachment 115780)
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

> Source/WebCore/html/DOMURL.idl:30
>          Conditional=BLOB,

The conditional should be moved to createObjectURL and revokeObjectURL

> 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>

> 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);

> 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');

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