Re: Some testharness.js comments

(adding some known users of testharness.js)

On 03/21/2011 04:51 PM, Philippe Le Hegaret wrote:
> While I was at it, I wrote a test involving all the existing assertions.
> Depending on which browser you use, the results differ and a few
> assertions are failing improperly as well (except for assert_unreached).
>
> I attached the file for you to look at it.
>
> I'm thinking we'll need some tests for the testharness.js itself.

Agreed. The apisample.htm document is supposed to do this to some 
extent, but it is not perfect.

One thing that is clear is that assert_exists and assert_inherits are 
confusing. The general ideal is that the assertions should test what 
WebIDL requires. For properties I think it requires that they exist on 
the prototype of the interface object and so are inherited into 
instances of that interface via the prototype chain i.e. 
document.hasOwnProperty("createElement") should be false but 
"createElement" in document would be true. In light of this, I wonder if 
assert_exists should be renamed assert_own_property or something, and a 
higher level function like assert_attribute_exists (name up for 
bikeshedding) added for checking the attribute is implemented according 
to the WebIDL requirements.

This seems like quite a safe change in the HTML repository. I don't know 
the situation for other users of testharness.js.

Received on Tuesday, 22 March 2011 13:59:05 UTC