Title: [115415] trunk
Revision
115415
Author
[email protected]
Date
2012-04-27 02:47:05 -0700 (Fri, 27 Apr 2012)

Log Message

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

Patch by Christophe Dumez <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (115414 => 115415)


--- trunk/LayoutTests/ChangeLog	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/LayoutTests/ChangeLog	2012-04-27 09:47:05 UTC (rev 115415)
@@ -1,3 +1,16 @@
+2012-04-27  Christophe Dumez  <[email protected]>
+
+        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
+        https://bugs.webkit.org/show_bug.cgi?id=81891
+
+        Reviewed by Philippe Normand.
+
+        Unskip tests which depend on EFL's DumpRenderTree support for
+        LayoutTestController's dumpResourceLoadCallbacks(), now that it is
+        implemented.
+
+        * platform/efl/Skipped:
+
 2012-04-27  Marcus Bulach  <[email protected]>
 
         [chromium] Update test expectation.

Modified: trunk/LayoutTests/platform/efl/Skipped (115414 => 115415)


--- trunk/LayoutTests/platform/efl/Skipped	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/LayoutTests/platform/efl/Skipped	2012-04-27 09:47:05 UTC (rev 115415)
@@ -640,10 +640,6 @@
 # Missing delegates: tests which need proper frame loader callbacks reporting
 fast/loader/file-protocol-fragment.html
 
-# Missing delegates: tests failing because of missing resource load delegate callbacks.
-fast/loader/main-document-url-for-non-http-loads.html
-http/tests/misc/link-rel-icon-beforeload.html
-
 # Missing delegates: tests failing because of missing policy delegate callbacks.
 fast/loader/onload-policy-ignore-for-frame.html
 fast/loader/policy-delegate-action-hit-test-zoomed.html
@@ -696,7 +692,6 @@
 
 # BUG: Missing resource load callback ability in DRT
 http/tests/loading/redirect-methods.html
-http/tests/misc/favicon-loads-with-images-disabled.html
 
 # Requires willSendRequestReturnsNullOnRedirect + willSendRequest + didFinishLoading
 http/tests/misc/will-send-request-returns-null-on-redirect.html
@@ -998,10 +993,19 @@
 http/tests/misc/acid3.html
 http/tests/misc/policy-delegate-called-twice.html
 http/tests/misc/redirect-to-external-url.html
-http/tests/misc/window-dot-stop.html
 http/tests/multipart/policy-ignore-crash.php
 http/tests/security/feed-urls-from-remote.html
 
+# ResourceError domain needs to be properly set in FrameLoaderClient
+# https://bugs.webkit.org/show_bug.cgi?id=84129
+http/tests/misc/window-dot-stop.html
+http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
+http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
+http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
+http/tests/security/XFrameOptions/x-frame-options-deny.html
+http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
+http/tests/xmlhttprequest/abort-should-cancel-load.html
+
 # Test times out (via GTK+)
 # https://bugs.webkit.org/show_bug.cgi?id=64085
 http/tests/misc/iframe-reparenting-id-collision.html
@@ -2094,18 +2098,10 @@
 http/tests/security/referrer-policy-redirect.html
 http/tests/security/xss-DENIED-xsl-document-redirect.xml
 http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-allow.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
-http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
-http/tests/security/XFrameOptions/x-frame-options-deny.html
-http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-allow.html
-http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html
 http/tests/ssl/referer-301.html
 http/tests/ssl/referer-303.html
 http/tests/ssl/verify-ssl-enabled.php
 http/tests/workers/terminate-during-sync-operation.html
-http/tests/xmlhttprequest/abort-should-cancel-load.html
 http/tests/xmlhttprequest/access-control-basic-whitelist-request-headers.html
 http/tests/xmlhttprequest/basic-auth-nopassword.html
 http/tests/xmlhttprequest/basic-auth-nouser.html

Modified: trunk/Source/WebKit/efl/ChangeLog (115414 => 115415)


--- trunk/Source/WebKit/efl/ChangeLog	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-04-27 09:47:05 UTC (rev 115415)
@@ -1,3 +1,31 @@
+2012-04-27  Christophe Dumez  <[email protected]>
+
+        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
+        https://bugs.webkit.org/show_bug.cgi?id=81891
+
+        Reviewed by Philippe Normand.
+
+        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:
+
 2012-04-26  Martin Robinson  <[email protected]>
 
         [Cairo] Wrap cairo surfaces in a class when storing native images

