Bug 48344 - using js-test-pre.js shouldn't require a script-tests wrapper
: using js-test-pre.js shouldn't require a script-tests wrapper
Status: NEW
: WebKit
Tools / Tests
: 528+ (Nightly build)
: PC Mac OS X 10.5
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2010-10-26 10:56 PST by
Modified: 2010-10-26 12:35 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-10-26 10:56:20 PST
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.
------- Comment #1 From 2010-10-26 10:59:48 PST -------
CCing other folks involved in the inception of script-tests.
------- Comment #2 From 2010-10-26 11:00:11 PST -------
Sounds sane to me.
------- Comment #3 From 2010-10-26 11:04:47 PST -------
(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.
------- Comment #4 From 2010-10-26 11:08:21 PST -------
(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.
------- Comment #5 From 2010-10-26 12:35:28 PST -------
(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.