Re: Test harness requirements

On 04/20/2010 05:48 PM, James Graham wrote:

> * Support for asynchronous tests; many DOM methods are asynchronous and
> therefore a reliable way of testing asynchronous behaviour e.g. that a
> given event is fired, is needed. This also implies that it must be
> possible to time out tests it they fail to produce a result.

Just to add a little here, I think this is the most difficult design 
requirement. Cases that may need to be covered (I'm sure there are many 
more):

* Event listener set by attribute fires

* Event listener set through DOM methods fires

* Properties of even in event listener are correct

* A certain event is fired as a consequence of some other code or some 
markup

* A certain set of events are fired in a specific order as a result of 
some other code or some markup

* A certain event fails to fire (subject to a timeout)

* A certain event fires exactly once (in some time period)

* A set of events fire within a certain interval

* Callback is fired in response to an operation

I'm not sure if it's OK just to test (some of) these things in an ad-hoc 
way but since asynchronous behaviour is an increasingly important part 
of the platform it would be nice if the framework covered at least 
common cases in a simple, reusable way.

Received on Tuesday, 4 May 2010 08:37:27 UTC