Changeset 115415 in webkit


Ignore:
Timestamp:
Apr 27, 2012 2:47:05 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
https://bugs.webkit.org/show_bug.cgi?id=81891

Patch by Christophe Dumez <Christophe Dumez> on 2012-04-27
Reviewed by Philippe Normand.

Source/WebKit/efl:

New "load,resource,finished", "load,resource,failed", and
"resource,response,received" signals were added to notify about different
resource load events. These additional signals are needed for proper
support of LayoutTestController's dumpResourceLoadCallbacks() in EFL's
DumpRenderTree.

  • WebCoreSupport/FrameLoaderClientEfl.cpp:

(WebCore::FrameLoaderClientEfl::assignIdentifierToInitialRequest):
(WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse):
(WebCore::FrameLoaderClientEfl::dispatchDidFinishLoading):
(WebCore::FrameLoaderClientEfl::dispatchDidFailLoading):

  • ewk/ewk_frame.cpp:

(ewk_frame_response_received):
(ewk_frame_load_finished):
(ewk_frame_load_resource_finished):
(ewk_frame_load_resource_failed):
(ewk_frame_load_error):

  • ewk/ewk_frame.h:
  • ewk/ewk_private.h:
  • ewk/ewk_view.h:

Tools:

Implement support for LayoutTestController's
dumpResourceLoadCallbacks() in EFL's DumpRenderTree by catching new
ewk_view signals about resource loading and print out the expected
information. This allows for several test cases to be removed from the
skip list.

  • DumpRenderTree/efl/DumpRenderTreeChrome.cpp:

(DumpRenderTreeChrome::createView):
(descriptionSuitableForTestResult):
(DumpRenderTreeChrome::onResponseReceived):
(DumpRenderTreeChrome::onResourceLoadFinished):
(DumpRenderTreeChrome::onResourceLoadFailed):
(DumpRenderTreeChrome::onNewResourceRequest):

  • DumpRenderTree/efl/DumpRenderTreeChrome.h:

(DumpRenderTreeChrome):

LayoutTests:

