Bug 70944
Summary: | [Meta] Simplify JS Test Harness | ||
---|---|---|---|
Product: | WebKit | Reporter: | Erik Arvidsson <arv> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 69881, 70432, 70784, 70959, 71339, 71398, 71533 | ||
Bug Blocks: |
Erik Arvidsson
I'm currently in the process of simplifying the JS Test Harness. The end goal is to only have to include a single js file.
<script src="path/to/test.js"></script>
<script>
shouldBeTrue('true');
</script>
Here are a few things that needs to be done
* Remove pre+post scripts. Today we have js-test-pre.js, js-test-post.js, js-test-post-async.js and js-test-function.js.
* Remove the need to manually set successfullyParsed to true
* Remove the link to include js-test-style.css
* Standardize/simplify async tests
Right now there are so many ad-hoc ways of doing tests which makes both writing and maintaing tests a real nightmare.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Erik Arvidsson
I forgot to mention
* Remove #console and #description elements
Alexey Proskuryakov
As discussed on webkit-dev a few weeks ago, I don't really think that making the harness more dynamic and complicated for the sake of reducing boilerplate helps much.
One will still most likely use make-new-script-test script or copy/paste, but there are now more points of failure for the engine, and more invisible things to keep in mind when writing tests.
That's only a personal opinion/vote, and doesn't seem like something that can be meaningfully discussed.
Erik Arvidsson
One of the main problems (IMO) is that having a boiler plate leaves too much room for ad-hoc testing. By making it simpler to do the right thing I believe that we will get less ad hoc tests which leads to better maintainability.
Ojan Vafai
FWIW, even after the handful of cleanups Erik has done so far, I find writing tests much easier. Even without getting rid of js-test-post, I'm finding it tolerable to write them manually now.
Erik Arvidsson
Another strange thing is that the description element is a p element and we append a span with more p elements in it which is kind of silly. We should probably just make the description element a div.