They'd be much more useful if they weren't so heavy-weight. The most recent discussion on webkit-dev was that we should get rid of js-test-post.js (just do that onload) and have js-test-pre.js inject the CSS. Then JS tests would be something like: <!DocType html> <script src="../../fast/js/resources/js-test-pre.js"></script> <!-- YOUR HTML HERE --> <script> // YOUR SCRIPT HERE </script> No need for that wrapper script or the extra code.
CCing other folks involved in the inception of script-tests.
Sounds sane to me.
(In reply to comment #0) > They'd be much more useful if they weren't so heavy-weight. > > The most recent discussion on webkit-dev was that we should get rid of js-test-post.js (just do that onload) and have js-test-pre.js inject the CSS. Then JS tests would be something like: > <!DocType html> > <script src="../../fast/js/resources/js-test-pre.js"></script> > <!-- YOUR HTML HERE --> > <script> > // YOUR SCRIPT HERE > </script> > > No need for that wrapper script or the extra code. Getting rid of js-test-post.js would be a nice simplification if we can do it. I think you’re misunderstanding why we have the wrapper script, though. The original script-tests are JavaScript tests and many can run outside of WebKit entirely in a pure JavaScript mode. That’s why the script test is in a separate file, so that it can be run in a pure JavaScript testing environment. Maciej created the wrapper so we could run these pure JavaScript tests without changing our run-webkit-tests script at all and also easily run them in the browser without using the test script. If we get rid of the wrapper what we’ll lose is the ability to have pure JavaScript tests that run outside of WebKit. But we never did implement that.
(In reply to comment #3) > If we get rid of the wrapper what we’ll lose is the ability to have pure JavaScript tests that run outside of WebKit. But we never did implement that. Right. I should have phrased this differently. We should keep script-tests + the wrapper around for the purpose of legitimately pure JS tests. But we've been shoehorning DOM tests into script-tests in an effort to develop testing infrastructure.
(In reply to comment #3) > Maciej created the wrapper so we could run these pure JavaScript tests without changing our run-webkit-tests script at all and also easily run them in the browser without using the test script. +maciej. (In reply to comment #4) > (In reply to comment #3) > > If we get rid of the wrapper what we’ll lose is the ability to have pure JavaScript tests that run outside of WebKit. But we never did implement that. > > Right. I should have phrased this differently. We should keep script-tests + the wrapper around for the purpose of legitimately pure JS tests. But we've been shoehorning DOM tests into script-tests in an effort to develop testing infrastructure. It'll be nice if our infrastructure supported the both usage.