After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694579 - [WK2] Downloads unit tests fails
[WK2] Downloads unit tests fails
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 678610
 
 
Reported: 2013-02-24 10:25 UTC by Xan Lopez
Modified: 2013-03-12 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch fixing 3rd test in WK2 (1.29 KB, patch)
2013-03-11 18:11 UTC, Manuel Rego Casasnovas
none Details | Review
Updated patch (3.04 KB, patch)
2013-03-11 19:57 UTC, Manuel Rego Casasnovas
none Details | Review
New patch (1.93 KB, patch)
2013-03-12 16:45 UTC, Manuel Rego Casasnovas
committed Details | Review

Description Xan Lopez 2013-02-24 10:25:49 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
  • #0 __GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 63
  • #1 __GI_abort
    at abort.c line 90
  • #2 g_assertion_message
  • #3 g_assertion_message_cmpstr
  • #4 test_ephy_download_new_for_uri
  • #5 test_case_run
    at gtestutils.c line 1714
  • #6 g_test_run_suite_internal
    at gtestutils.c line 1767
  • #7 g_test_run_suite_internal
    at gtestutils.c line 1778
  • #8 g_test_run_suite_internal
    at gtestutils.c line 1778
  • #9 g_test_run_suite
    at gtestutils.c line 1823
  • #10 g_test_run
    at gtestutils.c line 1324
  • #11 main

Comment 1 Manuel Rego Casasnovas 2013-03-06 14:31:04 UTC
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
Comment 2 Manuel Rego Casasnovas 2013-03-11 10:23:41 UTC
(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
Comment 3 Manuel Rego Casasnovas 2013-03-11 10:58:21 UTC
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:

  • #0 g_logv
    at gmessages.c line 981
  • #1 g_log
    at gmessages.c line 1010
  • #2 g_return_if_fail_warning
    at gmessages.c line 1019
  • #3 g_file_new_for_uri
    at gfile.c line 6034
  • #4 ephy_download_do_download_action
    at ephy-download.c line 635
  • #5 download_finished_cb
    at ephy-download.c line 931
  • #6 _g_closure_invoke_va
    at gclosure.c line 840
  • #7 g_signal_emit_valist
    at gsignal.c line 3225
  • #8 g_signal_emit
    at gsignal.c line 3370
  • #9 didFinish(OpaqueWKContext const*, OpaqueWKDownload const*, void const*)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #10 WebKit::DownloadProxy::didFinish()
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #11 WebKit::DownloadProxy::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #12 CoreIPC::MessageReceiverMap::dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #13 WebKit::WebProcessProxy::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #14 CoreIPC::Connection::dispatchMessage(WTF::PassOwnPtr<CoreIPC::MessageDecoder>)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #15 CoreIPC::Connection::dispatchOneMessage()
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #16 WebCore::RunLoop::performWork()
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #17 WebCore::RunLoop::queueWork(WebCore::RunLoop*)
    from /opt/gnome/lib64/libwebkit2gtk-3.0.so.22
  • #18 g_main_dispatch
    at gmain.c line 3054
  • #19 g_main_context_dispatch
    at gmain.c line 3630
  • #20 g_main_context_iterate
    at gmain.c line 3701
  • #21 g_main_loop_run
    at gmain.c line 3895
  • #22 test_ephy_download_start
  • #23 test_case_run
    at gtestutils.c line 1714
  • #24 g_test_run_suite_internal
    at gtestutils.c line 1767
  • #25 g_test_run_suite_internal
    at gtestutils.c line 1778
  • #26 g_test_run_suite_internal
    at gtestutils.c line 1778
  • #27 g_test_run_suite
    at gtestutils.c line 1823
  • #28 main

Comment 4 Manuel Rego Casasnovas 2013-03-11 18:11:14 UTC
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.
Comment 5 Manuel Rego Casasnovas 2013-03-11 19:57:30 UTC
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.
Comment 6 Manuel Rego Casasnovas 2013-03-12 16:45:47 UTC
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.
Comment 7 Xan Lopez 2013-03-12 18:19:30 UTC
Review of attachment 238711 [details] [review]:

Excellent, good catch!
Comment 8 Xan Lopez 2013-03-12 18:20:47 UTC
Pushed to master, closing.