Bug 95098

Summary: [Chromium] DRT does not support --dump-all-pixels flag
Product: WebKit Reporter: Stephen Chenney <schenney>
Component: Tools / TestsAssignee: Stephen Chenney <schenney>
Status: RESOLVED FIXED    
Severity: Normal CC: dpranke, eric, kbalazs, rniwa, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch dpranke: review+

Description Stephen Chenney 2012-08-27 10:11:13 PDT
I'm trying to debug a paint crash using DumpRenderTree in a debugger with a simple command line for debugging:
DumpRenderTree --no-timeout --dump-all-pixels [testname]

But no pixel tests are dumped so no crash. It turns out we don't support --dump-all-pixels so the only way to get pixel results inside the debugger is to run DRT in server mode and provide a file with the filename and the -p flag.

I suspect I'm missing something, but in any event I will shortly put up a patch with DRT updated to handle --dump-all-pixels.
Comment 1 Stephen Chenney 2012-08-27 10:17:42 PDT
Created attachment 160744 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-08-27 13:12:12 PDT
I'm not sure what --dump-all-pixels does. :)  Was this a test_shell thing which was failed to port forward?
Comment 3 Stephen Chenney 2012-08-27 13:20:13 PDT
The --dump-all-pixels argument was added by Darin Adler way back in 2006:

http://trac.webkit.org/changeset/13611

The comment on the ChangeLog says:

DumpRenderTree/DumpRenderTree.m:
(main): Added a new --dump-all-pixels option, used when forcing run-webkit-tests
to generate new output for all tests it runs.
(dump): Dump the scroll position if it's non-zero. Always dump the image when
the --dump-all-pixels option is passed. Also tightened up the image dumping
code and replaced the incorrect use of +[NSGraphicsContext saveGraphicsState]
with code to save and restore the context.

So I think my interpretation is correct: "Always dump the image when
the --dump-all-pixels option is passed."

It wasn't needed previously because we supported --pixel-tests as an argument to DRT, but that was removed in http://trac.webkit.org/changeset/124581.
Comment 4 Dirk Pranke 2012-08-28 12:33:20 PDT
If all you're trying to do is run a single test, then DumpREnderTree --no-timeout testname'-p should work. (Note the single quote which separates the test name from the -p parameter.

That said, the change sounds fine to me. So, with this change this would work the same way across all of the DRT implementations?
Comment 5 Stephen Chenney 2012-08-28 12:49:21 PDT
The single quote was the trick I was missing, but at the same time I think it's much simpler for all if we support --dump-all-pixels.

I too would like to know: What do the other ports do with this parameter?
Comment 6 Balazs Kelemen 2012-08-30 06:36:08 PDT
(In reply to comment #5)
> The single quote was the trick I was missing, but at the same time I think it's much simpler for all if we support --dump-all-pixels.
> 
> I too would like to know: What do the other ports do with this parameter?

Do other ports have such a parameter now? I don't think so. I think it's fine to add this.
Comment 7 Stephen Chenney 2012-08-30 06:50:06 PDT
I should have done this sooner: A search for dump-all-pixels finds support only in the win port and now Chromium. It was originally added for the mac port, presumably, then picked up in the win port, which Chromium picked up the parameter name from, then removed (presumably) from the mac port at some point.

On the one hand, I find dump-all-pixels much simpler for debugging DRT and one-off testing outside of run-webkit-tests and new-run-webkit-tests. On the other hand, if it's not in other ports I tend to think we should remove it everywhere.
Comment 8 Balazs Kelemen 2012-08-30 06:52:17 PDT
(In reply to comment #7)
> On the one hand, I find dump-all-pixels much simpler for debugging DRT and one-off testing outside of run-webkit-tests and new-run-webkit-tests. On the other hand, if it's not in other ports I tend to think we should remove it everywhere.

I think we should add it to everywhere. :)
Comment 9 Stephen Chenney 2012-09-14 08:03:33 PDT
Bump. Do you want me to implement this on every platform, or are you fine with checking it in for chromium and leaving it to the other platforms to do as they will?
Comment 10 Dirk Pranke 2012-09-14 11:13:51 PDT
Comment on attachment 160744 [details]
Patch

I think the patch looks fine (ish).  However, I think it'd be better if we just went back to supporting -p/--pixel-tests for this, rather than using --dump-all-pixels (at least that would be consistent with the per-test flag).

While I think we should implement this on all the ports, we don't need to do it in this patch (and while it would be nice of you to implement it everywhere, I don't think we need to require that). r+ w/ these changes; if you disagree, let me know.
Comment 11 Stephen Chenney 2012-09-14 12:00:07 PDT
(In reply to comment #10)
> (From update of attachment 160744 [details])
> I think the patch looks fine (ish).  However, I think it'd be better if we just went back to supporting -p/--pixel-tests for this, rather than using --dump-all-pixels (at least that would be consistent with the per-test flag).
> 
> While I think we should implement this on all the ports, we don't need to do it in this patch (and while it would be nice of you to implement it everywhere, I don't think we need to require that). r+ w/ these changes; if you disagree, let me know.

What are "these changes" in this context? Did some review comments not get published? Do you mean re-adding -p/--pixel-test?
Comment 12 Dirk Pranke 2012-09-14 12:08:11 PDT
Sorry, I meant change --dump-all-pixels to --pixel-tests and add -p as shorthand.
Comment 13 Stephen Chenney 2012-09-20 08:57:16 PDT
Committed r129139: <http://trac.webkit.org/changeset/129139>