Bug 46284

Summary: [GTK] Replace instances of g_timeout_add() with g_idle_add() in testatk.c
Product: WebKit Reporter: Mario Sanchez Prada <mario>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mrobinson, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch proposal
mrobinson: review-, mrobinson: commit-queue-
Patch proposal none

Description Mario Sanchez Prada 2010-09-22 11:50:18 PDT
Inside WebKit/gtk/tests/testatk.c, there are still some places where the following kind of lines

   g_timeout_add(100, (GSourceFunc)bail_out, loop);

...should be replaced by a call to g_idle_add:

   g_idle_add((GSourceFunc)bail_out, loop);

This is a trivial-yet-needed bug that needs obvious fixing (and further care when adding new tests <- note to myself :-/)
Comment 1 Mario Sanchez Prada 2010-09-22 12:41:30 PDT
Created attachment 68419 [details]
Patch proposal

This should be straightforward I guess...
Comment 2 Martin Robinson 2010-09-22 12:45:10 PDT
Comment on attachment 68419 [details]
Patch proposal

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

> WebKit/gtk/ChangeLog:8
> +        Use g_idle_add() whenever g_timeout_add() was being used

You should explain here why this conversion is a good thing. In the future, other programmers will see this commit and wonder what the explanation was. We should be able to concisely describe to people why we prefer this style.
Comment 3 Mario Sanchez Prada 2010-09-22 13:24:12 PDT
Created attachment 68430 [details]
Patch proposal

(In reply to comment #2)
> (From update of attachment 68419 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68419&action=review
> 
> > WebKit/gtk/ChangeLog:8
> > +        Use g_idle_add() whenever g_timeout_add() was being used
> 
> You should explain here why this conversion is a good thing. In the future, other programmers will see this commit and wonder what the explanation was. We should be able to concisely describe to people why we prefer this style.
Comment 4 Martin Robinson 2010-09-22 13:28:35 PDT
Comment on attachment 68430 [details]
Patch proposal

Great description! Thanks.
Comment 5 WebKit Commit Bot 2010-09-22 18:48:51 PDT
Comment on attachment 68430 [details]
Patch proposal

Clearing flags on attachment: 68430

Committed r68111: <http://trac.webkit.org/changeset/68111>
Comment 6 WebKit Commit Bot 2010-09-22 18:48:56 PDT
All reviewed patches have been landed.  Closing bug.