Unskip tests which depend on EFL's DumpRenderTree support for
LayoutTestController's dumpResourceLoadCallbacks(), now that it is
implemented.

  • platform/efl/Skipped:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115413 r115415  
     12012-04-27  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
     4        https://bugs.webkit.org/show_bug.cgi?id=81891
     5
     6        Reviewed by Philippe Normand.
     7
     8        Unskip tests which depend on EFL's DumpRenderTree support for
     9        LayoutTestController's dumpResourceLoadCallbacks(), now that it is
     10        implemented.
     11
     12        * platform/efl/Skipped:
     13
    1142012-04-27  Marcus Bulach  <bulach@chromium.org>
    215
  • trunk/LayoutTests/platform/efl/Skipped

    r115341 r115415  
    641641fast/loader/file-protocol-fragment.html
    642642
    643 # Missing delegates: tests failing because of missing resource load delegate callbacks.
    644 fast/loader/main-document-url-for-non-http-loads.html
    645 http/tests/misc/link-rel-icon-beforeload.html
    646 
    647643# Missing delegates: tests failing because of missing policy delegate callbacks.
    648644fast/loader/onload-policy-ignore-for-frame.html
     
    697693# BUG: Missing resource load callback ability in DRT
    698694http/tests/loading/redirect-methods.html
    699 http/tests/misc/favicon-loads-with-images-disabled.html
    700695
    701696# Requires willSendRequestReturnsNullOnRedirect + willSendRequest + didFinishLoading
     
    999994http/tests/misc/policy-delegate-called-twice.html
    1000995http/tests/misc/redirect-to-external-url.html
    1001 http/tests/misc/window-dot-stop.html
    1002996http/tests/multipart/policy-ignore-crash.php
    1003997http/tests/security/feed-urls-from-remote.html
     998
     999# ResourceError domain needs to be properly set in FrameLoaderClient
     1000# https://bugs.webkit.org/show_bug.cgi?id=84129
     1001http/tests/misc/window-dot-stop.html
     1002http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
     1003http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
     1004http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
     1005http/tests/security/XFrameOptions/x-frame-options-deny.html
     1006http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
     1007http/tests/xmlhttprequest/abort-should-cancel-load.html
    10041008
    10051009# Test times out (via GTK+)
     
    20952099http/tests/security/xss-DENIED-xsl-document-redirect.xml
    20962100http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml
    2097 http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
    2098 http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html
    2099 http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
    2100 http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
    2101 http/tests/security/XFrameOptions/x-frame-options-deny.html
    2102 http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html
    2103 http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
    21042101http/tests/ssl/referer-301.html
    21052102http/tests/ssl/referer-303.html
    21062103http/tests/ssl/verify-ssl-enabled.php
    21072104http/tests/workers/terminate-during-sync-operation.html
    2108 http/tests/xmlhttprequest/abort-should-cancel-load.html
    21092105http/tests/xmlhttprequest/access-control-basic-whitelist-request-headers.html
    21102106http/tests/xmlhttprequest/basic-auth-nopassword.html
  • trunk/Source/WebKit/efl/ChangeLog

    r115385 r115415  
     12012-04-27  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
     4        https://bugs.webkit.org/show_bug.cgi?id=81891
     5
     6        Reviewed by Philippe Normand.
     7
     8        New "load,resource,finished", "load,resource,failed", and
     9        "resource,response,received" signals were added to notify about different
     10        resource load events. These additional signals are needed for proper
     11        support of LayoutTestController's dumpResourceLoadCallbacks() in EFL's
     12        DumpRenderTree.
     13
     14        * WebCoreSupport/FrameLoaderClientEfl.cpp:
     15        (WebCore::FrameLoaderClientEfl::assignIdentifierToInitialRequest):
     16        (WebCore::FrameLoaderClientEfl::dispatchDidReceiveResponse):
     17        (WebCore::FrameLoaderClientEfl::dispatchDidFinishLoading):
     18        (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading):
     19        * ewk/ewk_frame.cpp:
     20        (ewk_frame_response_received):
     21        (ewk_frame_load_finished):
     22        (ewk_frame_load_resource_finished):
     23        (ewk_frame_load_resource_failed):
     24        (ewk_frame_load_error):
     25        * ewk/ewk_frame.h:
     26        * ewk/ewk_private.h:
     27        * ewk/ewk_view.h:
     28
    1292012-04-26  Martin Robinson  <mrobinson@igalia.com>
    230
  • trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r115294 r115415  
    235235    Ewk_Frame_Resource_Request request = { url.data(), firstParty.data(), httpMethod.data(), identifier, m_frame, isMainFrameRequest };
    236236    ewk_frame_request_assign_identifier(m_frame, &request);
     237    evas_object_smart_callback_call(m_view, "resource,request,new", &request);
    237238}
    238239
     
    262263}
    263264
    264 void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long, const ResourceResponse& response)
     265void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long, const ResourceResponse& coreResponse)
    265266{
    266267    // Update our knowledge of request soup flags - some are only set
    267268    // after the request is done.
    268     loader->request().setSoupMessageFlags(response.soupMessageFlags());
    269 
    270     m_response = response;
     269    loader->request().setSoupMessageFlags(coreResponse.soupMessageFlags());
     270
     271    m_response = coreResponse;
     272
     273    Ewk_Frame_Resource_Response response = { 0, coreResponse.httpStatusCode() };
     274    CString url = coreResponse.url().string().utf8();
     275    response.url = url.data();
     276
     277    ewk_frame_response_received(m_frame, &response);
     278    evas_object_smart_callback_call(m_view, "resource,response,received", &response);
    271279}
    272280
     
    749757void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)
    750758{
    751     notImplemented();
    752 }
    753 
    754 void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err)
    755 {
    756     notImplemented();
     759    ewk_frame_load_resource_finished(m_frame, identifier);
     760    evas_object_smart_callback_call(m_view, "load,resource,finished", &identifier);
     761}
     762
     763void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError& err)
     764{
     765    Ewk_Frame_Load_Error error;
     766    CString errorDomain = err.domain().utf8();
     767    CString errorDescription = err.localizedDescription().utf8();
     768    CString failingUrl = err.failingURL().utf8();
     769
     770    DBG("ewkFrame=%p, resource=%ld, error=%s (%d, cancellation=%hhu) \"%s\", url=%s",
     771        m_frame, identifier, errorDomain.data(), err.errorCode(), err.isCancellation(),
     772        errorDescription.data(), failingUrl.data());
     773
     774    error.code = err.errorCode();
     775    error.is_cancellation = err.isCancellation();
     776    error.domain = errorDomain.data();
     777    error.description = errorDescription.data();
     778    error.failing_url = failingUrl.data();
     779    error.resource_identifier = identifier;
     780    error.frame = m_frame;
     781
     782    ewk_frame_load_resource_failed(m_frame, &error);
     783    evas_object_smart_callback_call(m_view, "load,resource,failed", &error);
    757784}
    758785
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r115294 r115415  
    12311231 *
    12321232 * @param ewkFrame Frame.
    1233  * @param @param messages Messages containing the request details that user may override and a
     1233 * @param messages Messages containing the request details that user may override and a
    12341234 * possible redirect reponse. Whenever values on this struct changes, it must be properly
    12351235 * malloc'd as it will be freed afterwards.
     
    12541254{
    12551255    evas_object_smart_callback_call(ewkFrame, "resource,request,new", (void*)request);
     1256}
     1257
     1258/**
     1259 * @internal
     1260 * Reports that a response to a resource request was received.
     1261 *
     1262 * @param ewkFrame Frame.
     1263 * @param request Response details. No changes are allowed to fields.
     1264 *
     1265 * Emits signal: "resource,response,received"
     1266 */
     1267void ewk_frame_response_received(Evas_Object* ewkFrame, Ewk_Frame_Resource_Response* response)
     1268{
     1269    evas_object_smart_callback_call(ewkFrame, "resource,response,received", response);
    12561270}
    12571271
     
    13931407        buffer.description = errorDescription;
    13941408        buffer.failing_url = failingUrl;
     1409        buffer.resource_identifier = 0;
    13951410        buffer.frame = ewkFrame;
    13961411        error = &buffer;
     
    13991414    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);
    14001415    ewk_view_load_finished(smartData->view, error);
     1416}
     1417
     1418/**
     1419 * @internal
     1420 * Reports resource load finished.
     1421 *
     1422 * Emits signal: "load,resource,finished" with the resource
     1423 * request identifier.
     1424 */
     1425void ewk_frame_load_resource_finished(Evas_Object* ewkFrame, unsigned long identifier)
     1426{
     1427    evas_object_smart_callback_call(ewkFrame, "load,resource,finished", &identifier);
     1428}
     1429
     1430/**
     1431 * @internal
     1432 * Reports resource load failure, with error information.
     1433 *
     1434 * Emits signal: "load,resource,failed" with the error information.
     1435 */
     1436void ewk_frame_load_resource_failed(Evas_Object* ewkFrame, Ewk_Frame_Load_Error* error)
     1437{
     1438    evas_object_smart_callback_call(ewkFrame, "load,resource,failed", error);
    14011439}
    14021440
     
    14221460    error.description = errorDescription;
    14231461    error.failing_url = failingUrl;
     1462    error.resource_identifier = 0;
    14241463    error.frame = ewkFrame;
    14251464    evas_object_smart_callback_call(ewkFrame, "load,error", &error);
  • trunk/Source/WebKit/efl/ewk/ewk_frame.h

    r115294 r115415  
    4747 *    finished and it gives @c NULL on success or pointer to
    4848 *    structure defining the error.
     49 *  - "load,resource,finished", unsigned long*: reports resource load finished and it gives
     50 *    a pointer to its identifier.
     51 *  - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
     52 *    gives a pointer to structure defining the error as an argument.
    4953 *  - "load,firstlayout,finished", void: frame finished first layout.
    5054 *  - "load,nonemptylayout,finished", void: frame finished first
     
    6266 *  - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
    6367 *    and the possible redirect response.
     68 *  - "resource,response,received", Ewk_Frame_Resource_Response*: reports that a response
     69 *    to a resource request was received.
    6470 *  - "state,save", void: frame's state will be saved as a history item.
    6571 *  - "title,changed", const char*: title of the main frame was changed.
     
    97103    const char *description; /**< error description already localized */
    98104    const char *failing_url; /**< the url that failed to load */
     105    unsigned long resource_identifier; /**< identifier of resource */
    99106    Evas_Object *frame; /**< frame where the failure happened */
    100107};
  • trunk/Source/WebKit/efl/ewk/ewk_private.h

    r115294 r115415  
    221221void ewk_frame_load_document_finished(Evas_Object* ewkFrame);
    222222void ewk_frame_load_finished(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, bool isCancellation, const char* errorDescription, const char* failingUrl);
     223void ewk_frame_load_resource_finished(Evas_Object* ewkFrame, unsigned long identifier);
     224void ewk_frame_load_resource_failed(Evas_Object* ewkFrame, Ewk_Frame_Load_Error* error);
    223225void ewk_frame_load_error(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, bool isCancellation, const char* errorDescription, const char* failingUrl);
    224226void ewk_frame_load_progress_changed(Evas_Object* ewkFrame);
     
    227229void ewk_frame_request_will_send(Evas_Object* ewkFrame, Ewk_Frame_Resource_Messages* messages);
    228230void ewk_frame_request_assign_identifier(Evas_Object* ewkFrame, const Ewk_Frame_Resource_Request* request);
     231void ewk_frame_response_received(Evas_Object* ewkFrame, Ewk_Frame_Resource_Response* response);
    229232void ewk_frame_view_state_save(Evas_Object* ewkFrame, WebCore::HistoryItem* item);
    230233
  • trunk/Source/WebKit/efl/ewk/ewk_view.h

    r115341 r115415  
    6161 *    from 0.0 to 1.0, connect to individual frames for fine grained).
    6262 *  - "load,provisional", void: view started provisional load.
     63 *  - "load,resource,finished", unsigned long*: reports resource load finished and it gives
     64 *    a pointer to its identifier.
     65 *  - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
     66 *    gives a pointer to structure defining the error as an argument.
    6367 *  - "load,started", Evas_Object*: frame started loading the document.
    6468 *  - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
     
    6973 *  - "onload,event", Evas_Object*: a frame onload event has been received.
    7074 *  - "ready", void: page is fully loaded.
     75 *  - "resource,request,new", Ewk_Frame_Resource_Request*: reports that
     76 *    there's a new resource request.
    7177 *  - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
    7278 *    and the possible redirect response.
     79 *  - "resource,response,received", Ewk_Frame_Resource_Response*: the network response for a resource.
    7380 *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
    7481 *    are visible; @c EINA_FALSE, otherwise.
  • trunk/Tools/ChangeLog

    r115414 r115415  
     12012-04-27  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
     4        https://bugs.webkit.org/show_bug.cgi?id=81891
     5
     6        Reviewed by Philippe Normand.
     7
     8        Implement support for LayoutTestController's
     9        dumpResourceLoadCallbacks() in EFL's DumpRenderTree by catching new
     10        ewk_view signals about resource loading and print out the expected
     11        information. This allows for several test cases to be removed from the
     12        skip list.
     13
     14        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
     15        (DumpRenderTreeChrome::createView):
     16        (descriptionSuitableForTestResult):
     17        (DumpRenderTreeChrome::onResponseReceived):
     18        (DumpRenderTreeChrome::onResourceLoadFinished):
     19        (DumpRenderTreeChrome::onResourceLoadFailed):
     20        (DumpRenderTreeChrome::onNewResourceRequest):
     21        * DumpRenderTree/efl/DumpRenderTreeChrome.h:
     22        (DumpRenderTreeChrome):
     23
    1242012-04-27  Philippe Normand  <pnormand@igalia.com>
    225
  • trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp

    r115332 r115415  
    4848using namespace WebCore;
    4949
     50HashMap<unsigned long, CString> DumpRenderTreeChrome::m_dumpAssignedUrls;
     51
    5052PassOwnPtr<DumpRenderTreeChrome> DumpRenderTreeChrome::create(Evas* evas)
    5153{
     
    9092    ewk_view_theme_set(view, DATA_DIR"/default.edj");
    9193
     94    evas_object_smart_callback_add(view, "load,resource,failed", onResourceLoadFailed, 0);
     95    evas_object_smart_callback_add(view, "load,resource,finished", onResourceLoadFinished, 0);
    9296    evas_object_smart_callback_add(view, "load,started", onLoadStarted, 0);
    9397    evas_object_smart_callback_add(view, "title,changed", onTitleChanged, 0);
     
    9599    evas_object_smart_callback_add(view, "statusbar,text,set", onStatusbarTextSet, 0);
    96100    evas_object_smart_callback_add(view, "load,document,finished", onDocumentLoadFinished, 0);
     101    evas_object_smart_callback_add(view, "resource,request,new", onNewResourceRequest, 0);
    97102    evas_object_smart_callback_add(view, "resource,request,willsend", onWillSendRequest, 0);
     103    evas_object_smart_callback_add(view, "resource,response,received", onResponseReceived, 0);
    98104    evas_object_smart_callback_add(view, "onload,event", onWebViewOnloadEvent, 0);
    99105    evas_object_smart_callback_add(view, "mixedcontent,run", onInsecureContentRun, 0);
     
    311317}
    312318
     319static CString descriptionSuitableForTestResult(Ewk_Frame_Load_Error* error)
     320{
     321    String ret = "<NSError domain ";
     322    ret += error->domain;
     323    ret += ", code ";
     324    ret += String::number(error->code);
     325    if (error->failing_url && *error->failing_url != '\0') {
     326        ret += ", failing URL \"";
     327        ret += error->failing_url;
     328        ret += "\"";
     329    }
     330    ret += ">";
     331
     332    return ret.utf8();
     333}
     334
    313335// Smart Callbacks
    314336// ---------------
     
    523545        printf("didDetectXSS\n");
    524546}
     547
     548void DumpRenderTreeChrome::onResponseReceived(void*, Evas_Object*, void* eventInfo)
     549{
     550    Ewk_Frame_Resource_Response* response = static_cast<Ewk_Frame_Resource_Response*>(eventInfo);
     551
     552    if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
     553        CString responseDescription(descriptionSuitableForTestResult(response));
     554        printf("%s - didReceiveResponse %s\n",
     555               pathSuitableForTestResult(response->url).data(),
     556               responseDescription.data());
     557    }
     558}
     559
     560void DumpRenderTreeChrome::onResourceLoadFinished(void*, Evas_Object*, void* eventInfo)
     561{
     562    unsigned long identifier = *static_cast<unsigned long*>(eventInfo);
     563
     564    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
     565        printf("%s - didFinishLoading\n",
     566               (m_dumpAssignedUrls.contains(identifier) ? m_dumpAssignedUrls.take(identifier).data() : "<unknown>"));
     567}
     568
     569void DumpRenderTreeChrome::onResourceLoadFailed(void*, Evas_Object*, void* eventInfo)
     570{
     571    Ewk_Frame_Load_Error* error = static_cast<Ewk_Frame_Load_Error*>(eventInfo);
     572
     573    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
     574        printf("%s - didFailLoadingWithError: %s\n",
     575               (m_dumpAssignedUrls.contains(error->resource_identifier) ? m_dumpAssignedUrls.take(error->resource_identifier).data() : "<unknown>"),
     576               descriptionSuitableForTestResult(error).data());
     577}
     578
     579void DumpRenderTreeChrome::onNewResourceRequest(void*, Evas_Object*, void* eventInfo)
     580{
     581    Ewk_Frame_Resource_Request* request = static_cast<Ewk_Frame_Resource_Request*>(eventInfo);
     582
     583    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
     584        m_dumpAssignedUrls.add(request->identifier, pathSuitableForTestResult(request->url));
     585}
  • trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h

    r114633 r115415  
    3232#include <Eina.h>
    3333#include <Evas.h>
     34#include <wtf/HashMap.h>
    3435#include <wtf/OwnPtr.h>
    3536#include <wtf/PassOwnPtr.h>
    3637#include <wtf/Vector.h>
     38#include <wtf/text/CString.h>
    3739
    3840class DumpRenderTreeChrome {
     
    6264    OwnPtr<GCController> m_gcController;
    6365    Vector<Evas_Object*> m_extraViews;
     66    static HashMap<unsigned long, CString> m_dumpAssignedUrls;
    6467
    6568    // Smart callbacks
     
    97100    static void onFrameLoadError(void*, Evas_Object*, void*);
    98101    static void onDidDetectXSS(void*, Evas_Object*, void*);
     102
     103    static void onResponseReceived(void*, Evas_Object*, void*);
     104
     105    static void onResourceLoadFinished(void*, Evas_Object*, void*);
     106
     107    static void onResourceLoadFailed(void*, Evas_Object*, void*);
     108
     109    static void onNewResourceRequest(void*, Evas_Object*, void*);
    99110};
    100111
Note: See TracChangeset for help on using the changeset viewer.