浏览代码

Die with proper message if no fixed binary port is available

Vangelis Katsikaros 9 年之前
父节点
当前提交
6c86522743
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/Selenium/CanStartBinary.pm

+ 3 - 0
lib/Selenium/CanStartBinary.pm

@@ -332,6 +332,9 @@ sub _build_binary_mode {
     # Either the user asked for 4444, or we couldn't find an open port
     my $port = $self->port + 0;
     return if $port == 4444;
+    if( $self->fixed_ports && $port == 0 ){
+        die "fixed port is not free";
+    }
 
     $self->_handle_firefox_setup($port);