Title: [130363] trunk
Revision
130363
Author
[email protected]
Date
2012-10-03 22:42:45 -0700 (Wed, 03 Oct 2012)

Log Message

[EFL] Enable use of X11 in DumpRenderTree / WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=98231

Patch by Christophe Dumez <[email protected]> on 2012-10-03
Reviewed by Gyuyoung Kim.

Source/WebKit/efl:

Initialize ecore_x library in ewk_main since it is used by
WebKitEFL.

* ewk/ewk_main.cpp:
(ewk_init):
(ewk_shutdown):

Source/WebKit2:

Initialize ecore_x library in ewk_main instead of
WebKitTestRunner since WebKit is using ecore_x
not WebKitTestRunner itself.

* UIProcess/API/efl/ewk_main.cpp:
(ewk_init):
(ewk_shutdown):

Tools:

Enable use of X11 in DumpRenderTree / WebKitTestRunner.
Call ecore_evas_new() instead of ecore_evas_buffer_new()
in EFL's DumpRenderTree and WebKitTestRunner.
It is safe to do this now that we are using XvfbDriver
for the layout tests.

* DumpRenderTree/efl/DumpRenderTree.cpp:
(parseCommandLineOptions):
(initEcoreEvas):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::initEcoreEvas):
* WebKitTestRunner/efl/main.cpp:
(main):

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (130362 => 130363)


--- trunk/Source/WebKit/efl/ChangeLog	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-10-04 05:42:45 UTC (rev 130363)
@@ -1,3 +1,17 @@
+2012-10-03  Christophe Dumez  <[email protected]>
+
+        [EFL] Enable use of X11 in DumpRenderTree / WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=98231
+
+        Reviewed by Gyuyoung Kim.
+
+        Initialize ecore_x library in ewk_main since it is used by
+        WebKitEFL.
+
+        * ewk/ewk_main.cpp:
+        (ewk_init):
+        (ewk_shutdown):
+
 2012-10-03  Kangil Han  <[email protected]>
 
         Fix unused parameter compile warnings.

Modified: trunk/Source/WebKit/efl/ewk/ewk_main.cpp (130362 => 130363)


--- trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-10-04 05:42:45 UTC (rev 130363)
@@ -49,6 +49,10 @@
 #include <sys/stat.h>
 #include <wtf/Threading.h>
 
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
+
 static int _ewkInitCount = 0;
 
 /**
@@ -93,6 +97,13 @@
         goto error_edje;
     }
 
+#ifdef HAVE_ECORE_X
+    if (!ecore_x_init(0)) {
+        CRITICAL("could not init ecore_x.");
+        goto error_ecore_x;
+    }
+#endif
+
     if (!_ewk_init_body()) {
         CRITICAL("could not init body");
         goto error_edje;
@@ -100,6 +111,10 @@
 
     return ++_ewkInitCount;
 
+#ifdef HAVE_ECORE_X
+error_ecore_x:
+    edje_shutdown();
+#endif
 error_edje:
     ecore_evas_shutdown();
 error_ecore_evas:
@@ -121,6 +136,10 @@
     if (_ewkInitCount)
         return _ewkInitCount;
 
+#ifdef HAVE_ECORE_X
+    ecore_x_shutdown();
+#endif
+    edje_shutdown();
     ecore_evas_shutdown();
     ecore_shutdown();
     evas_shutdown();

Modified: trunk/Source/WebKit2/ChangeLog (130362 => 130363)


--- trunk/Source/WebKit2/ChangeLog	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-04 05:42:45 UTC (rev 130363)
@@ -1,3 +1,18 @@
+2012-10-03  Christophe Dumez  <[email protected]>
+
+        [EFL] Enable use of X11 in DumpRenderTree / WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=98231
+
+        Reviewed by Gyuyoung Kim.
+
+        Initialize ecore_x library in ewk_main instead of
+        WebKitTestRunner since WebKit is using ecore_x
+        not WebKitTestRunner itself.
+
+        * UIProcess/API/efl/ewk_main.cpp:
+        (ewk_init):
+        (ewk_shutdown):
+
 2012-10-03  Kangil Han  <[email protected]>
 
         Fix unused parameter compile warnings.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp (130362 => 130363)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp	2012-10-04 05:42:45 UTC (rev 130363)
@@ -31,6 +31,10 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
+
 static int _ewkInitCount = 0;
 
 /**
@@ -68,6 +72,13 @@
         goto error_ecore_evas;
     }
 
+#ifdef HAVE_ECORE_X
+    if (!ecore_x_init(0)) {
+        CRITICAL("could not init ecore_x.");
+        goto error_ecore_x;
+    }
+#endif
+
     g_type_init();
 
     if (!ecore_main_loop_glib_integrate()) {
@@ -77,6 +88,10 @@
 
     return ++_ewkInitCount;
 
+#ifdef HAVE_ECORE_X
+error_ecore_x:
+    edje_shutdown();
+#endif
 error_ecore_evas:
     ecore_shutdown();
 error_ecore:
@@ -95,6 +110,10 @@
     if (--_ewkInitCount)
         return _ewkInitCount;
 
+#ifdef HAVE_ECORE_X
+    ecore_x_shutdown();
+#endif
+    edje_shutdown();
     ecore_evas_shutdown();
     ecore_shutdown();
     evas_shutdown();

Modified: trunk/Tools/ChangeLog (130362 => 130363)


--- trunk/Tools/ChangeLog	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Tools/ChangeLog	2012-10-04 05:42:45 UTC (rev 130363)
@@ -1,3 +1,24 @@
+2012-10-03  Christophe Dumez  <[email protected]>
+
+        [EFL] Enable use of X11 in DumpRenderTree / WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=98231
+
+        Reviewed by Gyuyoung Kim.
+
+        Enable use of X11 in DumpRenderTree / WebKitTestRunner.
+        Call ecore_evas_new() instead of ecore_evas_buffer_new()
+        in EFL's DumpRenderTree and WebKitTestRunner.
+        It is safe to do this now that we are using XvfbDriver
+        for the layout tests.
+
+        * DumpRenderTree/efl/DumpRenderTree.cpp:
+        (parseCommandLineOptions):
+        (initEcoreEvas):
+        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
+        (WTR::initEcoreEvas):
+        * WebKitTestRunner/efl/main.cpp:
+        (main):
+
 2012-10-03  Dirk Pranke  <[email protected]>
 
         run-webkit-tests tests on win32 after r127302

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp (130362 => 130363)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp	2012-10-04 05:42:45 UTC (rev 130363)
@@ -68,7 +68,6 @@
 static bool dumpPixelsForCurrentTest;
 static int dumpTree = true;
 static int printSeparators = true;
-static int useX11Window = false;
 
 static String dumpFramesAsText(Evas_Object* frame)
 {
@@ -194,7 +193,6 @@
     static const option options[] = {
         {"notree", no_argument, &dumpTree, false},
         {"tree", no_argument, &dumpTree, true},
-        {"gui", no_argument, &useX11Window, true},
         {0, 0, 0, 0}
     };
 
@@ -420,7 +418,7 @@
 
 static Ecore_Evas* initEcoreEvas()
 {
-    Ecore_Evas* ecoreEvas = useX11Window ? ecore_evas_new(0, 0, 0, 800, 600, 0) : ecore_evas_buffer_new(800, 600);
+    Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
     if (!ecoreEvas) {
         shutdownEfl();
         exit(EXIT_FAILURE);

Modified: trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp (130362 => 130363)


--- trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp	2012-10-04 05:42:45 UTC (rev 130363)
@@ -28,11 +28,9 @@
 
 namespace WTR {
 
-static bool useX11Window = false;
-
 static Ecore_Evas* initEcoreEvas()
 {
-    Ecore_Evas* ecoreEvas = useX11Window ? ecore_evas_new(0, 0, 0, 800, 600, 0) : ecore_evas_buffer_new(800, 600);
+    Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
     if (!ecoreEvas)
         return 0;
 

Modified: trunk/Tools/WebKitTestRunner/efl/main.cpp (130362 => 130363)


--- trunk/Tools/WebKitTestRunner/efl/main.cpp	2012-10-04 04:32:42 UTC (rev 130362)
+++ trunk/Tools/WebKitTestRunner/efl/main.cpp	2012-10-04 05:42:45 UTC (rev 130363)
@@ -24,10 +24,6 @@
 #include <wtf/Assertions.h>
 #include <stdlib.h>
 
-#ifdef HAVE_ECORE_X
-#include <Ecore_X.h>
-#endif
-
 int main(int argc, char** argv)
 {
     WTFInstallReportBacktraceOnCrashHook();
@@ -35,26 +31,9 @@
     if (!ewk_init())
         return 1;
 
-#ifdef HAVE_ECORE_X
-    const char* display = getenv("DISPLAY");
-    int intialized = 0;
-    if (display) {
-        intialized = ecore_x_init(0);
-        if (!intialized) {
-            ewk_shutdown();
-            return 1;
-        }
-    }
-#endif
-
     // Prefer the not installed web and plugin processes.
     WTR::TestController controller(argc, const_cast<const char**>(argv));
 
-#ifdef HAVE_ECORE_X
-    if (intialized)
-        ecore_x_shutdown();
-#endif
-
     ewk_shutdown();
 
     return 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to