Bug 48344 - using js-test-pre.js shouldn't require a script-tests wrapper
Summary: using js-test-pre.js shouldn't require a script-tests wrapper
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-26 10:56 PDT by Ojan Vafai
Modified: 2010-10-26 12:35 PDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ojan Vafai 2010-10-26 10:56:20 PDT
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 Eric Seidel (no email) 2010-10-26 10:59:48 PDT
CCing other folks involved in the inception of script-tests.
Comment 2 Eric Seidel (no email) 2010-10-26 11:00:11 PDT
Sounds sane to me.
Comment 3 Darin Adler 2010-10-26 11:04:47 PDT
(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 Ojan Vafai 2010-10-26 11:08:21 PDT
(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 Ryosuke Niwa 2010-10-26 12:35:28 PDT
(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.