Modified: trunk/Tools/ChangeLog (89820 => 89821)
--- trunk/Tools/ChangeLog 2011-06-27 15:10:58 UTC (rev 89820)
+++ trunk/Tools/ChangeLog 2011-06-27 15:12:29 UTC (rev 89821)
@@ -1,3 +1,20 @@
+2011-06-27 Raphael Kubo da Costa <[email protected]>
+
+ Reviewed by Kent Tamura.
+
+ [EFL] DRT: Add an ewk_view specialization for EFL's DumpRenderTree.
+ It will be plugged into the build system as soon as the rest of the
+ DRT code is fully upstreamed.
+ https://bugs.webkit.org/show_bug.cgi?id=63086
+
+ * DumpRenderTree/efl/DumpRenderTreeView.cpp: Added.
+ (onConsoleMessage):
+ (onJavaScriptAlert):
+ (onJavaScriptConfirm):
+ (onJavaScriptPrompt):
+ (drtViewTiledAdd):
+ * DumpRenderTree/efl/DumpRenderTreeView.h: Added.
+
2011-06-27 Leandro Pereira <[email protected]>
Reviewed by Kent Tamura.
Added: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp (0 => 89821)
--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp 2011-06-27 15:12:29 UTC (rev 89821)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2011 ProFUSION Embedded Systems
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Red istributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DumpRenderTreeView.h"
+
+#include <EWebKit.h>
+#include <Eina.h>
+#include <Evas.h>
+#include <cstdio>
+
+using namespace std;
+
+static Ewk_View_Smart_Class gParentSmartClass = EWK_VIEW_SMART_CLASS_INIT_NULL;
+
+static void onConsoleMessage(Ewk_View_Smart_Data*, const char* message, unsigned int lineNumber, const char*)
+{
+ printf("CONSOLE MESSAGE: line %u: %s\n", lineNumber, message);
+}
+
+static void onJavaScriptAlert(Ewk_View_Smart_Data*, Evas_Object*, const char* message)
+{
+ printf("ALERT: %s\n", message);
+}
+
+static Eina_Bool onJavaScriptConfirm(Ewk_View_Smart_Data*, Evas_Object*, const char* message)
+{
+ printf("CONFIRM: %s\n", message);
+ return EINA_TRUE;
+}
+
+static Eina_Bool onJavaScriptPrompt(Ewk_View_Smart_Data*, Evas_Object*, const char* message, const char* defaultValue, char** value)
+{
+ printf("PROMPT: %s, default text: %s\n", message, defaultValue);
+ *value = strdup(defaultValue);
+ return EINA_TRUE;
+}
+
+Evas_Object* drtViewTiledAdd(Evas* evas)
+{
+ static Ewk_View_Smart_Class api = EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION("DRT_View_Tiled");
+
+ if (!ewk_view_tiled_smart_set(&api))
+ return 0;
+
+ if (EINA_UNLIKELY(!gParentSmartClass.sc.add))
+ ewk_view_base_smart_set(&gParentSmartClass);
+
+ api.add_console_message = onConsoleMessage;
+ api.run_javascript_alert = onJavaScriptAlert;
+ api.run_javascript_confirm = onJavaScriptConfirm;
+ api.run_javascript_prompt = onJavaScriptPrompt;
+
+ return evas_object_smart_add(evas, evas_smart_class_new(&api.sc));
+}
Added: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.h (0 => 89821)
--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.h (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.h 2011-06-27 15:12:29 UTC (rev 89821)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Red istributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DumpRenderTreeView_h
+#define DumpRenderTreeView_h
+
+#include <Evas.h>
+
+Evas_Object* drtViewTiledAdd(Evas*);
+
+#endif // DumpRenderTreeView_h