fix DESTROY method now that processes are spawned with Child.pm
Chris Nehren [Fri, 15 Apr 2011 03:59:48 +0000 (23:59 -0400)]
lib/Test/Harness/Selenium.pm

index fa7130b..39721f7 100644 (file)
@@ -134,8 +134,12 @@ sub get_rows_for {
 
 sub DESTROY {
   my($self) = @_;
-  if(exists $self->{xvnc_pid}) {
-    kill("KILL", $self->{xvnc_pid});
+  if(exists $self->{selenium_rc}{xvnc_server_proc} and 
+    exists $self->{selenium_rc}{selenium_server_proc}) {
+    $self->{selenium_rc}{xvnc_server_proc}->complete ||
+      $self->{selenium_rc}{xvnc_server_proc}->kill("KILL");
+    $self->{selenium_rc}{selenium_server_proc}->complete ||
+      $self->{selenium_rc}{selenium_server_proc}->kill("KILL");
   }
 }