Modified: trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp (115414 => 115415)


--- trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp	2012-04-27 09:47:05 UTC (rev 115415)
@@ -234,6 +234,7 @@
 
     Ewk_Frame_Resource_Request request = { url.data(), firstParty.data(), httpMethod.data(), identifier, m_frame, isMainFrameRequest };
     ewk_frame_request_assign_identifier(m_frame, &request);
+    evas_object_smart_callback_call(m_view, "resource,request,new", &request);
 }
 
 void FrameLoaderClientEfl::postProgressStartedNotification()
@@ -261,13 +262,20 @@
     delete this;
 }
 
-void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long, const ResourceResponse& response)
+void FrameLoaderClientEfl::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long, const ResourceResponse& coreResponse)
 {
     // Update our knowledge of request soup flags - some are only set
     // after the request is done.
-    loader->request().setSoupMessageFlags(response.soupMessageFlags());
+    loader->request().setSoupMessageFlags(coreResponse.soupMessageFlags());
 
-    m_response = response;
+    m_response = coreResponse;
+
+    Ewk_Frame_Resource_Response response = { 0, coreResponse.httpStatusCode() };
+    CString url = ""
+    response.url = ""
+
+    ewk_frame_response_received(m_frame, &response);
+    evas_object_smart_callback_call(m_view, "resource,response,received", &response);
 }
 
 void FrameLoaderClientEfl::dispatchDecidePolicyForResponse(FramePolicyFunction function, const ResourceResponse& response, const ResourceRequest& resourceRequest)
@@ -748,12 +756,31 @@
 
 void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)
 {
-    notImplemented();
+    ewk_frame_load_resource_finished(m_frame, identifier);
+    evas_object_smart_callback_call(m_view, "load,resource,finished", &identifier);
 }
 
-void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err)
+void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError& err)
 {
-    notImplemented();
+    Ewk_Frame_Load_Error error;
+    CString errorDomain = err.domain().utf8();
+    CString errorDescription = err.localizedDescription().utf8();
+    CString failingUrl = err.failingURL().utf8();
+
+    DBG("ewkFrame=%p, resource=%ld, error=%s (%d, cancellation=%hhu) \"%s\", url=""
+        m_frame, identifier, errorDomain.data(), err.errorCode(), err.isCancellation(),
+        errorDescription.data(), failingUrl.data());
+
+    error.code = err.errorCode();
+    error.is_cancellation = err.isCancellation();
+    error.domain = errorDomain.data();
+    error.description = errorDescription.data();
+    error.failing_url = failingUrl.data();
+    error.resource_identifier = identifier;
+    error.frame = m_frame;
+
+    ewk_frame_load_resource_failed(m_frame, &error);
+    evas_object_smart_callback_call(m_view, "load,resource,failed", &error);
 }
 
 bool FrameLoaderClientEfl::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length)

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (115414 => 115415)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp	2012-04-27 09:47:05 UTC (rev 115415)
@@ -1230,7 +1230,7 @@
  * changing values in @param request.
  *
  * @param ewkFrame Frame.
- * @param @param messages Messages containing the request details that user may override and a
+ * @param messages Messages containing the request details that user may override and a
  * possible redirect reponse. Whenever values on this struct changes, it must be properly
  * malloc'd as it will be freed afterwards.
  *
