Bug 40616

Summary: [DRT/Chromium] Implement --testshell-startup-dialog
Product: WebKit Reporter: Kent Tamura <tkent>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, bweinstein, dglazkov, eric, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: All   
Bug Depends on:    
Bug Blocks: 28398    
Attachments:
Description Flags
Patch
none
Patch 2 (add a comment about gtk_init)
none
Patch none

Description Kent Tamura 2010-06-15 01:22:28 PDT
[DRT/Chromium] Implement --testshell-startup-dialog
Comment 1 Kent Tamura 2010-06-15 01:26:22 PDT
Created attachment 58763 [details]
Patch
Comment 2 Tony Chang 2010-06-15 01:39:47 PDT
Comment on attachment 58763 [details]
Patch

One small nit:

WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp:196
 +      gtk_init(0, 0);
Nit: Can we call this in platformInit() instead?  It would be nice to pass in the actual argc/argv, but I guess it's not a big deal.
Comment 3 Kent Tamura 2010-06-15 01:42:46 PDT
(In reply to comment #2)
> (From update of attachment 58763 [details])
> One small nit:
> 
> WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp:196
>  +      gtk_init(0, 0);
> Nit: Can we call this in platformInit() instead?  It would be nice to pass in the actual argc/argv, but I guess it's not a big deal.

I wanted to avoid to open X display as possible. But it might make no sense.
Comment 4 WebKit Review Bot 2010-06-15 01:47:04 PDT
Attachment 58763 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/3314156
Comment 5 Tony Chang 2010-06-15 01:52:19 PDT
(In reply to comment #3)
> I wanted to avoid to open X display as possible. But it might make no sense.

I didn't even realize that we could run without an X display.  You're right, we should try to preserve that so this seems fine.  Maybe add a comment about the weird placement of init?

In practice, I don't think Linux people use the startup dialog to attach a debugger.  I think it's more common to try to use --wrapper="gdb --args" with new-run-webkit-tests, although I'm not sure that works anymore.
Comment 6 Kent Tamura 2010-06-15 02:33:26 PDT
Created attachment 58765 [details]
Patch 2 (add a comment about gtk_init)
Comment 7 WebKit Review Bot 2010-06-15 03:10:11 PDT
Attachment 58765 [details] did not build on chromium:
Build output: http://webkit-commit-queue.appspot.com/results/3277179
Comment 8 Eric Seidel (no email) 2010-06-15 14:48:24 PDT
I've never understood why Chromium has this option.

Why not just use:
> gdb DumpRenderTree
 % run

to run the application inside the debugger?  That's what we do with the existing DumpRenderTree.
Comment 9 Tony Chang 2010-06-15 17:03:24 PDT
(In reply to comment #8)
> I've never understood why Chromium has this option.
> 
> Why not just use:
> > gdb DumpRenderTree
>  % run
> 
> to run the application inside the debugger?  That's what we do with the existing DumpRenderTree.

Don't you have to manually pipe it file paths to run tests?  This also makes it easier to debug http tests since you don't have to remember to run new-run-webkit-httpd.
Comment 10 Eric Seidel (no email) 2010-06-16 00:16:47 PDT
The other DumpRenderTree implementations take a list of tests as arguments and run those.  I don't really know how to speak DRT's http-like syntax off the top of my head, so I'm impressed that you all have been piping arguments to it!
Comment 11 Eric Seidel (no email) 2010-06-16 00:17:41 PDT
DRT has two modes
"-" is server mode.  wait for http-like commands on stdin.
[LIST OF TESTS] runs a list of tests and dumps their render trees to stdout.  It used to not spit out extra #EOFs in that mode, but it looks like it does these days. :(
Comment 12 Kent Tamura 2010-06-20 18:00:34 PDT
This option is useful on Windows.
Attaching debugger while the dialog opening is much easier than changing target command-line setting every time in Visual Studio.
Comment 13 Eric Seidel (no email) 2010-06-20 18:06:57 PDT
Maybe the webkit-windows folks will want something similar for DRT then?
Comment 14 Adam Roben (:aroben) 2010-06-21 06:32:33 PDT
Maybe it would be even better to have a flag that makes DRT/TestShell call DebugBreak() before it has run any tests? That would cause the just-in-time debugging dialog to appear, which seems even easier than having to attach to the process manually.
Comment 15 Kent Tamura 2010-06-24 23:50:27 PDT
(In reply to comment #14)
> Maybe it would be even better to have a flag that makes DRT/TestShell call DebugBreak() before it has run any tests? That would cause the just-in-time debugging dialog to appear, which seems even easier than having to attach to the process manually.

I tried DebugBreak() today.  But It didn't work if a parent processes is a Cygwin process.
Comment 16 Tony Chang 2010-08-02 11:57:27 PDT
tkent: Can you rebase now that http://trac.webkit.org/changeset/64463 has landed?
Comment 17 Kent Tamura 2010-08-02 23:26:26 PDT
Created attachment 63301 [details]
Patch
Comment 18 Kent Tamura 2010-08-02 23:27:48 PDT
(In reply to comment #16)
> tkent: Can you rebase now that http://trac.webkit.org/changeset/64463 has landed?

Yes.  I have uploaded a rebased patch.
Comment 19 Dimitri Glazkov (Google) 2010-08-03 07:17:19 PDT
Comment on attachment 63301 [details]
Patch

ok!
Comment 20 Kent Tamura 2010-08-03 18:53:43 PDT
Comment on attachment 63301 [details]
Patch

Clearing flags on attachment: 63301

Committed r64615: <http://trac.webkit.org/changeset/64615>
Comment 21 Kent Tamura 2010-08-03 18:53:53 PDT
All reviewed patches have been landed.  Closing bug.