[EFL] EFL's DRT should print the number of MessagePorts for new each new intent
authorrakuco@webkit.org <rakuco@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2012 21:44:47 +0000 (21:44 +0000)
committerrakuco@webkit.org <rakuco@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2012 21:44:47 +0000 (21:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86841

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-05-30
Reviewed by Adam Barth.

Source/WebKit/efl:

Add EWKPrivate method to retrieve the internal WebCore object for a Ewk_Intent.
Add helper function to DumpRenderTreeSupportEfl that returns the MessagePorts
for a Ewk_Intent object so that the DRT can print information about them.

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::intentMessagePorts):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
(WebCore):
* ewk/ewk_intent.cpp:
(EWKPrivate):
(EWKPrivate::coreIntent):
* ewk/ewk_intent_private.h:
(EWKPrivate):

Tools:

Print the number of MessagePorts for each new intent in EFL's DRT.
This output is expected by several Web Intents test cases.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::onFrameIntentNew):

LayoutTests:

Unskip the test case which requires the DumpRenderTree to print out
the number of MessagePorts for each new intent.

* platform/efl/test_expectations.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/efl/test_expectations.txt
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h
Source/WebKit/efl/ewk/ewk_intent.cpp
Source/WebKit/efl/ewk/ewk_intent_private.h
Tools/ChangeLog
Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp

index 67e7c38..037507d 100644 (file)
@@ -1,3 +1,15 @@
+2012-05-30  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [EFL] EFL's DRT should print the number of MessagePorts for new each new intent
+        https://bugs.webkit.org/show_bug.cgi?id=86841
+
+        Reviewed by Adam Barth.
+
+        Unskip the test case which requires the DumpRenderTree to print out
+        the number of MessagePorts for each new intent.
+
+        * platform/efl/test_expectations.txt:
+
 2012-05-30  Emil A Eklund  <eae@chromium.org>
 
         Inline blocks with margin wrap incorrectly with subpixel layout turned on
index 95ad1bb..f7d80a3 100644 (file)
@@ -653,8 +653,7 @@ BUGWK84167 : tables/mozilla/bugs/bug2479-2.html = IMAGE+TEXT
 // Incomplete Web Intents support
 BUGWK86866 SKIP : webintents/intent-tag.html = TEXT
 BUGWK86865 SKIP : webintents/web-intents-delivery.html = TEXT
-BUGWK86841 SKIP : webintents/web-intents-invoke-port.html = TEXT
-BUGWK86873 SKIP : webintents/web-intents-obj-constructor.html = TEXT
+BUGWK87118 : webintents/web-intents-obj-constructor.html = TEXT
 
 // EFL's LayoutTestController does not implement setAutomaticLinkDetectionEnabled
 BUGWK85463 SKIP : editing/inserting/typing-space-to-trigger-smart-link.html = FAIL
index 162a30d..0da6834 100644 (file)
@@ -1,5 +1,26 @@
 2012-05-30  Christophe Dumez  <christophe.dumez@intel.com>
 
+        [EFL] EFL's DRT should print the number of MessagePorts for new each new intent
+        https://bugs.webkit.org/show_bug.cgi?id=86841
+
+        Reviewed by Adam Barth.
+
+        Add EWKPrivate method to retrieve the internal WebCore object for a Ewk_Intent.
+        Add helper function to DumpRenderTreeSupportEfl that returns the MessagePorts 
+        for a Ewk_Intent object so that the DRT can print information about them.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::intentMessagePorts):
+        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
+        (WebCore):
+        * ewk/ewk_intent.cpp:
+        (EWKPrivate):
+        (EWKPrivate::coreIntent):
+        * ewk/ewk_intent_private.h:
+        (EWKPrivate):
+
+2012-05-30  Christophe Dumez  <christophe.dumez@intel.com>
+
         [EFL] Ewk_Intent_Request's postResult/postFailure should take serialized script values in argument
         https://bugs.webkit.org/show_bug.cgi?id=87829
 
index c0925b3..7e2127a 100644 (file)
@@ -42,6 +42,7 @@
 #include <HTMLInputElement.h>
 #include <InspectorController.h>
 #include <IntRect.h>
+#include <Intent.h>
 #include <JSCSSStyleDeclaration.h>
 #include <JSElement.h>
 #include <JavaScriptCore/OpaqueJSString.h>
@@ -679,6 +680,16 @@ void DumpRenderTreeSupportEfl::sendWebIntentResponse(Ewk_Intent_Request* request
 #endif
 }
 
