class Selenium::WebDriver::Service

def chrome(**opts)

def chrome(**opts)
  Chrome::Service.new(**opts)
end

def driver_path=(path)

def driver_path=(path)
  Platform.assert_executable path if path.is_a?(String)
  @driver_path = path
end

def edge(**opts)

def edge(**opts)
  Edge::Service.new(**opts)
end

def extract_service_args(driver_opts)

def extract_service_args(driver_opts)
  WebDriver.logger.deprecate('initializing Service class with :args using Hash',
                             ':args parameter with an Array of String values',
                             id: :driver_opts)
  driver_opts.key?(:args) ? driver_opts.delete(:args) : []
end

def firefox(**opts)

def firefox(**opts)
  Firefox::Service.new(**opts)
end

def ie(**opts)

def ie(**opts)
  IE::Service.new(**opts)
end

def initialize(path: nil, port: nil, log: nil, args: nil)

def initialize(path: nil, port: nil, log: nil, args: nil)
  port ||= self.class::DEFAULT_PORT
  args ||= []
  @executable_path = path
  @host = Platform.localhost
  @port = Integer(port)
  @log = case log
         when :stdout
           $stdout
         when :stderr
           $stderr
         else
           log
         end
  @args = args.is_a?(Hash) ? extract_service_args(args) : args
  raise Error::WebDriverError, "invalid port: #{@port}" if @port < 1
end

def launch

def launch
  ServiceManager.new(self).tap(&:start)
end

def safari(**opts)

def safari(**opts)
  Safari::Service.new(**opts)
end

def shutdown_supported

def shutdown_supported
  self.class::SHUTDOWN_SUPPORTED
end