RESOLVED FIXED 24844
Unit test WebKitDownload
https://bugs.webkit.org/show_bug.cgi?id=24844
Summary Unit test WebKitDownload
Christian Dywan
Reported 2009-03-26 11:40:57 PDT
I noticed while implementing download API that looking at the current progress before starting a WebKitDownload crashes WebKit. So I think we should really be unit testing add, to avoid such silly bugs.
Attachments
Initial download unit test (3.54 KB, patch)
2009-03-26 11:55 PDT, Christian Dywan
zecke: review+
Fixes for the crash and critical message detected by the unit tests (1.71 KB, patch)
2009-04-01 10:16 PDT, Gustavo Noronha (kov)
ap: review+
Christian Dywan
Comment 1 2009-03-26 11:55:09 PDT
Created attachment 28974 [details] Initial download unit test This is only a start but it already catches two bugs: webkit_download_get_progress(download) crashes webkit_download_get_elapsed_time(download) complains about an invalid timer
Holger Freyther
Comment 2 2009-03-30 06:06:31 PDT
Comment on attachment 28974 [details] Initial download unit test Thanks.
Gustavo Noronha (kov)
Comment 3 2009-04-01 10:16:28 PDT
Created attachment 29163 [details] Fixes for the crash and critical message detected by the unit tests accessor functions are called before the download is started. --- WebKit/gtk/ChangeLog | 15 +++++++++++++++ WebKit/gtk/webkit/webkitdownload.cpp | 6 ++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
Christian Dywan
Comment 4 2009-04-01 12:51:43 PDT
Comment on attachment 28974 [details] Initial download unit test Committed in revision 42153.
Alexey Proskuryakov
Comment 5 2009-04-02 08:12:26 PDT
Comment on attachment 29163 [details] Fixes for the crash and critical message detected by the unit tests > + Extra checks to avoid crashing and a critical message when > + property accessor functions are called before the download is > + started. Tabs instead of spaces here. > + if (!priv->timer) > + return 0.0; I'd just write "return 0". r=me
Gustavo Noronha (kov)
Comment 6 2009-04-02 08:50:59 PDT
Landed fix as r42169, with ap's comments addressed.
Note You need to log in before you can comment on or make changes to this bug.