Module: Selenium::WebDriver::ChildProcess::WindowsProcess

Defined in:
lib/selenium/webdriver/child_process.rb

Instance Method Summary collapse

Instance Method Details

#killObject



140
141
142
# File 'lib/selenium/webdriver/child_process.rb', line 140

def kill
  kill!
end

#startObject



119
120
121
122
123
124
125
126
127
# File 'lib/selenium/webdriver/child_process.rb', line 119

def start
  require "win32/process" # adds a dependency on windows - perhaps we could just use FFI instead?
  @pid = Process.create(
    :app_name        => @args.join(" "),
    :inherit         => false # don't inherit open file handles
  ).process_id

  self
end

#wait_nonblock(timeout) ⇒ Object



129
130
131
132
133
134
135
136
137
138
# File 'lib/selenium/webdriver/child_process.rb', line 129

def wait_nonblock(timeout)
  # win32-process doesn't support passing a second argument to waitpid2
  # See the README @ http://rubyforge.org/docman/view.php/85/707/README.html
  if defined?(Process::WNOHANG) && Process.method(:waitpid2).arity != 1
    return super
  end
  Timeout.timeout(timeout, Error::TimeOutError) { wait }
rescue Process::Error
  # no handle, great
end