Changeset 43760 in webkit


Ignore:
Timestamp:
May 15, 2009 12:55:44 AM (15 years ago)
Author:
eric@webkit.org
Message:

2009-05-15 Jan Michael Alonzo <jmalonzo@webkit.org>

Reviewed by Holger Freyther.

[GTK] Implement layoutTestController.waitForPolicyDelegate
https://bugs.webkit.org/show_bug.cgi?id=25036

Connect to 'navigation-policy-decision-requested' and handle
waitForPolicy in the callback.

  • DumpRenderTree/gtk/DumpRenderTree.cpp: (invalidateAnyPreviousWaitToDumpWatchdog): (webViewNavigationPolicyDecisionRequested): (main):
  • DumpRenderTree/gtk/DumpRenderTreeGtk.h:
  • DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::notifyDone): (LayoutTestController::waitForPolicyDelegate):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r43759 r43760  
     12009-05-15  Jan Michael Alonzo  <jmalonzo@webkit.org>
     2
     3        Reviewed by Holger Freyther.
     4
     5        [GTK] Implement layoutTestController.waitForPolicyDelegate
     6        https://bugs.webkit.org/show_bug.cgi?id=25036
     7
     8        Enable fast/forms/mailto tests.
     9
     10        * platform/gtk/Skipped:
     11
    1122009-05-15  Jungshik Shin  <jshin@chromium.org>
    213
  • trunk/LayoutTests/platform/gtk/Skipped

    r43718 r43760  
    17611761fast/forms/textfield-onchange-deletion.html
    17621762fast/forms/textfield-to-password-on-focus.html
    1763 fast/forms/mailto/advanced-get.html
    1764 fast/forms/mailto/advanced-put.html
    1765 fast/forms/mailto/get-multiple-items-text-plain.html
    1766 fast/forms/mailto/get-multiple-items-x-www-form-urlencoded.html
    1767 fast/forms/mailto/get-multiple-items.html
    1768 fast/forms/mailto/get-non-ascii-always-utf-8.html
    1769 fast/forms/mailto/get-non-ascii-text-plain-latin-1.html
    1770 fast/forms/mailto/get-non-ascii-text-plain.html
    1771 fast/forms/mailto/get-non-ascii.html
    1772 fast/forms/mailto/get-overwrite-query.html
    1773 fast/forms/mailto/post-append-query.html
    1774 fast/forms/mailto/post-multiple-items-multipart-form-data.html
    1775 fast/forms/mailto/post-multiple-items-text-plain.html
    1776 fast/forms/mailto/post-multiple-items-x-www-form-urlencoded.html
    1777 fast/forms/mailto/post-multiple-items.html
    1778 fast/forms/mailto/post-text-plain-with-accept-charset.html
    1779 fast/forms/mailto/post-text-plain.html
    17801763fast/frames/content-opacity-1.html
    17811764fast/frames/content-opacity-2.html
  • trunk/WebKitTools/ChangeLog

    r43721 r43760  
     12009-05-15  Jan Michael Alonzo  <jmalonzo@webkit.org>
     2
     3        Reviewed by Holger Freyther.
     4
     5        [GTK] Implement layoutTestController.waitForPolicyDelegate
     6        https://bugs.webkit.org/show_bug.cgi?id=25036
     7
     8        Connect to 'navigation-policy-decision-requested' and handle
     9        waitForPolicy in the callback.
     10
     11        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     12        (invalidateAnyPreviousWaitToDumpWatchdog):
     13        (webViewNavigationPolicyDecisionRequested):
     14        (main):
     15        * DumpRenderTree/gtk/DumpRenderTreeGtk.h:
     16        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     17        (LayoutTestController::notifyDone):
     18        (LayoutTestController::waitForPolicyDelegate):
     19
    1202009-05-14  David Levin  <levin@chromium.org>
    221
  • trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r43188 r43760  
    7171WebKitWebFrame* topLoadingFrame = 0;
    7272guint waitToDumpWatchdog = 0;
     73bool waitForPolicy = false;
    7374
    7475// current b/f item at the end of the previous test
     
    219220        waitToDumpWatchdog = 0;
    220221    }
     222
     223    waitForPolicy = false;
    221224}
    222225
     
    464467}
    465468
     469static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKitWebFrame* frame,
     470                                                     WebKitNetworkRequest* request,
     471                                                     WebKitWebNavigationAction* navAction,
     472                                                     WebKitWebPolicyDecision* policyDecision)
     473{
     474    // Use the default handler if we're not waiting for policy,
     475    // i.e., LayoutTestController::waitForPolicyDelegate
     476    if (!waitForPolicy)
     477        return FALSE;
     478
     479    gchar* typeDescription;
     480    WebKitWebNavigationReason reason;
     481    g_object_get(G_OBJECT(navAction), "reason", &reason, NULL);
     482
     483    switch(reason) {
     484        case WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED:
     485            typeDescription = g_strdup("link clicked");
     486            break;
     487        case WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED:
     488            typeDescription = g_strdup("form submitted");
     489            break;
     490        case WEBKIT_WEB_NAVIGATION_REASON_BACK_FORWARD:
     491            typeDescription = g_strdup("back/forward");
     492            break;
     493        case WEBKIT_WEB_NAVIGATION_REASON_RELOAD:
     494            typeDescription = g_strdup("reload");
     495            break;
     496        case WEBKIT_WEB_NAVIGATION_REASON_FORM_RESUBMITTED:
     497            typeDescription = g_strdup("form resubmitted");
     498            break;
     499        case WEBKIT_WEB_NAVIGATION_REASON_OTHER:
     500            typeDescription = g_strdup("other");
     501            break;
     502        default:
     503            typeDescription = g_strdup("illegal value");
     504    }
     505
     506    printf("Policy delegate: attempt to load %s with navigation type '%s'\n", webkit_network_request_get_uri(request), typeDescription);
     507    g_free(typeDescription);
     508
     509    webkit_web_policy_decision_ignore(policyDecision);
     510    gLayoutTestController->notifyDone();
     511
     512    return TRUE;
     513}
     514
    466515int main(int argc, char* argv[])
    467516{
     
    503552    g_signal_connect(G_OBJECT(webView), "script-confirm", G_CALLBACK(webViewScriptConfirm), 0);
    504553    g_signal_connect(G_OBJECT(webView), "title-changed", G_CALLBACK(webViewTitleChanged), 0);
     554    g_signal_connect(G_OBJECT(webView), "navigation-policy-decision-requested", G_CALLBACK(webViewNavigationPolicyDecisionRequested), 0);
    505555
    506556    setDefaultsToConsistentStateValuesForTesting();
  • trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h

    r35816 r43760  
    3636extern WebKitWebFrame* topLoadingFrame;
    3737extern guint waitToDumpWatchdog;
     38extern bool waitForPolicy;
    3839
    3940gchar* JSStringCopyUTF8CString(JSStringRef jsString);
  • trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r42890 r43760  
    109109        dump();
    110110    m_waitToDump = false;
     111    waitForPolicy = false;
    111112}
    112113
     
    152153void LayoutTestController::waitForPolicyDelegate()
    153154{
    154     // FIXME: implement
     155    waitForPolicy = true;
     156    setWaitToDump(true);
    155157}
    156158
Note: See TracChangeset for help on using the changeset viewer.