This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 11321 - Scripted automated tests should be easier to write
Summary: Scripted automated tests should be easier to write
Status: NEW
Alias: None
Product: Testing
Classification: Unclassified
Component: testharness.js (show other bugs)
Version: unspecified
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: James Graham
QA Contact: James Graham
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 13:52 UTC by Henri Sivonen
Modified: 2012-05-08 06:26 UTC (History)
5 users (show)

See Also:


Attachments

Description Henri Sivonen 2010-11-15 13:52:01 UTC
Mozilla uses a scripted test system where the lifecycle of a test file load is basically:
 1) Before onload fires, the test calls SimpleTest.waitForExplicitFinish() to counter an unfortunate default that assumes that the test is done when onload fires.
 2) The test calls assertion functions an arbitrary numbers of times. The assertion functions have nice short names like ok(bool, "message") or is(value1, value2, "message").
 3) The test signals that it is done by calling SimpleTest.finish()

The HTML WG test harness requires much more boilerplate.

Please make it so the test writer only needs to call nice simple methods like ok() and is() and then call something like finish() when the test is done without wrappers like test(), async_test() or step().

It would be acceptable to have to call an initialization method like SimpleTest.waitForExplicitFinish(), but it would be even nicer not to have to do that.
Comment 1 Aryeh Gregor 2012-05-08 06:26:51 UTC
I don't think we need this anymore -- we now wrap testharness.js tests nicely enough.  <https://bugzilla.mozilla.org/show_bug.cgi?id=647323>