@@ -1257,6 +1257,20 @@
 
 /**
  * @internal
+ * Reports that a response to a resource request was received.
+ *
+ * @param ewkFrame Frame.
+ * @param request Response details. No changes are allowed to fields.
+ *
+ * Emits signal: "resource,response,received"
+ */
+void ewk_frame_response_received(Evas_Object* ewkFrame, Ewk_Frame_Resource_Response* response)
+{
+    evas_object_smart_callback_call(ewkFrame, "resource,response,received", response);
+}
+
+/**
+ * @internal
  * Reports that first navigation occurred
  *
  * @param ewkFrame Frame.
@@ -1392,6 +1406,7 @@
         buffer.is_cancellation = isCancellation;
         buffer.description = errorDescription;
         buffer.failing_url = failingUrl;
+        buffer.resource_identifier = 0;
         buffer.frame = ewkFrame;
         error = &buffer;
     }
@@ -1402,6 +1417,29 @@
 
 /**
  * @internal
+ * Reports resource load finished.
+ *
+ * Emits signal: "load,resource,finished" with the resource
+ * request identifier.
+ */
+void ewk_frame_load_resource_finished(Evas_Object* ewkFrame, unsigned long identifier)
+{
+    evas_object_smart_callback_call(ewkFrame, "load,resource,finished", &identifier);
+}
+
+/**
+ * @internal
+ * Reports resource load failure, with error information.
+ *
+ * Emits signal: "load,resource,failed" with the error information.
+ */
+void ewk_frame_load_resource_failed(Evas_Object* ewkFrame, Ewk_Frame_Load_Error* error)
+{
+    evas_object_smart_callback_call(ewkFrame, "load,resource,failed", error);
+}
+
+/**
+ * @internal
  * Reports load failed with error information.
  *
  * Emits signal: "load,error" with pointer to Ewk_Frame_Load_Error.
@@ -1421,6 +1459,7 @@
     error.domain = errorDomain;
     error.description = errorDescription;
     error.failing_url = failingUrl;
+    error.resource_identifier = 0;
     error.frame = ewkFrame;
     evas_object_smart_callback_call(ewkFrame, "load,error", &error);
     EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);

Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.h (115414 => 115415)


--- trunk/Source/WebKit/efl/ewk/ewk_frame.h	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.h	2012-04-27 09:47:05 UTC (rev 115415)
@@ -46,6 +46,10 @@
  *  - "load,finished", const Ewk_Frame_Load_Error*: reports load
  *    finished and it gives @c NULL on success or pointer to
  *    structure defining the error.
+ *  - "load,resource,finished", unsigned long*: reports resource load finished and it gives
+ *    a pointer to its identifier.
+ *  - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
+ *    gives a pointer to structure defining the error as an argument.
  *  - "load,firstlayout,finished", void: frame finished first layout.
  *  - "load,nonemptylayout,finished", void: frame finished first
  *    non-empty layout.
@@ -61,6 +65,8 @@
  *    there's a new resource request.
  *  - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
  *    and the possible redirect response.
+ *  - "resource,response,received", Ewk_Frame_Resource_Response*: reports that a response
+ *    to a resource request was received.
  *  - "state,save", void: frame's state will be saved as a history item.
  *  - "title,changed", const char*: title of the main frame was changed.
  *  - "uri,changed", const char*: uri of the main frame was changed.
@@ -96,6 +102,7 @@
     const char *domain; /**< error domain name */
     const char *description; /**< error description already localized */
     const char *failing_url; /**< the url that failed to load */
+    unsigned long resource_identifier; /**< identifier of resource */
     Evas_Object *frame; /**< frame where the failure happened */
 };
 

Modified: trunk/Source/WebKit/efl/ewk/ewk_private.h (115414 => 115415)


--- trunk/Source/WebKit/efl/ewk/ewk_private.h	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/ewk/ewk_private.h	2012-04-27 09:47:05 UTC (rev 115415)
@@ -220,12 +220,15 @@
 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object* ewkFrame);
 void ewk_frame_load_document_finished(Evas_Object* ewkFrame);
 void ewk_frame_load_finished(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, bool isCancellation, const char* errorDescription, const char* failingUrl);
+void ewk_frame_load_resource_finished(Evas_Object* ewkFrame, unsigned long identifier);
+void ewk_frame_load_resource_failed(Evas_Object* ewkFrame, Ewk_Frame_Load_Error* error);
 void ewk_frame_load_error(Evas_Object* ewkFrame, const char* errorDomain, int errorCode, bool isCancellation, const char* errorDescription, const char* failingUrl);
 void ewk_frame_load_progress_changed(Evas_Object* ewkFrame);
 
 void ewk_frame_redirect_cancelled(Evas_Object* ewkFrame);
 void ewk_frame_request_will_send(Evas_Object* ewkFrame, Ewk_Frame_Resource_Messages* messages);
 void ewk_frame_request_assign_identifier(Evas_Object* ewkFrame, const Ewk_Frame_Resource_Request* request);
