[gnome-settings-daemon] tests: Use Xvfb instead of Xorg + dummy plugin



commit 957db0e6231178cbf4c2fef7dc2467c3ff19d923
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 17 12:02:50 2017 +0100

    tests: Use Xvfb instead of Xorg + dummy plugin
    
    It's easier to setup for our purpose, and now supports XRandR since
    support got merged in December 2015.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=26391

 tests/Makefile.am     |    1 -
 tests/gsdtestcase.py  |   26 +++++---------------------
 tests/xorg-dummy.conf |    4 ----
 3 files changed, 5 insertions(+), 26 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1e83344..da78a69 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,5 +8,4 @@ EXTRA_DIST =                    \
        gsdtestcase.py          \
        dummy.session           \
        dummyapp.desktop        \
-       xorg-dummy.conf         \
        $(NULL)
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index 4dec7b2..ed0a0a0 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -201,32 +201,17 @@ class GSDTestCase(dbusmock.DBusTestCase):
 
     @classmethod
     def start_xorg(klass):
-        '''start X.org server with dummy driver'''
-
-        conf = os.path.join(os.path.dirname(__file__), 'xorg-dummy.conf')
-
-        # some distros like Fedora install Xorg as suid root; copy it into our
-        # workdir to drop the suid bit and run it as user
-        if GLib.file_test('/usr/libexec/Xorg.bin', GLib.FileTest.IS_EXECUTABLE):
-            xorg = '/usr/libexec/Xorg.bin'
-        else:
-            out = GLib.find_program_in_path ('Xorg')
-            if not out:
-                sys.stderr.write('ERROR: Xorg not installed\n')
-                sys.exit(1)
-            xorg = os.path.join(klass.workdir, 'Xorg')
-            shutil.copy(out, xorg)
+        '''start Xvfb server'''
 
+        xorg = GLib.find_program_in_path ('Xvfb')
         display_num = 99
 
         if os.path.isfile('/tmp/.X%d-lock' % display_num):
             sys.stderr.write('Cannot start X.org, an instance already exists\n')
             sys.exit(1)
 
-        # You can rename the log file to *.log if you want to see it on test
-        # case failures
-        log = os.path.join(klass.workdir, 'Xorg.out')
-        klass.xorg = subprocess.Popen([xorg, '-config', conf, '-logfile', log, ':%d' % display_num],
+        # Composite extension won't load unless at least 24bpp is set
+        klass.xorg = subprocess.Popen([xorg, ':%d' % display_num, "-screen", "0", "1280x1024x24", 
"+extension", "GLX"],
                                       stderr=subprocess.PIPE)
         os.environ['DISPLAY'] = ':%d' % display_num
 
@@ -243,8 +228,7 @@ class GSDTestCase(dbusmock.DBusTestCase):
                                stderr=subprocess.PIPE) == 0:
                 break
         if timeout <= 0:
-            with open(log) as f:
-                sys.stderr.write('Cannot start X.org with dummy driver.  Log:\n%s\n--------' % f.read())
+            sys.stderr.write('Cannot start Xvfb.\n--------')
             sys.exit(1)
 
     @classmethod


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]