GNOME Bugzilla – Bug 695437
Several ephy-session tests disabled due to issue opening a session with 2 tabs with the same about: URI
Last modified: 2018-08-03 19:50:26 UTC
Steps to reproduce in Epiphany with WK2: 1) Disable delay loading 2) Open Epiphany with 2 tabs with "about:epiphany" as URI 3) Colse Epiphany 4) Re-open Epiphany and one of the tabs will be loading forever This was detected while debugging problem in session tests with WK2 (bug #695300). The problem is that if you're connected to "load-changed" signal of the 2 web views. Both views emit the signal with WEBKIT_LOAD_STARTED, however only one of them emit it with WEBKIT_LOAD_COMMITTED. So one view seems to be loading forever. Moreover, the view didn't emit "load-failed" either, so it keeps loading forever. It might be a WK bug, but reporting it here to track it down.
I've tried to reproduce it in WebKit using a unit test (Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp) without success so far. In my test I was creating 2 WebKitWebViews and use webkit_web_view_load_uri to load "foo:blank" in both views. Then I connected to the "load-changed" signal and both views finish to load properly.
I've tried to reproduce it in the ephy-web-view-test.c without success either, so maybe it's a specific bug in sessions code, not sure though. The code example that works for me is the following: static guint web_view_ready_counter = 0; static void load_changed_same_about_uri_cb (WebKitWebView *web_view, #ifdef HAVE_WEBKIT2 WebKitLoadEvent status, #else GParamSpec *pspec, #endif GMainLoop *loop) { #ifndef HAVE_WEBKIT2 WebKitLoadStatus status = webkit_web_view_get_load_status (web_view); #endif if (status == WEBKIT_LOAD_FINISHED) { web_view_ready_counter--; g_signal_handlers_disconnect_by_func (web_view, load_changed_cb, loop); if (web_view_ready_counter == 0) g_main_loop_quit (loop); } } static void wait_until_load_is_finished (WebKitWebView *web_view, GMainLoop *loop) { #ifdef HAVE_WEBKIT2 g_signal_connect (web_view, "load-changed", G_CALLBACK (load_changed_same_about_uri_cb), loop); #else g_signal_connect (web_view, "notify::load-status", G_CALLBACK (load_changed_same_about_uri_cb), loop); #endif } static void test_ephy_web_view_load_two_views_same_about_uri (void) { EphyWebView *view1, *view2; GMainLoop *loop; const char *uri; view1 = EPHY_WEB_VIEW (ephy_web_view_new ()); view2 = EPHY_WEB_VIEW (ephy_web_view_new ()); loop = g_main_loop_new (NULL, FALSE); uri = "about:epiphany"; web_view_ready_counter = 2; wait_until_load_is_finished (WEBKIT_WEB_VIEW (view1), loop); wait_until_load_is_finished (WEBKIT_WEB_VIEW (view2), loop); ephy_web_view_load_url (view1, uri); ephy_web_view_load_url (view2, uri); if (web_view_ready_counter != 0) g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (g_object_ref_sink (view1)); g_object_unref (g_object_ref_sink (view2)); }
This issue could be related to bug #695733 (I'm not sure yet). So, once WK2 bug is fixed (https://bugs.webkit.org/show_bug.cgi?id=112418) we should test this again.
With the current patch for the WebKit bug (http://webkit.org/b/112418) the issue is still present. Anyway, it doesn't seem an Epiphany issue as I've been able to reproduce it with MiniBrowser and a unit test in WebKit, so I've reported a different bug in WebKit with the information: http://webkit.org/b/112557
Created attachment 239225 [details] [review] Patch Even when this is a WebKit issue, once the WK bug (http://webkit.org/b/112557) is solved we should apply this patch to re-enable some session tests. That's the reason why I've reopened it.
Comment on attachment 239225 [details] [review] Patch Removing from unreviewed patches list, since this is blocked on a WebKit bug
I can't reproduce this anymore, even with restore-session-delaying-loads disabled.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/epiphany/issues/190.