21 | | Test cases which only test the DOM can be written as .js files instead of .html files. |
22 | | * Write a .js file and place it in a `script-tests/` subdirectory. |
23 | | * Add a `TEMPLATE.html` file to the same `script-tests/` subdirectory, fixing the paths to point to `fast/js/resources/js-test*`. |
24 | | * Run `make-script-test-wrappers`. An example: |
25 | | {{{ |
26 | | $ make-script-test-wrappers LayoutTests/fast/dom/script-tests/my-new-test.js |
27 | | }}} |
| 21 | |
| 22 | When writing test cases that only test the DOM it is still preferred to use an .html file since it only requires one test file instead of two. |
| 23 | |
| 24 | When writing these tests it is often useful to include [http://trac.webkit.org/browser/trunk/LayoutTests/fast/js/resources/js-test-pre.js LayoutTests/fast/js/resources/js-test-pre.js] and [http://trac.webkit.org/browser/trunk/LayoutTests/fast/js/resources/js-test-post.js LayoutTests/fast/js/resources/js-test-post.js]. To get these to work you need to have an element with id `description` and another element with the id `console`. |