Skip to content

Commit

Permalink
Remove self-executable Ruby scripts
Browse files Browse the repository at this point in the history
Rather than running those directly, use IRB.

Mentioned IE + FFI + MRI issue no longer reproduces on Win 10 + IE11 +
MRI 2.3.
  • Loading branch information
p0deje committed Mar 6, 2019
1 parent c208745 commit 674a9ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
14 changes: 0 additions & 14 deletions rb/lib/selenium/webdriver/common/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,3 @@ def interfaces
end # Platform
end # WebDriver
end # Selenium

if $PROGRAM_NAME == __FILE__
p engine: Selenium::WebDriver::Platform.engine,
os: Selenium::WebDriver::Platform.os,
ruby_version: Selenium::WebDriver::Platform.ruby_version,
jruby?: Selenium::WebDriver::Platform.jruby?,
windows?: Selenium::WebDriver::Platform.windows?,
home: Selenium::WebDriver::Platform.home,
bitsize: Selenium::WebDriver::Platform.bitsize,
localhost: Selenium::WebDriver::Platform.localhost,
ip: Selenium::WebDriver::Platform.ip,
interfaces: Selenium::WebDriver::Platform.interfaces,
null_device: Selenium::WebDriver::Platform.null_device
end
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ def initialize(path, port = nil)
end

def start
if Platform.jruby?
if Platform.jruby? || Platform.windows?
start_threaded
elsif Platform.windows?
start_windows
else
start_forked
end
Expand Down Expand Up @@ -96,17 +94,6 @@ def start_threaded
sleep 0.5
end

def start_windows
if %w[ie internet_explorer].include? ENV['WD_SPEC_DRIVER']
# For IE, the combination of Windows + FFI + MRI seems to cause a
# deadlock with the get() call and the server thread.
# Workaround by running this file in a subprocess.
@process = ChildProcess.build('ruby', '-r', 'rubygems', __FILE__, @path, @port.to_s).start
else
start_threaded
end
end

class TestApp
BASIC_AUTH_CREDENTIALS = %w[test test].freeze

Expand Down Expand Up @@ -135,7 +122,3 @@ def call(env)
end # SpecSupport
end # WebDriver
end # Selenium

if $PROGRAM_NAME == __FILE__
Selenium::WebDriver::SpecSupport::RackServer.new(ARGV[0], ARGV[1]).run
end

0 comments on commit 674a9ea

Please sign in to comment.