Bug 70944

Summary: [Meta] Simplify JS Test Harness
Product: WebKit Reporter: Erik Arvidsson <arv>
Component: Tools / TestsAssignee: 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
Reported 2011-10-26 10:58:45 PDT
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
Erik Arvidsson
Comment 1 2011-10-26 11:01:27 PDT
I forgot to mention * Remove #console and #description elements
Alexey Proskuryakov
Comment 2 2011-10-26 11:38:54 PDT
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
Comment 3 2011-10-26 11:55:09 PDT
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
Comment 4 2011-10-26 12:11:19 PDT
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
Comment 5 2011-11-11 15:52:07 PST
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.
Note You need to log in before you can comment on or make changes to this bug.