Bug 164064 - testharnessreport.js should sanitize the results before printing them
Summary: testharnessreport.js should sanitize the results before printing them
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-27 09:48 PDT by Chris Dumez
Modified: 2016-10-27 12:50 PDT (History)
7 users (show)

See Also:


Attachments
Patch (154.08 KB, patch)
2016-10-27 10:53 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-10-27 09:48:55 PDT
testharnessreport.js should sanitize the results before printing them. We currently have 3 copies of this script and only 1 does the sanitization.
Short term, let do the sanitization in all of them. Longer term, we should merge these and have a way to keep them in sync.
Comment 1 Chris Dumez 2016-10-27 10:53:23 PDT
Created attachment 293038 [details]
Patch
Comment 2 youenn fablet 2016-10-27 11:18:35 PDT
If it proves to be difficult to remove the testharness report.js copies, we could add checks.
We do that for testharness.js when running rwt.
In the case of test harness report.js, style checker could do it.
Comment 3 Darin Adler 2016-10-27 11:40:49 PDT
Comment on attachment 293038 [details]
Patch

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

Thanks so much for fixing this!

> LayoutTests/http/tests/w3c/resources/testharnessreport.js:56
> +            // Escape null characters, otherwise diff will think the file is binary.

This comment is not the reason this matters to us. Seems like a comment written by whoever made this change in Blink and so only mentions the reason that affects them.

> LayoutTests/http/tests/w3c/resources/testharnessreport.js:58
> +            // Escape carriage returns as they break rietveld's difftools.

This comment is even more Blink-specific. I don’t even know what “rietveld” is.
Comment 4 WebKit Commit Bot 2016-10-27 11:51:06 PDT
Comment on attachment 293038 [details]
Patch

Clearing flags on attachment: 293038

Committed r207995: <http://trac.webkit.org/changeset/207995>
Comment 5 WebKit Commit Bot 2016-10-27 11:51:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Chris Dumez 2016-10-27 12:00:55 PDT
(In reply to comment #3)
> Comment on attachment 293038 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=293038&action=review
> 
> Thanks so much for fixing this!
> 
> > LayoutTests/http/tests/w3c/resources/testharnessreport.js:56
> > +            // Escape null characters, otherwise diff will think the file is binary.
> 
> This comment is not the reason this matters to us. Seems like a comment
> written by whoever made this change in Blink and so only mentions the reason
> that affects them.
> 
> > LayoutTests/http/tests/w3c/resources/testharnessreport.js:58
> > +            // Escape carriage returns as they break rietveld's difftools.
> 
> This comment is even more Blink-specific. I don’t even know what “rietveld”
> is.

Sorry about this. I went quick and dirty. I am planning to sync-up all 3 scripts so they are identical in a follow-up when I have a little bit more time. I'll clean up the comments as well.