Changeset 90627 in webkit


Ignore:
Timestamp:
Jul 8, 2011 6:42:27 AM (13 years ago)
Author:
kov@webkit.org
Message:

[GTK] testwebview API test fails after http://trac.webkit.org/changeset/90471
https://bugs.webkit.org/show_bug.cgi?id=64159

Rework the icon-uri change test so that the condition for quitting
the mainloop is the icon-uri change itself, along with a timeout
to avoid taking too long in case of failure. Since the conditions
for considering a page loaded were changed we can't rely on that
for this test anymore.

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2011-07-08
Reviewed by Xan Lopez.

  • tests/testwebview.c:

(timeout_cb): error out if it takes too long for the icon-uri
change to happen.
(icon_uri_changed_cb): quit the loop here instead of waiting on
the page being loaded.
(test_webkit_web_view_icon_uri):

Location:
trunk/Source/WebKit/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/gtk/ChangeLog

    r90240 r90627  
     12011-07-08  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        [GTK] testwebview API test fails after http://trac.webkit.org/changeset/90471
     4        https://bugs.webkit.org/show_bug.cgi?id=64159
     5
     6        Rework the icon-uri change test so that the condition for quitting
     7        the mainloop is the icon-uri change itself, along with a timeout
     8        to avoid taking too long in case of failure. Since the conditions
     9        for considering a page loaded were changed we can't rely on that
     10        for this test anymore.
     11
     12        Reviewed by Xan Lopez.
     13
     14        * tests/testwebview.c:
     15        (timeout_cb): error out if it takes too long for the icon-uri
     16        change to happen.
     17        (icon_uri_changed_cb): quit the loop here instead of waiting on
     18        the page being loaded.
     19        (test_webkit_web_view_icon_uri):
     20
    1212011-07-01  Joone Hur  <joone.hur@collabora.co.uk>
    222
  • trunk/Source/WebKit/gtk/tests/testwebview.c

    r86361 r90627  
    7979}
    8080
     81static gboolean timeout_cb(gpointer data)
     82{
     83    g_error("Didn't get icon-uri before timing out.");
     84    return FALSE;
     85}
     86
    8187static void icon_uri_changed_cb(WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
    8288{
    83     gboolean* been_here = (gboolean*)data;
    8489    char* expected_uri;
    8590
     
    9095    g_free(expected_uri);
    9196
    92     *been_here = TRUE;
     97    g_main_loop_quit(loop);
    9398}
    9499
     
    107112static void test_webkit_web_view_icon_uri()
    108113{
    109     gboolean been_to_uri_changed = FALSE;
    110114    gboolean been_to_icon_loaded = FALSE;
    111115    WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
     
    115119
    116120    g_object_connect(G_OBJECT(view),
    117                      "signal::notify::progress", idle_quit_loop_cb, NULL,
    118                      "signal::notify::icon-uri", icon_uri_changed_cb, &been_to_uri_changed,
     121                     "signal::notify::icon-uri", icon_uri_changed_cb, NULL,
    119122                     "signal::icon-loaded", icon_loaded_cb, &been_to_icon_loaded,
    120123                     NULL);
     
    122125    webkit_web_view_load_uri(view, base_uri);
    123126
    124     g_main_loop_run(loop);
    125 
    126     g_assert(been_to_uri_changed);
     127    guint timeout_id = g_timeout_add(500, timeout_cb, 0);
     128
     129    g_main_loop_run(loop);
     130
     131    g_source_remove(timeout_id);
     132
    127133    g_assert(been_to_icon_loaded);
    128134
Note: See TracChangeset for help on using the changeset viewer.