+void ewk_frame_response_received(Evas_Object* ewkFrame, Ewk_Frame_Resource_Response* response);
 void ewk_frame_view_state_save(Evas_Object* ewkFrame, WebCore::HistoryItem* item);
 
 void ewk_frame_did_perform_first_navigation(Evas_Object* ewkFrame);

Modified: trunk/Source/WebKit/efl/ewk/ewk_view.h (115414 => 115415)


--- trunk/Source/WebKit/efl/ewk/ewk_view.h	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.h	2012-04-27 09:47:05 UTC (rev 115415)
@@ -60,6 +60,10 @@
  *  - "load,progress", double*: load progress is changed (overall value
  *    from 0.0 to 1.0, connect to individual frames for fine grained).
  *  - "load,provisional", void: view started provisional load.
+ *  - "load,resource,finished", unsigned long*: reports resource load finished and it gives
+ *    a pointer to its identifier.
+ *  - "load,resource,failed", Ewk_Frame_Load_Error*: reports resource load failure and it
+ *    gives a pointer to structure defining the error as an argument.
  *  - "load,started", Evas_Object*: frame started loading the document.
  *  - "menubar,visible,get", Eina_Bool *: expects a @c EINA_TRUE if menubar is
  *    visible; @c EINA_FALSE, otherwise.
@@ -68,8 +72,11 @@
  *  - "mixedcontent,run", void: any of the containing frames has loaded and run mixed content.
  *  - "onload,event", Evas_Object*: a frame onload event has been received.
  *  - "ready", void: page is fully loaded.
+ *  - "resource,request,new", Ewk_Frame_Resource_Request*: reports that
+ *    there's a new resource request.
  *  - "resource,request,willsend", Ewk_Frame_Resource_Messages*: a resource will be requested.
  *    and the possible redirect response.
+ *  - "resource,response,received", Ewk_Frame_Resource_Response*: the network response for a resource.
  *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
  *    are visible; @c EINA_FALSE, otherwise.
  *  - "scrollbars,visible,set", Eina_Bool: sets scrollbars visibility.

Modified: trunk/Tools/ChangeLog (115414 => 115415)


--- trunk/Tools/ChangeLog	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Tools/ChangeLog	2012-04-27 09:47:05 UTC (rev 115415)
@@ -1,3 +1,26 @@
+2012-04-27  Christophe Dumez  <[email protected]>
+
+        [EFL] DRT should support LayoutTestController's dumpResourceLoadCallbacks()
+        https://bugs.webkit.org/show_bug.cgi?id=81891
+
+        Reviewed by Philippe Normand.
+
+        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):
+
 2012-04-27  Philippe Normand  <[email protected]>
 
         Unreviewed, GTK typo fix.

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (115414 => 115415)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2012-04-27 09:47:05 UTC (rev 115415)
@@ -47,6 +47,8 @@
 
 using namespace WebCore;
 
+HashMap<unsigned long, CString> DumpRenderTreeChrome::m_dumpAssignedUrls;
+
 PassOwnPtr<DumpRenderTreeChrome> DumpRenderTreeChrome::create(Evas* evas)
 {
     OwnPtr<DumpRenderTreeChrome> chrome = adoptPtr(new DumpRenderTreeChrome(evas));
@@ -89,12 +91,16 @@
 
     ewk_view_theme_set(view, DATA_DIR"/default.edj");
 
+    evas_object_smart_callback_add(view, "load,resource,failed", onResourceLoadFailed, 0);
+    evas_object_smart_callback_add(view, "load,resource,finished", onResourceLoadFinished, 0);
     evas_object_smart_callback_add(view, "load,started", onLoadStarted, 0);
     evas_object_smart_callback_add(view, "title,changed", onTitleChanged, 0);
     evas_object_smart_callback_add(view, "window,object,cleared", onWindowObjectCleared, m_gcController.get());
     evas_object_smart_callback_add(view, "statusbar,text,set", onStatusbarTextSet, 0);
     evas_object_smart_callback_add(view, "load,document,finished", onDocumentLoadFinished, 0);
+    evas_object_smart_callback_add(view, "resource,request,new", onNewResourceRequest, 0);
     evas_object_smart_callback_add(view, "resource,request,willsend", onWillSendRequest, 0);
+    evas_object_smart_callback_add(view, "resource,response,received", onResponseReceived, 0);
     evas_object_smart_callback_add(view, "onload,event", onWebViewOnloadEvent, 0);
     evas_object_smart_callback_add(view, "mixedcontent,run", onInsecureContentRun, 0);
     evas_object_smart_callback_add(view, "mixedcontent,displayed", onInsecureContentDisplayed, 0);
@@ -310,6 +316,22 @@
     return ret.utf8();
 }
 
