fix signal sent to stop app server. fix starting and stopping of selenium/xvnc server...
Chris Nehren [Fri, 15 Apr 2011 04:27:37 +0000 (00:27 -0400)]
lib/Test/Harness/Selenium.pm

index 39721f7..e0097e8 100644 (file)
@@ -101,16 +101,17 @@ sub start_app_server {
 
 sub stop_app_server {
   my($self) = @_;
-  $self->{app_server_proc}->complete || $self->{app_server_proc}->kill(9);
+  $self->{app_server_proc}->complete || $self->{app_server_proc}->kill("KILL");
 }
 
 sub test_directory {
   my ($self, $dir) = @_;
+  if($self->{selenium_rc}{start} && !$self->{selenium_rc}{selenium_server_proc}) {
+    $self->start_selenium_server;
+  }
   my @tests = File::Find::Rule->file()->name('*.html')->in($dir);
   for my $test (@tests) {
-    $self->start_server;
     $self->run_tests_for($test);
-    $self->stop_server;
   }
 }
 
@@ -141,6 +142,7 @@ sub DESTROY {
     $self->{selenium_rc}{selenium_server_proc}->complete ||
       $self->{selenium_rc}{selenium_server_proc}->kill("KILL");
   }
+  $self->stop_app_server;
 }
 
 1;