GNOME Bugzilla – Bug 694579
[WK2] Downloads unit tests fails
Last modified: 2013-03-12 18:20:53 UTC
Failure: /embed/ephy-download/new_for_uri: ** ERROR:../../tests/ephy-download-test.c:145:test_ephy_download_new_for_uri: assertion failed (fixture->source == ephy_download_get_source_uri (fixture->download)): ("http://127.0.0.1:35689/default" == "") Gtk-Message: Failed to load module "pk-gtk-module" Gtk-Message: Failed to load module "canberra-gtk-module" Program received signal SIGABRT, Aborted. 0x0000003c65035ba5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63 63 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); Missing separate debuginfos, use: debuginfo-install aspell-0.60.6.1-5.fc18.x86_64 graphite2-1.1.1-4.fc18.x86_64 (gdb) bt
+ Trace 231560
I've been taking a look to this test, and the problem is that in ephy_download_new_for_download the call to webkit_download_get_request is returning an invalid request. Taking a look to WK2, it seems that it always return an invalid request if it's called before the download starts (like in this case). I've reported a WebKit bug to discuss this topic and look for the best solution: https://bugs.webkit.org/show_bug.cgi?id=111574
(In reply to comment #1) > Taking a look to WK2, it seems that it always return an invalid request if it's > called before the download starts (like in this case). I've reported a WebKit > bug to discuss this topic and look for the best solution: > https://bugs.webkit.org/show_bug.cgi?id=111574 The WK patch has already landed in the stable branch and the tests pass for me now: $ ./tests/test-ephy-download /embed/ephy-download/new: OK /embed/ephy-download/new_for_uri: OK /embed/ephy-download/start: OK
Sorry, I've tested it in WK1 by mistake. They still fail for me but only the last one: $ ./tests/test-ephy-download /embed/ephy-download/new: OK /embed/ephy-download/new_for_uri: OK /embed/ephy-download/start: GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. (./tests/test-ephy-download:21882): GLib-GIO-CRITICAL **: g_file_new_for_uri: assertion `uri != NULL' failed Backtrace:
+ Trace 231621
Created attachment 238607 [details] [review] Patch fixing 3rd test in WK2 The problem was that the destination URI in ephy_download_do_download_action was NULL because of it was using priv->download object that was not updated properly in the download_decide_destination_cb.
Created attachment 238619 [details] [review] Updated patch Previous patch could have problems if download_decide_destination_cb was called before priv->download was set. I hope new patch fixes the issues.
Created attachment 238711 [details] [review] New patch I realized that commenting out the previous tests, the test passes without any problem. So finally I end up disconnecting all the handlers for WebKitDownload object and the 3 tests pass for me now.
Review of attachment 238711 [details] [review]: Excellent, good catch!
Pushed to master, closing.