+static CString descriptionSuitableForTestResult(Ewk_Frame_Load_Error* error)
+{
+    String ret = "<NSError domain ";
+    ret += error->domain;
+    ret += ", code ";
+    ret += String::number(error->code);
+    if (error->failing_url && *error->failing_url != '\0') {
+        ret += ", failing URL \"";
+        ret += error->failing_url;
+        ret += "\"";
+    }
+    ret += ">";
+
+    return ret.utf8();
+}
+
 // Smart Callbacks
 // ---------------
 
@@ -522,3 +544,42 @@
     if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
         printf("didDetectXSS\n");
 }
+
+void DumpRenderTreeChrome::onResponseReceived(void*, Evas_Object*, void* eventInfo)
+{
+    Ewk_Frame_Resource_Response* response = static_cast<Ewk_Frame_Resource_Response*>(eventInfo);
+
+    if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
+        CString responseDescription(descriptionSuitableForTestResult(response));
+        printf("%s - didReceiveResponse %s\n",
+               pathSuitableForTestResult(response->url).data(),
+               responseDescription.data());
+    }
+}
+
+void DumpRenderTreeChrome::onResourceLoadFinished(void*, Evas_Object*, void* eventInfo)
+{
+    unsigned long identifier = *static_cast<unsigned long*>(eventInfo);
+
+    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+        printf("%s - didFinishLoading\n",
+               (m_dumpAssignedUrls.contains(identifier) ? m_dumpAssignedUrls.take(identifier).data() : "<unknown>"));
+}
+
+void DumpRenderTreeChrome::onResourceLoadFailed(void*, Evas_Object*, void* eventInfo)
+{
+    Ewk_Frame_Load_Error* error = static_cast<Ewk_Frame_Load_Error*>(eventInfo);
+
+    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+        printf("%s - didFailLoadingWithError: %s\n",
+               (m_dumpAssignedUrls.contains(error->resource_identifier) ? m_dumpAssignedUrls.take(error->resource_identifier).data() : "<unknown>"),
+               descriptionSuitableForTestResult(error).data());
+}
+
+void DumpRenderTreeChrome::onNewResourceRequest(void*, Evas_Object*, void* eventInfo)
+{
+    Ewk_Frame_Resource_Request* request = static_cast<Ewk_Frame_Resource_Request*>(eventInfo);
+
+    if (!done && gLayoutTestController->dumpResourceLoadCallbacks())
+        m_dumpAssignedUrls.add(request->identifier, pathSuitableForTestResult(request->url));
+}

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h (115414 => 115415)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h	2012-04-27 09:16:37 UTC (rev 115414)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h	2012-04-27 09:47:05 UTC (rev 115415)
@@ -31,9 +31,11 @@
 
 #include <Eina.h>
 #include <Evas.h>
+#include <wtf/HashMap.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/Vector.h>
+#include <wtf/text/CString.h>
 
 class DumpRenderTreeChrome {
 public:
@@ -61,6 +63,7 @@
     Evas* m_evas;
     OwnPtr<GCController> m_gcController;
     Vector<Evas_Object*> m_extraViews;
+    static HashMap<unsigned long, CString> m_dumpAssignedUrls;
 
     // Smart callbacks
     static void onWindowObjectCleared(void*, Evas_Object*, void*);
@@ -96,6 +99,14 @@
 
     static void onFrameLoadError(void*, Evas_Object*, void*);
     static void onDidDetectXSS(void*, Evas_Object*, void*);
+
+    static void onResponseReceived(void*, Evas_Object*, void*);
+
+    static void onResourceLoadFinished(void*, Evas_Object*, void*);
+
+    static void onResourceLoadFailed(void*, Evas_Object*, void*);
+
+    static void onNewResourceRequest(void*, Evas_Object*, void*);
 };
 
 #endif // DumpRenderTreeChrome_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to