Skip to content

Commit

Permalink
Workaround IO inhertiance in Marionette on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Mar 31, 2016
1 parent eb0da48 commit 0a6b17f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rb/lib/selenium/webdriver/firefox/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def stop
end
ensure
stop_process
if Platform.windows? && !$DEBUG
@process.io.close rescue nil
end
end

def uri
Expand All @@ -95,7 +98,14 @@ def start_process
server_command = [@executable_path, "--binary=#{Firefox::Binary.path}", "--webdriver-port=#{@port}", *@extra_args]
@process = ChildProcess.build(*server_command)

@process.io.inherit! if $DEBUG || Platform.os == :windows
if $DEBUG == true
@process.io.inherit!
elsif Platform.windows?
# workaround stdio inheritance issue
# https://github.com/jgraham/wires/issues/48
@process.io.stdout = @process.io.stderr = File.new(Platform.null_device, 'w')
end

@process.start
end

Expand Down

0 comments on commit 0a6b17f

Please sign in to comment.