Changes between Initial Version and Version 1 of Writing testharness Tests


Ignore:
Timestamp:
May 31, 2012, 10:51:49 AM (13 years ago)
Author:
jacobg@adobe.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing testharness Tests

    v1 v1  
     1
     2== Writing JavaScript-based DOM only tests using testharness ==
     3
     4When writing test cases that only test the DOM it is preferable to use an .html file since it only requires one test file instead of two.
     5
     6Two JavaScript frameworks exist in the WebKit repository:
     7 * js-test-pre.js and js-test-post.js (WebKit only)
     8 * [http://trac.webkit.org/browser/trunk/LayoutTests/resources/testharness.js LayoutTests/resources/testharness.js] and [http://trac.webkit.org/browser/trunk/LayoutTests/resources/testharnessreport.js LayoutTests/resources/testharnessreport.js] (Webkit and W3C)
     9
     10The two frameworks contain similar (but not necessarily identical) sets of functionalities for making common test assertions, using unique APIs. 
     11
     12When possible, testharness.js / testharnessreport.js are preferable as this framework is also available in the W3C Test repository, making tests written using this API fully portable to W3C. 
     13
     14Documentation on how to use testharness.js is provided in the comment section at the beginning of the file itself.  testharnessreport.js customizes the output of testharness.js to make it compatible with the WebKit test infrastructure (specifically, the HTML formatting is removed and test results are output as plain text).