Bug 70784 - JS Test Harness: Make successfullyParsed optional
Summary: JS Test Harness: Make successfullyParsed optional
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks: 70944
  Show dependency treegraph
 
Reported: 2011-10-24 17:02 PDT by Erik Arvidsson
Modified: 2011-10-26 10:59 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.04 MB, patch)
2011-10-24 17:24 PDT, Erik Arvidsson
ojan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2011-10-24 17:02:40 PDT
JS Test Harness: Make successfullyParsed optional
Comment 1 Erik Arvidsson 2011-10-24 17:24:16 PDT
Created attachment 112284 [details]
Patch
Comment 2 Ojan Vafai 2011-10-24 19:00:11 PDT
Comment on attachment 112284 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=112284&action=review

This is awesome!

> LayoutTests/fast/js/kde/garbage-n.html:13
> +shouldBeTrue("hadSyntaxError");
> +hadSyntaxError = false;

As discussed in person, js-test-pre should just have a function like the following that is called instead so that hadSyntaxError can be private and so that people don't have to understand the guts of js-test-pre as much.

function shouldHaveHadSyntaxError()
{
    shouldBeTrue("hadSyntaxError");
    hadSyntaxError = false;
}

I'm fine with having a FIXME in js-test-pre and doing it in a followup cleanup patch.

> LayoutTests/fast/js/resources/js-test-post-async.js:2
> +  successfullyParsed = true;

needs 4 space indent

> LayoutTests/fast/js/resources/js-test-pre.js:393
> +    // FIXME: Remove

A little more detail would be nice. "Remove once ...".

> LayoutTests/fast/multicol/column-span-parent-continuation-crash.html:13
> +        layoutTestController.waitUntilDone();

this is indented too far now.

> LayoutTests/java/lc3/Constructors/construct-001-expected.txt:5
>  
> -FAIL successfullyParsed should be true. Threw exception ReferenceError: Can't find variable: successfullyParsed
> +PASS successfullyParsed is true
>  

Can you add to the ChangeLog description why this new result is correct?
Comment 3 Alexey Proskuryakov 2011-10-25 13:49:47 PDT
One good thing about our tests is that they can generally run in any browser. It's very important to compare behavior, and it's sometimes helpful to send a trac.webkit.org link to another browser's developer to illustrate a point.

Can relying on window.onerror make this less reliable?

Also, when changing JS tests, please also change make-new-script-test script.
Comment 4 Erik Arvidsson 2011-10-25 15:21:38 PDT
(In reply to comment #3)
> One good thing about our tests is that they can generally run in any browser. It's very important to compare behavior, and it's sometimes helpful to send a trac.webkit.org link to another browser's developer to illustrate a point.

Understood. WebKit was one of the last browser to get support for window.onerror so this should not be an issue unless we want to ensure this works in old versions of Opera?

> Can relying on window.onerror make this less reliable?

No, it should make things more reliable if anything. It will capture errors in all script tags, whereas "successfullyParsed = true" would only apply to the script tag that had the assignment expression statement in it.

> Also, when changing JS tests, please also change make-new-script-test script.

Thanks for the pointer. I've updated the script.
Comment 5 Alexey Proskuryakov 2011-10-25 15:38:22 PDT
> WebKit was one of the last browser to get support for window.onerror so this should not be an issue

Thank you, sounds good to me.
Comment 6 Erik Arvidsson 2011-10-25 16:10:40 PDT
Committed r98407: <http://trac.webkit.org/changeset/98407>
Comment 9 Ryosuke Niwa 2011-10-25 23:55:33 PDT
Rebaselined in http://trac.webkit.org/changeset/98436 for now since the diff didn't look wrong.