Skip to content

Commit 83fc018

Browse files
committed
Do not use Xvfb for OS X
1 parent e7d6678 commit 83fc018

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

dev/tests/js/JsTestDriver/run_js_tests.php

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,35 @@
139139
kill -9 $LSOF
140140
fi
141141
142-
DISPLAY_NUM=99
143-
ps -ef | egrep "[X]vfb.*:$DISPLAY_NUM"
144-
if [ $? -eq 0 ] ; then
145-
pkill Xvfb
142+
# Skip Xvfb setup for OS X since there browsers do not support headless display that way
143+
if [ "$(uname)" != "Darwin" ]; then
144+
DISPLAY_NUM=99
145+
ps -ef | egrep "[X]vfb.*:$DISPLAY_NUM"
146+
if [ $? -eq 0 ] ; then
147+
pkill Xvfb
148+
fi
149+
150+
XVFB=`which Xvfb`
151+
if [ "$?" -eq 1 ];
152+
then
153+
echo "Xvfb not found."
154+
exit 1
155+
fi
156+
157+
$XVFB :$DISPLAY_NUM -nolisten inet6 -ac &
158+
PID_XVFB="$!" # take the process ID
159+
export DISPLAY=:$DISPLAY_NUM # set display to use that of the Xvfb
146160
fi
147-
148-
XVFB=`which Xvfb`
149-
if [ "$?" -eq 1 ];
150-
then
151-
echo "Xvfb not found."
152-
exit 1
153-
fi
154-
155-
$XVFB :$DISPLAY_NUM -nolisten inet6 -ac &
156-
PID_XVFB="$!" # take the process ID
157-
export DISPLAY=:$DISPLAY_NUM # set display to use that of the Xvfb
161+
158162
USER=`whoami`
159163
SUDO=`which sudo`
160164
161165
# run the tests
162166
$SUDO -u $USER ' . $command . '
163167
164-
kill -9 $PID_XVFB # shut down Xvfb (firefox will shut down cleanly by JsTestDriver)
168+
if [ "$(uname)" != "Darwin" ]; then
169+
kill -9 $PID_XVFB # shut down Xvfb (firefox will shut down cleanly by JsTestDriver)
170+
fi
165171
echo "Done."';
166172

167173
fwrite($fh, $shellCommand . PHP_EOL);

0 commit comments

Comments
 (0)