Преглед на файлове

Merge pull request #192 from gempesaw/before-demolish

(in cleanup) Can't call method "get_params" on an undefined value
Daniel Gempesaw преди 10 години
родител
ревизия
f6d45709cd
променени са 1 файла, в които са добавени 8 реда и са изтрити 2 реда
  1. 8 2
      lib/Selenium/Remote/Driver.pm

+ 8 - 2
lib/Selenium/Remote/Driver.pm

@@ -483,8 +483,9 @@ sub new_from_caps {
 }
 
 sub DEMOLISH {
-    my ($self) = @_;
+    my ($self, $in_global_destruction) = @_;
     return if $$ != $self->pid;
+    return if $in_global_destruction;
     $self->quit() if ( $self->auto_close && defined $self->session_id );
 }
 
@@ -982,7 +983,12 @@ sub close {
 =head2 quit
 
  Description:
-    Delete the session & close open browsers.
+    Delete the session & close open browsers. We will try to call this
+    on our down when we get DEMOLISHed, but in the event that we are
+    only demolished during global destruction, we will not be able to
+    close the browser. For your own unattended and/or complicated tests,
+    we recommend explicitly calling quit to make sure you're not leaving
+    orphan browsers around.
 
  Usage:
     $driver->quit();