+WebCore::MessagePortChannelArray* DumpRenderTreeSupportEfl::intentMessagePorts(const Ewk_Intent* intent)
+{
+#if ENABLE(WEB_INTENTS)
+    const WebCore::Intent* coreIntent = EWKPrivate::coreIntent(intent);
+    return coreIntent ? coreIntent->messagePorts() : 0;
+#else
+    return 0;
+#endif
+}
+
 void DumpRenderTreeSupportEfl::setComposition(Evas_Object* ewkView, const char* text, int start, int length)
 {
     WebCore::Page* page = EWKPrivate::corePage(ewkView);
index 6886b94..c8007a2 100644 (file)
 
 typedef struct _Evas_Object Evas_Object;
 typedef struct _Ewk_History_Item Ewk_History_Item;
+typedef struct _Ewk_Intent Ewk_Intent;
 typedef struct _Ewk_Intent_Request Ewk_Intent_Request;
 
 typedef Vector<Ewk_History_Item*> HistoryItemChildrenVector;
 
 namespace WebCore {
 class Frame;
+class MessagePortChannel;
+typedef Vector<OwnPtr<MessagePortChannel>, 1> MessagePortChannelArray;
 }
 
 class EAPI DumpRenderTreeSupportEfl {
@@ -105,7 +108,10 @@ public:
     static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
     static void setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool);
     static void setSerializeHTTPLoads(bool);
+    
+    // Web Intents
     static void sendWebIntentResponse(Ewk_Intent_Request*, JSStringRef response);
+    static WebCore::MessagePortChannelArray* intentMessagePorts(const Ewk_Intent*);
 
     // TextInputController
     static void setComposition(Evas_Object*, const char*, int, int);
index 9302263..e1da07f 100644 (file)
@@ -159,7 +159,7 @@ Eina_List* ewk_intent_extra_names_get(const Ewk_Intent* intent)
  * Creates a new Ewk_Intent object.
  *
  * @param core WebCore::Intent instance to use internally.
- * @return a new allocated the Ewk_Intent object on sucess or @c 0 on failure
+ * @return a new allocated the Ewk_Intent object on success or @c 0 on failure
  */
 Ewk_Intent* ewk_intent_new(WebCore::Intent* core)
 {
@@ -188,4 +188,14 @@ void ewk_intent_free(Ewk_Intent* intent)
     eina_stringshare_del(intent->service);
     delete intent;
 }
+
+namespace EWKPrivate {
+
+WebCore::Intent* coreIntent(const Ewk_Intent* intent)
+{
+    EWK_INTENT_CORE_GET_OR_RETURN(intent, core, 0);
+    return core;
+}
+
+} // namespace EWKPrivate
 #endif
index de7b471..aaec903 100644 (file)
@@ -38,6 +38,11 @@ Ewk_Intent_Request* ewk_intent_request_new(PassRefPtr<WebCore::IntentRequest> co
 
 void ewk_intent_request_result_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> result);
 void ewk_intent_request_failure_post(Ewk_Intent_Request* request, PassRefPtr<WebCore::SerializedScriptValue> failure);
+
+namespace EWKPrivate {
+WebCore::Intent* coreIntent(const Ewk_Intent* intent);
+} // namespace EWKPrivate
+
 #endif
 
 #endif // ewk_intent_private_h
index 913d1df..8eb3bcd 100644 (file)
@@ -1,3 +1,16 @@
+2012-05-30  Christophe Dumez  <christophe.dumez@intel.com>
+
+        [EFL] EFL's DRT should print the number of MessagePorts for new each new intent
+        https://bugs.webkit.org/show_bug.cgi?id=86841
+
+        Reviewed by Adam Barth.
+
+        Print the number of MessagePorts for each new intent in EFL's DRT.
+        This output is expected by several Web Intents test cases.
+
+        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+        (DumpRenderTreeChrome::onFrameIntentNew):
+
 2012-05-30  Kevin Ollivier  <kevino@theolliviers.com>
 
         [wx] Unreviewed build fix after removal of setJavaScriptProfilingEnabled.
index 307e9f3..d95bf81 100644 (file)
@@ -703,7 +703,9 @@ void DumpRenderTreeChrome::onFrameIntentNew(void*, Evas_Object*, void* eventInfo
            ewk_intent_action_get(intent),
            ewk_intent_type_get(intent));
 
-    // TODO: Display number of ports once Ewk_Intent exposes this information.
+    const MessagePortChannelArray* messagePorts = DumpRenderTreeSupportEfl::intentMessagePorts(intent);
+    if (messagePorts)
+        printf("Have %d ports\n", static_cast<int>(messagePorts->size()));
 
     const char* service = ewk_intent_service_get(intent);
     if (service && strcmp(service, ""))