Title: [124445] trunk/Tools
Revision
124445
Author
[email protected]
Date
2012-08-02 05:56:16 -0700 (Thu, 02 Aug 2012)

Log Message

[EFL][WK2] WTR is failing when X server is not running
https://bugs.webkit.org/show_bug.cgi?id=92719

Patch by Alexander Shalamov <[email protected]> on 2012-08-02
Reviewed by Hajime Morita.

EFL's WebKitTestRunner doesn't execute tests when X server is not running.
This patch fixes the problem by checking environment variable before ecore x initialization.

* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.setup_environ_for_server):
* WebKitTestRunner/efl/main.cpp:
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (124444 => 124445)


--- trunk/Tools/ChangeLog	2012-08-02 12:52:27 UTC (rev 124444)
+++ trunk/Tools/ChangeLog	2012-08-02 12:56:16 UTC (rev 124445)
@@ -1,3 +1,18 @@
+2012-08-02  Alexander Shalamov  <[email protected]>
+
+        [EFL][WK2] WTR is failing when X server is not running
+        https://bugs.webkit.org/show_bug.cgi?id=92719
+
+        Reviewed by Hajime Morita.
+
+        EFL's WebKitTestRunner doesn't execute tests when X server is not running.
+        This patch fixes the problem by checking environment variable before ecore x initialization.
+
+        * Scripts/webkitpy/layout_tests/port/efl.py:
+        (EflPort.setup_environ_for_server):
+        * WebKitTestRunner/efl/main.cpp:
+        (main):
+
 2012-08-01  Dirk Pranke  <[email protected]>
 
         REGRESSION(r123893): Reftest mismatches are run through ImageDiff with 0.1 tolerance

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py (124444 => 124445)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py	2012-08-02 12:52:27 UTC (rev 124444)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/efl.py	2012-08-02 12:56:16 UTC (rev 124445)
@@ -27,6 +27,8 @@
 
 """WebKit Efl implementation of the Port interface."""
 
+import os
+
 from webkitpy.layout_tests.models.test_configuration import TestConfiguration
 from webkitpy.layout_tests.port.base import Port
 from webkitpy.layout_tests.port.pulseaudio_sanitizer import PulseAudioSanitizer
@@ -51,6 +53,10 @@
 
     def setup_environ_for_server(self, server_name=None):
         env = super(EflPort, self).setup_environ_for_server(server_name)
+        # If DISPLAY environment variable is unset in the system
+        # e.g. on build bot, remove DISPLAY variable from the dictionary
+        if not 'DISPLAY' in os.environ:
+            del env['DISPLAY']
         env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
         env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib')
         if self.webprocess_cmd_prefix:

Modified: trunk/Tools/WebKitTestRunner/efl/main.cpp (124444 => 124445)


--- trunk/Tools/WebKitTestRunner/efl/main.cpp	2012-08-02 12:52:27 UTC (rev 124444)
+++ trunk/Tools/WebKitTestRunner/efl/main.cpp	2012-08-02 12:56:16 UTC (rev 124445)
@@ -22,6 +22,7 @@
 #include "EWebKit2.h"
 #include "TestController.h"
 #include <wtf/Assertions.h>
+#include <stdlib.h>
 
 #ifdef HAVE_ECORE_X
 #include <Ecore_X.h>
@@ -35,9 +36,14 @@
         return 1;
 
 #ifdef HAVE_ECORE_X
-    if (!ecore_x_init(0)) {
-        ewk_shutdown();
-        return 1;
+    const char* display = getenv("DISPLAY");
+    int intialized = 0;
+    if (display) {
+        intialized = ecore_x_init(0);
+        if (!intialized) {
+            ewk_shutdown();
+            return 1;
+        }
     }
 #endif
 
@@ -45,7 +51,8 @@
     WTR::TestController controller(argc, const_cast<const char**>(argv));
 
 #ifdef HAVE_ECORE_X
-    ecore_x_shutdown();
+    if (intialized)
+        ecore_x_shutdown();
 #endif
 
     ewk_shutdown();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to