diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /qa/t/selenium_server_start.t | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'qa/t/selenium_server_start.t')
-rw-r--r-- | qa/t/selenium_server_start.t | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/qa/t/selenium_server_start.t b/qa/t/selenium_server_start.t index c08db293c..e70216433 100644 --- a/qa/t/selenium_server_start.t +++ b/qa/t/selenium_server_start.t @@ -9,9 +9,11 @@ use strict; use warnings; use constant DISPLAY => 99; + #use constant DISPLAY => 0; use Test::More tests => 12; + #use Test::More tests => 4; my $pid; @@ -21,63 +23,63 @@ $pid = xserver_start(); ok($pid, "X Server started with PID $pid on display " . DISPLAY); ok(open(XPID, ">testing.x.pid"), "Opening testing.x.pid"); ok((print XPID $pid), "Writing testing.x.pid"); -ok(close(XPID), "Closing testing.x.pid"); +ok(close(XPID), "Closing testing.x.pid"); # Start the VNC service second ok($pid = vnc_start(), "VNC desktop started with PID $pid"); ok(open(VNCPID, ">testing.vnc.pid"), "Opening testing.vnc.pid"); ok((print VNCPID $pid), "Writing testing.vnc.pid"); -ok(close(VNCPID), "Closing testing.vnc.pid"); +ok(close(VNCPID), "Closing testing.vnc.pid"); # Start the selenium server third ok($pid = selenium_start(), "Selenium RC server started with PID $pid"); ok(open(SPID, ">testing.selenium.pid"), "Opening testing.selenium.pid"); ok((print SPID $pid), "Writing testing.selenium.pid"); -ok(close(SPID), "Closing testing.selenium.pid"); +ok(close(SPID), "Closing testing.selenium.pid"); sleep(10); # Subroutines sub xserver_start { - my $pid; - my @x_cmd = qw(Xvfb -ac -screen 0 1600x1200x24 -fbdir /tmp); - push(@x_cmd, ":" . DISPLAY); - $pid = fork(); - if (!$pid) { - open(STDOUT, ">/dev/null"); - open(STDERR, ">/dev/null"); - exec(@x_cmd) || die "unable to execute: $!"; - } - else { - return $pid; - } - return 0; + my $pid; + my @x_cmd = qw(Xvfb -ac -screen 0 1600x1200x24 -fbdir /tmp); + push(@x_cmd, ":" . DISPLAY); + $pid = fork(); + if (!$pid) { + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + exec(@x_cmd) || die "unable to execute: $!"; + } + else { + return $pid; + } + return 0; } sub vnc_start { - my @vnc_cmd = qw(x11vnc -viewonly -forever -nopw -quiet -display); - push(@vnc_cmd, ":" . DISPLAY); - my $pid = fork(); - if (!$pid) { - open(STDOUT, ">/dev/null"); - open(STDERR, ">/dev/null"); - exec(@vnc_cmd) || die "unabled to execute: $!"; - } - return $pid; + my @vnc_cmd = qw(x11vnc -viewonly -forever -nopw -quiet -display); + push(@vnc_cmd, ":" . DISPLAY); + my $pid = fork(); + if (!$pid) { + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + exec(@vnc_cmd) || die "unabled to execute: $!"; + } + return $pid; } sub selenium_start { - my @selenium_cmd = qw(java -jar ../config/selenium-server-standalone.jar - -firefoxProfileTemplate ../config/firefox - -log ../config/selenium.log - -singlewindow); - unshift(@selenium_cmd, "env", "DISPLAY=:" . DISPLAY); - my $pid = fork(); - if (!$pid) { - open(STDOUT, ">/dev/null"); - open(STDERR, ">/dev/null"); - exec(@selenium_cmd) || die "unable to execute: $!"; - } - return $pid; + my @selenium_cmd = qw(java -jar ../config/selenium-server-standalone.jar + -firefoxProfileTemplate ../config/firefox + -log ../config/selenium.log + -singlewindow); + unshift(@selenium_cmd, "env", "DISPLAY=:" . DISPLAY); + my $pid = fork(); + if (!$pid) { + open(STDOUT, ">/dev/null"); + open(STDERR, ">/dev/null"); + exec(@selenium_cmd) || die "unable to execute: $!"; + } + return $pid; } |